Re: [RFC][PATCH] 2.5.37 patch for making DIO async

From: Andrew Morton (
Date: Fri Sep 20 2002 - 18:31:31 EST

Badari Pulavarty wrote:
> Hi,
> Here is 2.5.37 patch for making DIO code async. Waiting for IO completion
> will be done at the higher level. This patch adds support for RAW Async IO.
> We already posted performance comparisions numbers earlier on 2.5.35.
> ISSUE: This patch does set_page_dirty() on a page, from the interrupt
> handler (io completion handler). Which is NOT safe. Any suggestions
> on (where and how to) moving this outside the interrupt handler ?
> Ben & Andrew, any ideas ?

No particularly good ones, I'm afraid. Options appear to be:

1: Lose data if the pages are swapcache or pagecache.

2: Make mapping->page_lock and mapping->private_lock irq-safe,
   and mandate that a_ops->set_page_dirty be callable from
   interrupt context.

3: Hang onto the BIOs and find a process somewhere to mark the
   pages dirty and then release them after IO has completed.

None of these are particularly palatable. But if this is a
showstopper for async IO against raw devices, and a showstopper
for async IO against O_DIRECT blockdevs and a showstopper for
async IO against O_DIRECT files (is it?) then I guess we clench
the teeth and go for option 2.

Holding onto gazillions of BIOs and punting it all up to keventd
some time in the future would be lame. Making those locks and these
codepaths irq-safe is consistent with the general tougher, tighter
and more async direction in which the 2.5 IO paths are headed, so...

With the radix-tree gang lookup and truncate rework I expect that
the maximum hold time of those locks is miniscule, so interrupt
latency isn't a concern here. (It would be 50 milliseconds or
more at present...)

ho-hum. I'll do the patch.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Sep 23 2002 - 22:00:32 EST