From: Wu Fengguang <fengguang.wu@intel.com>
To: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox <willy@linux.intel.com>, linux-mm <linux-mm@kvack.org>
Subject: Re: Setting of the PageReadahed bit
Date: Sun, 5 Jun 2011 15:54:03 +0800 [thread overview]
Message-ID: <20110605075403.GA18000@localhost> (raw)
In-Reply-To: <BANLkTimc7wTyn0sVn+4OCL45_MOqhyV=QhJqV-GgXt_p290KwA@mail.gmail.com>
On Sat, Jun 04, 2011 at 11:15:38AM +0800, Hugh Dickins wrote:
> On Fri, Jun 3, 2011 at 4:55 AM, Matthew Wilcox <willy@linux.intel.com> wrote:
> > The exact definition of PageReadahead doesn't seem to be documented
> > anywhere. A I'm assuming it means "This page was not directly requested;
> > it is being read for prefetching purposes", exactly like the READA
> > semantics.
> >
> > If my interpretation is correct, then the implementation in
> > __do_page_cache_readahead is wrong:
> >
> > A A A A A A A A if (page_idx == nr_to_read - lookahead_size)
> > A A A A A A A A A A A A SetPageReadahead(page);
> >
> > It'll only set the PageReadahead bit on one page. A The patch below fixes
> > this ... if my understanding is correct.
>
> Incorrect I believe: it's a trigger to say, when you get this far,
> it's time to think about kicking off the next read.
That's right. PG_readahead is set to trigger the _next_ ASYNC readahead.
> >
> > If my understanding is wrong, then how are readpage/readpages
> > implementations supposed to know that the VM is only prefetching these
> > pages, and they're not as important as metadata (dependent) reads?
>
> I don't think they do know at present; but I can well imagine there
> may be advantage in them knowing.
__do_page_cache_readahead() don't know whether the _current_ readahead
IO is an ASYNC one.
page_cache_async_readahead() calls ondemand_readahead() with
hit_readahead_marker=true. It's possible to further pass this
information into __do_page_cache_readahead() and ->readpage/readpages.
Thanks,
Fengguang
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2011-06-05 7:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-03 11:55 Setting of the PageReadahed bit Matthew Wilcox
2011-06-04 3:15 ` Hugh Dickins
2011-06-05 7:54 ` Wu Fengguang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110605075403.GA18000@localhost \
--to=fengguang.wu@intel.com \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=willy@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).