Hi, * On Fri, Sep 28, 2012 at 07:56:23PM +0800, Fengguang Wu <fengguang.wu@xxxxxxxxx> wrote:
On Wed, Sep 26, 2012 at 06:59:00AM +0530, Raghavendra D Prabhu wrote:Hi, * On Sat, Sep 22, 2012 at 08:49:20PM +0800, Fengguang Wu <fengguang.wu@xxxxxxxxx> wrote: >On Sat, Sep 22, 2012 at 04:03:11PM +0530, raghu.prabhu13@xxxxxxxxx wrote: >>From: Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx> >> >>If page lookup from radix_tree_lookup is successful and its index page_idx == >>nr_to_read - lookahead_size, then SetPageReadahead never gets called, so this >>fixes that. > >NAK. Sorry. It's actually an intentional behavior, so that for the >common cases of many cached files that are accessed frequently, no >PG_readahead will be set at all to pointlessly trap into the readahead >routines once and again. ACK, thanks for explaining that. However, regarding this, I would like to know if the implications of the patch 51daa88ebd8e0d437289f589af29d4b39379ea76 will still apply if PG_readahead is not set.Would you elaborate the implication and the possible problematic case?
Certainly.An implication of 51daa88ebd8e0d437289f589af29d4b39379ea76 is that, a redundant check for PageReadahead(page) is avoided since async is piggy-backed into the synchronous readahead itself.
So, in case of
page = find_get_page() if(!page) page_cache_sync_readahead() else if (PageReadahead(page)) page_cache_async_readahead();isnt' there a possibility that PG_readahead won't be set at all if page is not in cache (causing page_cache_sync_readahead) but page at index (nr_to_read - lookahead_size) is already in the cache? (due to if (page) continue; in the code)?
Hence, I changed the condition from equality to >= for setting SetPageReadahead(page) (and added a variable so that it is done only once).
Thanks, Fengguang
Regards, -- Raghavendra Prabhu GPG Id : 0xD72BE977 Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977 www: wnohang.net
Attachment:
pgpnrQqleYntY.pgp
Description: PGP signature