On Sat, 2 Sep 2000, Linus Torvalds wrote: > You don't actually have to be smart. > > There's a really simple way to avoid this: compare the thing you're going > to zero out against zero before you memset() it to zero. If it was already > zero, you just unlock the page and release. > > Downside: you have to read the page in, in order to compare. However, this > turns out to be a non-issue: if there were no blocks on that page (like a > forward truncate) this ends up generating no IO anyway. If there _were_ > blocks on the page, it's likely that one of them was the one we're going > to partially clear anyway, so the "prepare_write()" would have had to read > it in anyway. > > Upside: you don't need to mark it dirty unnecessarily, assuming you just > extended the file. No extra allocation, and no extra write to disk. > > Comments? Basically the "grab_cache_page()" would be a "read_cache_page()" > instead with all the wait-on-page etc stuff. Works for me. However, that way it looks like a fs/buffer.c fodder. Mind if I just call it block_zero_page(page, from, to) and export it? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
- Re: 2.4.0-test8-pre1 is quite bad / how about integ... Rik van Riel
- Re: 2.4.0-test8-pre1 is quite bad / how about ... Linus Torvalds
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Henrik Størner
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Linus Torvalds
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Henrik Størner
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Alexander Viro
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Benjamin Herrenschmidt
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Alexander Viro
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Alexander Viro
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Linus Torvalds
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Alexander Viro
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Linus Torvalds
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Alexander Viro
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Alexander Viro
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Alexander Viro
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Chris Mason
- Re: 2.4.0-test8-pre1 is quite bad / how ab... bert hubert
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Rik van Riel
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Alexander Viro
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Linus Torvalds
- Re: 2.4.0-test8-pre1 is quite bad / how ab... Rik van Riel