From: Yafang Shao <laoar.shao@gmail.com>
To: David Hildenbrand <david@redhat.com>
Cc: akpm@linux-foundation.org, ziy@nvidia.com,
baolin.wang@linux.alibaba.com, lorenzo.stoakes@oracle.com,
Liam.Howlett@oracle.com, npache@redhat.com, ryan.roberts@arm.com,
dev.jain@arm.com, hannes@cmpxchg.org, usamaarif642@gmail.com,
gutierrez.asier@huawei-partners.com, willy@infradead.org,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
ameryhung@gmail.com, rientjes@google.com, corbet@lwn.net,
bpf@vger.kernel.org, linux-mm@kvack.org,
linux-doc@vger.kernel.org, "yu c chen" <yu.c.chen@intel.com>,
"Michal Koutný" <mkoutny@suse.com>,
libo.chen@oracle.com
Subject: Re: [PATCH v6 mm-new 00/10] mm, bpf: BPF based THP order selection
Date: Tue, 26 Aug 2025 20:03:13 +0800 [thread overview]
Message-ID: <CALOAHbDZCyUCMYkChVtWgYJci_rXVmMMpGtpeYQWeXW1egVNAg@mail.gmail.com> (raw)
In-Reply-To: <d8f723c4-4cb0-431d-9df2-ba4ec74c7b43@redhat.com>
On Tue, Aug 26, 2025 at 3:42 PM David Hildenbrand <david@redhat.com> wrote:
>
> On 26.08.25 09:19, Yafang Shao wrote:
> > Background
> > ==========
> >
> > Our production servers consistently configure THP to "never" due to
> > historical incidents caused by its behavior. Key issues include:
> > - Increased Memory Consumption
> > THP significantly raises overall memory usage, reducing available memory
> > for workloads.
> >
> > - Latency Spikes
> > Random latency spikes occur due to frequent memory compaction triggered
> > by THP.
> >
> > - Lack of Fine-Grained Control
> > THP tuning is globally configured, making it unsuitable for containerized
> > environments. When multiple workloads share a host, enabling THP without
> > per-workload control leads to unpredictable behavior.
> >
> > Due to these issues, administrators avoid switching to madvise or always
> > modes—unless per-workload THP control is implemented.
> >
> > To address this, we propose BPF-based THP policy for flexible adjustment.
> > Additionally, as David mentioned [0], this mechanism can also serve as a
> > policy prototyping tool (test policies via BPF before upstreaming them).
>
> There is a lot going on and most reviewers (including me) are fairly
> busy right now, so getting more detailed review could take a while.
>
> This topic sounds like a good candidate for the bi-weekly MM alignment
> session.
>
> Would you be interested in presenting the current bpf interface, how to
> use it, drawbacks, todos, ... in that forum?
Sure.
>
> David Rientjes, who organizes this meeting, is already on Cc.
DavidR had previously reached out to me about this patchset.
Hello DavidR,
Would September 17 from 9:00–10:00 AM PDT (UTC-7) work for discussing
this topic? If that time isn’t convenient, I’m happy to schedule a
later session—this will also give me some time to prepare a brief
slide.
On a related note, I’d like to take this opportunity to also share a
short proposal on BPF-based NUMA balancing.
On our AMD EPYC servers, many services experience significant
performance degradation due to cross-NUMA access. While NUMA balancing
can help mitigate this, its current global enable/disable
implementation often leads to overall system performance regression.
We are exploring the use of BPF to selectively enable NUMA balancing
only for NUMA-sensitive services, thereby minimizing unintended side
effects. A similar approach has been proposed in [0] using prctl() or
a cgroup interface. We believe this use case is particularly
well-suited for a BPF-based solution, and I’ll briefly outline why in
the slide. I’ve included the developers from [0] in CC for visibility,
in case they are interested in joining the discussion.
Looking forward to your thoughts.
[0]. https://lore.kernel.org/lkml/20250625102337.3128193-1-yu.c.chen@intel.com/
--
Regards
Yafang
next prev parent reply other threads:[~2025-08-26 12:03 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 7:19 [PATCH v6 mm-new 00/10] mm, bpf: BPF based THP order selection Yafang Shao
2025-08-26 7:19 ` [PATCH v6 mm-new 01/10] mm: thp: add support for " Yafang Shao
2025-08-27 2:57 ` kernel test robot
2025-08-27 11:39 ` Yafang Shao
2025-08-27 15:04 ` Lorenzo Stoakes
2025-08-27 15:03 ` Lorenzo Stoakes
2025-08-28 5:54 ` Yafang Shao
2025-08-28 10:50 ` Lorenzo Stoakes
2025-08-29 3:01 ` Yafang Shao
2025-08-29 10:42 ` Lorenzo Stoakes
2025-08-31 3:11 ` Yafang Shao
2025-09-01 11:39 ` Lorenzo Stoakes
2025-09-02 2:48 ` Yafang Shao
2025-09-02 7:50 ` Lorenzo Stoakes
2025-09-03 2:10 ` Yafang Shao
2025-08-29 4:56 ` Barry Song
2025-08-29 5:36 ` Yafang Shao
2025-08-26 7:19 ` [PATCH v6 mm-new 02/10] mm: thp: add a new kfunc bpf_mm_get_mem_cgroup() Yafang Shao
2025-08-27 15:34 ` Lorenzo Stoakes
2025-08-27 20:50 ` Shakeel Butt
2025-08-28 10:40 ` Lorenzo Stoakes
2025-08-28 16:00 ` Shakeel Butt
2025-08-29 10:45 ` Lorenzo Stoakes
2025-08-28 6:57 ` Yafang Shao
2025-08-28 10:42 ` Lorenzo Stoakes
2025-08-29 3:09 ` Yafang Shao
2025-08-27 20:45 ` Shakeel Butt
2025-08-28 6:58 ` Yafang Shao
2025-08-26 7:19 ` [PATCH v6 mm-new 03/10] mm: thp: add a new kfunc bpf_mm_get_task() Yafang Shao
2025-08-27 15:42 ` Lorenzo Stoakes
2025-08-27 21:50 ` Andrii Nakryiko
2025-08-28 6:50 ` Yafang Shao
2025-08-28 10:51 ` Lorenzo Stoakes
2025-08-29 3:15 ` Yafang Shao
2025-08-29 10:42 ` Lorenzo Stoakes
2025-08-28 6:47 ` Yafang Shao
2025-08-29 10:43 ` Lorenzo Stoakes
2025-08-26 7:19 ` [PATCH v6 mm-new 04/10] bpf: mark vma->vm_mm as trusted Yafang Shao
2025-08-27 15:45 ` Lorenzo Stoakes
2025-08-28 6:12 ` Yafang Shao
2025-08-28 11:11 ` Lorenzo Stoakes
2025-08-29 3:05 ` Yafang Shao
2025-08-29 10:49 ` Lorenzo Stoakes
2025-08-31 3:16 ` Yafang Shao
2025-09-01 10:36 ` Lorenzo Stoakes
2025-08-26 7:19 ` [PATCH v6 mm-new 05/10] selftests/bpf: add a simple BPF based THP policy Yafang Shao
2025-08-26 7:19 ` [PATCH v6 mm-new 06/10] selftests/bpf: add test case for khugepaged fork Yafang Shao
2025-08-26 7:19 ` [PATCH v6 mm-new 07/10] selftests/bpf: add test case to update thp policy Yafang Shao
2025-08-26 7:19 ` [PATCH v6 mm-new 08/10] selftests/bpf: add test cases for invalid thp_adjust usage Yafang Shao
2025-08-26 7:19 ` [PATCH v6 mm-new 09/10] Documentation: add BPF-based THP adjustment documentation Yafang Shao
2025-08-26 7:19 ` [PATCH v6 mm-new 10/10] MAINTAINERS: add entry for BPF-based THP adjustment Yafang Shao
2025-08-27 15:47 ` Lorenzo Stoakes
2025-08-28 6:08 ` Yafang Shao
2025-08-26 7:42 ` [PATCH v6 mm-new 00/10] mm, bpf: BPF based THP order selection David Hildenbrand
2025-08-26 8:33 ` Lorenzo Stoakes
2025-08-26 12:06 ` Yafang Shao
2025-08-26 9:52 ` Usama Arif
2025-08-26 12:10 ` Yafang Shao
2025-08-26 12:03 ` Yafang Shao [this message]
2025-08-27 13:14 ` Lorenzo Stoakes
2025-08-28 2:58 ` 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=CALOAHbDZCyUCMYkChVtWgYJci_rXVmMMpGtpeYQWeXW1egVNAg@mail.gmail.com \
--to=laoar.shao@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=bpf@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=daniel@iogearbox.net \
--cc=david@redhat.com \
--cc=dev.jain@arm.com \
--cc=gutierrez.asier@huawei-partners.com \
--cc=hannes@cmpxchg.org \
--cc=libo.chen@oracle.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mkoutny@suse.com \
--cc=npache@redhat.com \
--cc=rientjes@google.com \
--cc=ryan.roberts@arm.com \
--cc=usamaarif642@gmail.com \
--cc=willy@infradead.org \
--cc=yu.c.chen@intel.com \
--cc=ziy@nvidia.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).