linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: Yosry Ahmed <yosryahmed@google.com>, Namhyung Kim <namhyung@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	 Daniel Borkmann <daniel@iogearbox.net>,
	Johannes Weiner <hannes@cmpxchg.org>, Hao Luo <haoluo@google.com>,
	 Shakeel Butt <shakeelb@google.com>,
	Stanislav Fomichev <sdf@google.com>,
	 David Rientjes <rientjes@google.com>, bpf <bpf@vger.kernel.org>,
	KP Singh <kpsingh@kernel.org>,
	 cgroups@vger.kernel.org, Linux-MM <linux-mm@kvack.org>
Subject: Re: [RFC bpf-next] Hierarchical Cgroup Stats Collection Using BPF
Date: Fri, 18 Mar 2022 12:59:14 -0700	[thread overview]
Message-ID: <CAPhsuW6QTaCVekkT8Ah0N2K4JY7yiiO2wZjk6pVKuraEqjkoXQ@mail.gmail.com> (raw)
In-Reply-To: <CAJD7tkbQNpeX8MGw9dXa5gi6am=VNXwgwUoTd6+K=foixEm1fw@mail.gmail.com>

On Wed, Mar 9, 2022 at 12:27 PM Yosry Ahmed <yosryahmed@google.com> wrote:
>
> Hey everyone,
>
> I would like to discuss an idea to facilitate collection of
> hierarchical cgroup stats using BPF programs. We want to provide a
> simple interface for BPF programs to collect hierarchical cgroup stats
> and integrate with the existing rstat aggregation mechanism in the
> kernel. The most prominent use case is the ability to extend memcg
> stats (and histograms) by BPF programs.
>

+ Namhyung,

I forgot to mention this in the office hour. The aggregation efficiency
problem is actually similar to Namhyung's work to use BPF programs
to aggregate perf counters. Check:
     tools/perf/util/bpf_skel/bperf_cgroup.bpf.c

Namhyung's solution is to walk up the cgroup tree on cgroup switch
events. This may not be as efficient as rstat flush logic, but I think it
is good enough for many use cases (unless the cgroup tree is very
deep). It also demonstrates how we can implement some cgroup
logic in BPF.

I hope this helps.

Thanks,
Song

[...]


  parent reply	other threads:[~2022-03-18 19:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 20:27 Yosry Ahmed
2022-03-14  5:35 ` Tejun Heo
2022-03-16 16:35   ` Yosry Ahmed
2022-03-22 18:09     ` Yonghong Song
2022-03-22 21:37       ` Hao Luo
2022-03-22 22:06         ` Yonghong Song
2022-03-28  9:22       ` Yosry Ahmed
2022-03-16  6:04 ` Song Liu
2022-03-16 16:11   ` Yosry Ahmed
2022-03-16 16:13   ` Yosry Ahmed
2022-03-16 16:31   ` Tejun Heo
2022-03-18 19:59 ` Song Liu [this message]
2022-03-28  9:16   ` Yosry Ahmed

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=CAPhsuW6QTaCVekkT8Ah0N2K4JY7yiiO2wZjk6pVKuraEqjkoXQ@mail.gmail.com \
    --to=song@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hannes@cmpxchg.org \
    --cc=haoluo@google.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=namhyung@kernel.org \
    --cc=rientjes@google.com \
    --cc=sdf@google.com \
    --cc=shakeelb@google.com \
    --cc=yosryahmed@google.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