From b11f9dd52aac5645107b2d8cb24361e9495b17d6 Mon Sep 17 00:00:00 2001 From: sos Date: Thu, 17 Apr 2008 12:29:35 +0000 Subject: Go back to preallocating everything possible on init. This avoids calling busdma in the request processing path which caused a traumatic performance degradation. Allocation has be postponed to after we know how many devices we possible can have on portmulitpliers to save some space. --- sys/dev/ata/atapi-cd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sys/dev/ata/atapi-cd.c') diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index f9fcf97..7bf3b9f 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -691,11 +691,12 @@ acd_geom_access(struct g_provider *pp, int dr, int dw, int de) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int timeout = 60, track; - if (!(request = ata_alloc_request(dev))) + if (!(request = ata_alloc_request())) return ENOMEM; /* wait if drive is not finished loading the medium */ while (timeout--) { + request->dev = dev; bcopy(ccb, request->u.atapi.ccb, 16); request->flags = ATA_R_ATAPI; request->timeout = 5; @@ -855,10 +856,11 @@ acd_strategy(struct bio *bp) ccb[7] = count>>8; ccb[8] = count; - if (!(request = ata_alloc_request(dev))) { + if (!(request = ata_alloc_request())) { g_io_deliver(bp, ENOMEM); return; } + request->dev = dev; request->bio = bp; bcopy(ccb, request->u.atapi.ccb, (atadev->param.config & ATA_PROTO_MASK) == @@ -1218,9 +1220,10 @@ acd_get_progress(device_t dev, int *finished) struct ata_request *request; int8_t dummy[8]; - if (!(request = ata_alloc_request(dev))) + if (!(request = ata_alloc_request())) return ENOMEM; + request->dev = dev; bcopy(ccb, request->u.atapi.ccb, 16); request->data = dummy; request->bytecount = sizeof(dummy); -- cgit v1.1