linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Peter Weber <peter.weber@flapflap.eu>
Cc: linux-mm@kvack.org
Subject: Re: Is anonymous memory part of the page cache on Linux?
Date: Fri, 12 Mar 2021 22:45:37 +0000	[thread overview]
Message-ID: <20210312224537.GF2577561@casper.infradead.org> (raw)
In-Reply-To: <b9daa298cfa0c256ce82d11cf376d267@flapflap.eu>

On Fri, Mar 12, 2021 at 04:41:55PM +0100, Peter Weber wrote:
> Thank you Matthew!
> 
> 
> Am 2021-03-12 16:15, schrieb Matthew Wilcox:
> > The wikipedia diagram is wrong.  Anonymous memory is not handled by the
> > page cache.
> 
> Is it roughly right to say, that the virtual memory uses page tables to
> handle anonymous memory?

I tend to deal with page cache and not anonymous memory, so I'm not sure
exactly how someone who's an expert would phrase it.  Anonymous pages are
"handled" in a number of different ways -- they can be found on LRU lists
and they can be found through the page tables.  It's all a bit ad-hoc as
far as I can tell ;-)

> > Anonymous pages enter the storage stack via swap; they are
> > found in the page tables, sent to the swap cache and then written to
> > swap devices or swap files.  Filesystems may get involved at that point,
> > but not always.
> 
> And the page cache doesn't handle anonymous memory - even when it is
> swapped?

Right.  There's a swap cache, but that's not the same thing as the page
cache.

> > There are other weird things in the wikipedia diagram, like Direct I/O
> > being seemingly detached from applications, and not appearing to pass
> > through the VFS.
> 
> I'm not an expert. Maybe I should add at least note about that on Wikipedia?

Maybe!


  reply	other threads:[~2021-03-12 23:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 14:43 Peter Weber
2021-03-12 15:15 ` Matthew Wilcox
2021-03-12 15:41   ` Peter Weber
2021-03-12 22:45     ` Matthew Wilcox [this message]
2021-03-17 13:42       ` David Hildenbrand
2021-03-14 23:06 Wxz76
2021-03-15  0:07 ` Matthew Wilcox

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=20210312224537.GF2577561@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=peter.weber@flapflap.eu \
    /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