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 15:15:40 +0000 [thread overview]
Message-ID: <20210312151540.GC2577561@casper.infradead.org> (raw)
In-Reply-To: <e17246e9216435e0e65b3d99cb190fab@flapflap.eu>
On Fri, Mar 12, 2021 at 03:43:33PM +0100, Peter Weber wrote:
> Hello!
> Hopefully I'm asking here in the right place and don't disturb.
>
> Is anonymous memory - i.e. program heap and stack - part of the page cache
> on Linux? The documentation[1] of the kernel does not state that. But the
> Wikipedia entry about page cache contains a graphic[2] (look at the top
> right) which gives me the impression that 'malloc()' allocates dynamic
> memory within the page cache.
The wikipedia diagram is wrong. Anonymous memory is not handled by the
page cache. 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.
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.
next prev parent reply other threads:[~2021-03-12 15:15 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 [this message]
2021-03-12 15:41 ` Peter Weber
2021-03-12 22:45 ` Matthew Wilcox
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=20210312151540.GC2577561@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