linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Phillip Susi <psusi@ubuntu.com>
Cc: linux-mm@kvack.org
Subject: Re: readahead man page incorrectly says it blocks
Date: Wed, 2 Oct 2013 18:53:10 -0400	[thread overview]
Message-ID: <20131002225310.GA12225@thunk.org> (raw)
In-Reply-To: <524C54B8.2060107@ubuntu.com>

On Wed, Oct 02, 2013 at 01:15:36PM -0400, Phillip Susi wrote:
> 
> The man page for readahead(2) incorrectly claims that it blocks until
> all of the requested data has been read.  I filed a bug a few months
> ago to have this corrected, but I think it is being ignored now
> because they don't believe me that it isn't supposed to block.  Could
> someone help back me up and get this fixed?
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=54271

We do need to make sure that users of readahead(2) understand that:

(a) readahead(2) *can* block (either to read metadata blocks, or
    perhaps due to a memory allocation from a kmalloc or get_free_page
    requiring pages to be cleaned and evicted)

(b) readhead(2) does *not* guaranteee that once it returns, that a
    subsequent read or access to a mmap'ed page will not block.  That
    is, readhead(2) does not block until the page becomes available in
    the page cache.

BTW, Caveat (a) is also basically how AIO works --- io_submit(2) can
block, which means that if thread was using AIO because it didn't want
to lose control of the CPU, it can get quite disappointed.  (With ext4
we have a way to preread and the file metadata and try very hard to
keep it from getting ejected from memory to minimize this from
happening, precisely because I had some users for which having
io_submit(2) block was highly undesirable.)

So you're right, but we do need to make sure that the resulting change
doesn't cause the reader of the man page causes them to think that
readhead(2) is guaranteeed not to block.

Cheers,

						- Ted




--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2013-10-02 22:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02 17:15 readahead man page incorrectly says it blocks Phillip Susi
2013-10-02 22:53 ` Theodore Ts'o [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-01-02 20:46 Phillip Susi
2013-05-17 14:54 Phillip Susi

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=20131002225310.GA12225@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-mm@kvack.org \
    --cc=psusi@ubuntu.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).