Re: [rfc][patch] remove racy sync_page?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds wrote:

Tell me WHERE you can unplug in that sequence. I will tell you where you can NOT unplug:

...

- you can NOT just unplug in the path _after_ "readpage()", because the IO may have been started by SOMEBODY ELSE that just did read-ahead, and didn't unplug (on _purpose_ - the whole point of doing read-ahead is to allow concurrent IO execution, so a read-aheader that unplugs is broken by definition)

Umm, this happens with the current lock_page() after readpage. And
with per-task plugs, you do not unplug anybody else.

Sure it isn't perfect (you can still concoct a sequence of concurrent
tasks doing funny things that result in a slightly suboptimal request
pattern), but to me it sounds as good or better in some cases than
what we have now.

So what is your alternative? Put the explicit unplug at every possible occurrence of lock_page() (and keep in mind that some of them don't want it: we only want it when the lock-page will block, which is not always true. Some people lock the page not because it's under IO, and they're waiting for it to be unlocked, but because it's dirty and they're going to start IO on it - the lock_page() generally won't block on that, and if it doesn't, we don't want to kick previous IO).

I keep telling you. Put the unplug after submission of IO. Not before
waiting for IO.

I'll give you one example of how it could be better (feel free to ask
for others too). Your sys_readahead(). Someone asks to readahead 1MB
of data, currently if the queue is empty, that's going to sit around
for 4ms before starting the read. 4ms later, the app comes back hoping
for the request to have finished. Unfortunately it takes another 4ms.
Throughput is halved.

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux