linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: NeilBrown <neilb@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Linux Memory Management List <linux-mm@kvack.org>,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH] MM: minor improvements to readahead documentation
Date: Mon, 4 Apr 2022 14:25:53 +0100	[thread overview]
Message-ID: <Ykrx4XjflUitCF0W@casper.infradead.org> (raw)
In-Reply-To: <164904545104.27040.12709890187296939611@noble.neil.brown.name>

On Mon, Apr 04, 2022 at 02:10:51PM +1000, NeilBrown wrote:
> >   * Readahead is triggered when an application read request (whether a
> > - * systemcall or a page fault) finds that the requested page is not in
> > + * system call or a page fault) finds that the requested folio is not in
> >   * the page cache, or that it is in the page cache and has the
> > - * %PG_readahead flag set.  This flag indicates that the page was loaded
> > - * as part of a previous read-ahead request and now that it has been
> > - * accessed, it is time for the next read-ahead.
> > + * readahead flag set.  This flag indicates that the folio was read
> 
> Ugh.  Why don't you like %PG_readahead?   I absolutely loath the
> practice of hiding flags inside accessor functions, and hiding the truth
> in documentation is just as bad.  It all makes grepping that much
> harder.
> I would MUCH prefer that the %PG_ were restored.  Please.

I absolutely loathe it that there are references to PG_* anywhere
outside page-flags.h.  We have the abstraction layer, we want people
to use it, and we shouldn't needlessly multiply entities by referring
to the implementation of the abstraction.  I remove references to PG_
flags wherever I find them.  I agree that grepping for page/folio flags
doesn't work, and it's something I spend a lot of time thinking about.
In particular, I want to produce decent kernel-doc for them.

> > - * In the last two cases, the page should be unlocked to indicate that
> > - * the read attempt has failed.  In the first case the page will be
> > - * unlocked by the caller.
> > + * In the last two cases, the folio should be unlocked by the filesystem
> > + * to indicate that the read attempt has failed.  In the first case the
> > + * folio will be unlocked by the VFS.
> 
> VFS??  The code is in mm/readahead.c, not in fs/*.c
> Why didn't you like "caller" ??

I view mm/readahead.c, mm/filemap.c and mm/page-writeback.c as part
of the VFS more than as part of the VM.  But that's something that
reasonable people can disagree on.  I think from the point of view of
the filesystem author, it's all VFS.


  reply	other threads:[~2022-04-04 13:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01  6:11 NeilBrown
2022-04-01 18:11 ` Matthew Wilcox
2022-04-04  4:10   ` NeilBrown
2022-04-04 13:25     ` Matthew Wilcox [this message]
2022-04-04 23:10       ` NeilBrown

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=Ykrx4XjflUitCF0W@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=neilb@suse.de \
    /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