[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABWYdi1k1gNwkWT8TH7kPv=tA8qaZbjaaogYoMRnFPtBqvR_Uw@mail.gmail.com>
Date: Tue, 25 Jul 2023 16:58:47 -0700
From: Ivan Babrou <ivan@...udflare.com>
To: Michal Koutný <mkoutny@...e.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-fsdevel@...r.kernel.org, kernel-team@...udflare.com,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
Tejun Heo <tj@...nel.org>, Hugh Dickins <hughd@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Amir Goldstein <amir73il@...il.com>,
Christoph Hellwig <hch@....de>, Jan Kara <jack@...e.cz>,
Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>
Subject: Re: [PATCH] kernfs: attach uuid for every kernfs and report it in fsid
On Tue, Jul 25, 2023 at 7:07 AM Michal Koutný <mkoutny@...e.com> wrote:
>
> Hello.
>
> On Mon, Jul 10, 2023 at 02:21:10PM -0700, Ivan Babrou <ivan@...udflare.com> wrote:
> > I want to monitor cgroup changes, so that I can have an up to date map
> > of inode -> cgroup path, so that I can resolve the value returned from
> > bpf_get_current_cgroup_id() into something that a human can easily
> > grasp (think system.slice/nginx.service).
>
> Have you considered cgroup_path_from_kernfs_id()?
* It's not available from bpf from what I see (should I send a patch?)
* It turns short numeric keys into large string keys (you mention this below)
* It's a lot more work upfront for every event under a spinlock
> > Currently I do a full sweep to build a map, which doesn't work if a
> > cgroup is short lived, as it just disappears before I can resolve it.
> > Unfortunately, systemd recycles cgroups on restart, changing inode
> > number, so this is a very real issue.
>
> So, a historical map of cgroup id -> path is also useful for you, right?
> (IOW, cgroup_path_from_kernfs_id() is possible but it'd inflate log
> buffer size if full paths were stored instead of ids.)
For the most part the historical map would not be necessary if we had
cgroup paths (except for the points I mentioned above).
> (I think a similar map would be beneficial for SCM_CGROUP [1] idea too.)
Yes, it seems like it.
> > There's also this old wiki page from systemd:
> >
> > * https://freedesktop.org/wiki/Software/systemd/Optimizations
>
> The page also states:
>
> > Last edited Sat 18 May 2013 08:20:38 AM UTC
>
> Emptiness notifications via release_agent are so 2016 :-), unified
> hiearchy has more convenient API [2], this is FTR.
Sure, but these aren't arguments against having fanotify for cgroup filesystem.
Powered by blists - more mailing lists