From: Daniel Xu <dxu@dxuuu.xyz>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: bpf@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@fb.com, jolsa@kernel.org, hannes@cmpxchg.org,
yhs@fb.com
Subject: Re: [RFC bpf-next 0/1] bpf: Add page cache iterator
Date: Thu, 8 Apr 2021 17:24:36 -0700 [thread overview]
Message-ID: <20210409002436.d4kpn6djrnecv2et@dlxu-fedora-R90QNFJV> (raw)
In-Reply-To: <20210408231332.GH22094@magnolia>
On Thu, Apr 08, 2021 at 04:13:32PM -0700, Darrick J. Wong wrote:
> On Wed, Apr 07, 2021 at 02:46:10PM -0700, Daniel Xu wrote:
> > There currently does not exist a way to answer the question: "What is in
> > the page cache?". There are various heuristics and counters but nothing
> > that can tell you anything like:
> >
> > * 3M from /home/dxu/foo.txt
> > * 5K from ...
>
> 5K? That's an extraordinary Weird Machine(tm).
Just typing random numbers :)
> > * etc.
> >
> > The answer to the question is particularly useful in the stacked
> > container world. Stacked containers implies multiple containers are run
> > on the same physical host. Memory is precious resource on some (if not
> > most) of these systems. On these systems, it's useful to know how much
> > duplicated data is in the page cache. Once you know the answer, you can
> > do something about it. One possible technique would be bind mount common
> > items from the root host into each container.
>
> Um, are you describing a system that uses BPF to deduplicating the page
> cache by using bind mounts? Can the containers scribble on these files
> and thereby mess up the other containers? What happens if the container
> wants to update itself and clobbers the root host's copy instead? How
> do you deal with a software update process failing because the root host
> fights back against the container trying to change its files?
No, the BPF progs are not intended to modify the pages. This is just for
read only observability.
> Also, I thought we weren't supposed to share resources across security
> boundaries anymore?
I can't speak to this, but bpf progs can pretty much be attached to
anywhere so this iterator doesn't expose anything new.
<...>
Thanks,
Daniel
prev parent reply other threads:[~2021-04-09 0:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-07 21:46 [RFC bpf-next 0/1] bpf: Add page cache iterator Daniel Xu
2021-04-07 21:46 ` [RFC bpf-next 1/1] bpf: Introduce iter_pagecache Daniel Xu
2021-04-08 6:14 ` Matthew Wilcox
2021-04-08 19:48 ` Daniel Xu
2021-04-08 21:29 ` Matthew Wilcox
2021-04-08 8:19 ` Christian Brauner
2021-04-08 20:44 ` Daniel Xu
2021-04-08 16:45 ` Al Viro
2021-04-08 20:49 ` Daniel Xu
2021-04-08 21:04 ` Al Viro
2021-04-08 22:11 ` Dave Chinner
2021-04-08 7:51 ` [RFC bpf-next 0/1] bpf: Add page cache iterator Christian Brauner
2021-04-08 16:08 ` Daniel Xu
2021-04-08 21:33 ` Shakeel Butt
2021-04-08 23:13 ` Darrick J. Wong
2021-04-09 0:24 ` Daniel Xu [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=20210409002436.d4kpn6djrnecv2et@dlxu-fedora-R90QNFJV \
--to=dxu@dxuuu.xyz \
--cc=bpf@vger.kernel.org \
--cc=djwong@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jolsa@kernel.org \
--cc=kernel-team@fb.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=yhs@fb.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).