linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Michal Koutný" <mkoutny@suse.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: roman.gushchin@linux.dev, inwardvessel@gmail.com,
	 shakeel.butt@linux.dev, akpm@linux-foundation.org,
	ast@kernel.org, daniel@iogearbox.net,  andrii@kernel.org,
	yu.c.chen@intel.com, zhao1.liu@intel.com, bpf@vger.kernel.org,
	 linux-mm@kvack.org
Subject: Re: [RFC PATCH bpf-next 2/3] mm: add support for bpf based numa balancing
Date: Wed, 14 Jan 2026 10:56:19 +0100	[thread overview]
Message-ID: <cfyq2n7igavmwwf5jv5uamiyhprgsf4ez7au6ssv3rw54vjh4w@nc43vkqhz5yq> (raw)
In-Reply-To: <20260113121238.11300-3-laoar.shao@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]

On Tue, Jan 13, 2026 at 08:12:37PM +0800, Yafang Shao <laoar.shao@gmail.com> wrote:
> bpf_numab_ops enables NUMA balancing for tasks within a specific memcg,
> even when global NUMA balancing is disabled. This allows selective NUMA
> optimization for workloads that benefit from it, while avoiding potential
> latency spikes for other workloads.
> 
> The policy must be attached to a leaf memory cgroup.

Why this restriction?
Do you envision how these extensions would apply hierarchically?
Regardless of that, being a "leaf memcg" is not a stationary condition
(mkdirs, writes to `cgroup.subtree_control`) so it should also be
prepared for that.

Also, I think (please correct me) that NUMA balancing doesn't need
memory controller (in contrast with OOM), so the attachment shouldn't be
through struct mem_cgroup but plain struct cgroup::bpf. If you could
consider this or add some details about this decision, it'd be great.


Thanks,
Michal

> To reduce lookup
> overhead, we can cache memcg::bpf_numab in the mm_struct of tasks within
> the memcg when it becomes a performance bottleneck.
> 
> The cgroup ID is embedded in bpf_numab_ops as a compile-time constant,
> which restricts each instance to a single cgroup and prevents attachment
> to multiple cgroups. Roman is working on a solution to remove this
> limitation, after which we can migrate to the new approach.
> 
> Currently only the normal mode is supported.
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]

  parent reply	other threads:[~2026-01-14  9:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13 12:12 [RFC PATCH bpf-next 0/3] BPF-based NUMA balancing Yafang Shao
2026-01-13 12:12 ` [RFC PATCH bpf-next 1/3] sched: add helpers for numa balancing Yafang Shao
2026-01-13 12:42   ` bot+bpf-ci
2026-01-13 12:48     ` Yafang Shao
2026-01-13 12:12 ` [RFC PATCH bpf-next 2/3] mm: add support for bpf based " Yafang Shao
2026-01-13 12:29   ` bot+bpf-ci
2026-01-13 12:46     ` Yafang Shao
2026-01-14  9:56   ` Michal Koutný [this message]
2026-01-14 12:13     ` Yafang Shao
2026-01-13 12:12 ` [RFC PATCH bpf-next 3/3] mm: set numa balancing hot threshold with bpf Yafang Shao

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=cfyq2n7igavmwwf5jv5uamiyhprgsf4ez7au6ssv3rw54vjh4w@nc43vkqhz5yq \
    --to=mkoutny@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=inwardvessel@gmail.com \
    --cc=laoar.shao@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=yu.c.chen@intel.com \
    --cc=zhao1.liu@intel.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