On Wednesday 14 September 2005 21:22, Jeff Dike wrote: > On Tue, Sep 13, 2005 at 08:01:40PM +0200, Blaisorblade wrote: > > It's just because things are called under spinlocks and GFP_KERNEL is > > used - but if possible, it'd be better to use something better than > > GFP_ATOMIC (since this is performance critical).
> This would be ubd_io_lock, which is taken for us by the block layer before > entering do_ubd_request. We could make that a GFP_ATOMIC allocation, > except that we have already dequeued the request, so would need to do > something with it if the allocation failed. > I'm wondering if we can drop the lock before do_io and pick it up > afterwards. The bitmap argument the COW bitmap, right? > is a global, which is a problem. Two > racing requests could result in one writing out a bitmap which is > either too old or too new. > So, I'm not sure how to handle this. We could requeue what's left of > the request if an allocation failure happens. Assuming it can be done, it'd be ok. However, why have we already dequeued the request? Looking for examples, via grep blkdev_dequeue_request drivers/ide/*.c and going opening drivers/ide/ide-io.c, I found blkdev_dequeue_request() called *after* end_that_request_first(), while there it's called before. A comment in blk_start_pre_flush() says there's some freedom, but probably leaving the request in the queue would be ok.... > We could drop the lock > and pick it up later, but we have to be careful to write out the > current bitmap, not one which we saved earlier or one which has been > updated to reflect a racing request which is coming through later. If you work on the second, be also sure to ask Jens Axboe (see MAINTAINERS for email) whether it's legal for the block layer. CC'ing him on the change in first place would not have been a bad idea, either (IMHO). > Jeff -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Messenger: chiamate gratuite in tutto il mondo http://it.messenger.yahoo.com ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
