bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Usama Arif <usamaarif642@gmail.com>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Yafang Shao <laoar.shao@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	Nico Pache <npache@redhat.com>,
	akpm@linux-foundation.org, david@redhat.com, ziy@nvidia.com,
	baolin.wang@linux.alibaba.com, Liam.Howlett@oracle.com,
	ryan.roberts@arm.com, dev.jain@arm.com, hannes@cmpxchg.org,
	gutierrez.asier@huawei-partners.com, ast@kernel.org,
	daniel@iogearbox.net, andrii@kernel.org, bpf@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [RFC PATCH v2 0/5] mm, bpf: BPF based THP adjustment
Date: Tue, 20 May 2025 15:32:16 +0100	[thread overview]
Message-ID: <82f7bca5-384f-41e5-a0fc-0e1e8e260607@gmail.com> (raw)
In-Reply-To: <2345b8b9-b084-4661-8b55-61fd7fc7de57@lucifer.local>



On 20/05/2025 15:22, Lorenzo Stoakes wrote:
> On Tue, May 20, 2025 at 10:08:03PM +0800, Yafang Shao wrote:
>> On Tue, May 20, 2025 at 9:10 PM Matthew Wilcox <willy@infradead.org> wrote:
>>>
>>> On Tue, May 20, 2025 at 03:25:07PM +0800, Yafang Shao wrote:
>>>> The challenge we face is that our system administration team doesn't
>>>> permit enabling THP globally in production by setting it to "madvise"
>>>> or "always". As a result, we can only experiment with your feature on
>>>> our test servers at this stage.
>>>
>>> That's a you problem.
>>
>> perhaps.
>>
>>> You need to figure out how to influence your
>>> sysadmin team to change their mind; whether it's by talking to their
>>> superiors or persuading them directly.
>>
>> I believe that "practicing" matters more than "talking" or "persuading".
>> I’m surprised your suggestion relies on "talking" ;-)
>> If I understand correctly, we all agree that "talk is cheap", right?
>>
>>> It's not a justification for why
>>> upstream should take this patch.
>>
>> I believe Johannes has clearly explained the challenges the community
>> is currently facing [0].
>>
>> [0]. https://lore.kernel.org/linux-mm/20250430174521.GC2020@cmpxchg.org/
> 
> (Sorry to interject on your conversation, but :)
> 
> I don't think anybody denies we have issues in configuring this stuff
> sensibly. A global-only control isn't going to cut it in the real world it
> seems.
> 
> To me as you say yourself, definining the ABI/API here is what really matters,
> and we're right now inundated with several series all at once (you wait for one
> bus then 3 come at once... :).
> 
> So this I think, should be the question.
> 
> I like the idea of just exposing something like madvise(), which is something
> we're going to maintain indefinitely.
> 
> Though any such exposure would in my view would need to be opt-in i.e. have a
> list of MADV_... options that are accepted, as we'd need to very cautiously
> determine which are safe from this context.
> 
> Of course then this leads to the whole thing (and I really know very little
> about BPF internals - obviously happy to understand more) of whether we can just
> use the madvise() code direct or what locking we can do or how all that works.
> 
> At any rate, a custom thing that is specific as 'switch mode for mTHP pages of
> size X to Y' is just something I'd rather us not tie ourselves to.
> 
>>
>>
>> --
>> Regards
>>
>> Yafang
> 
> What do you think re: bpf vs. something like my proposed process_madvise()
> extensions or Usama's proposed prctl()?
> 
> Simpler, but really just using madvise functionality and having a means of
> defaulting across fork/exec (notwithstanding Jann's concerns in this area).

Unfortunately I think the issue is that neither prctl or process_madvise would work
for Yafangs usecase? Its usecase 3 mentioned in [1], i.e.
global system policy=never, process wants "madvise" policy for itself.
Will let Yafang confirm.

[1] https://lore.kernel.org/all/13b68fa0-8755-43d8-8504-d181c2d46134@gmail.com/

  reply	other threads:[~2025-05-20 14:32 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-20  6:04 [RFC PATCH v2 0/5] mm, bpf: BPF based THP adjustment Yafang Shao
2025-05-20  6:04 ` [RFC PATCH v2 1/5] mm: thp: Add a new mode "bpf" Yafang Shao
2025-05-20  6:05 ` [RFC PATCH v2 2/5] mm: thp: Add hook for BPF based THP adjustment Yafang Shao
2025-05-20  6:05 ` [RFC PATCH v2 3/5] mm: thp: add struct ops " Yafang Shao
2025-05-20  6:05 ` [RFC PATCH v2 4/5] bpf: Add get_current_comm to bpf_base_func_proto Yafang Shao
2025-05-20 23:32   ` Andrii Nakryiko
2025-05-20  6:05 ` [RFC PATCH v2 5/5] selftests/bpf: Add selftest for THP adjustment Yafang Shao
2025-05-20  6:52 ` [RFC PATCH v2 0/5] mm, bpf: BPF based " Nico Pache
2025-05-20  7:25   ` Yafang Shao
2025-05-20 13:10     ` Matthew Wilcox
2025-05-20 14:08       ` Yafang Shao
2025-05-20 14:22         ` Lorenzo Stoakes
2025-05-20 14:32           ` Usama Arif [this message]
2025-05-20 14:35             ` Lorenzo Stoakes
2025-05-20 14:42               ` Matthew Wilcox
2025-05-20 14:56                 ` David Hildenbrand
2025-05-21  4:28                 ` Yafang Shao
2025-05-20 14:46               ` Usama Arif
2025-05-20 15:00             ` David Hildenbrand
2025-05-20  9:43 ` David Hildenbrand
2025-05-20  9:49   ` Lorenzo Stoakes
2025-05-20 12:06     ` Yafang Shao
2025-05-20 13:45       ` Lorenzo Stoakes
2025-05-20 15:54         ` David Hildenbrand
2025-05-21  4:02           ` Yafang Shao
2025-05-21  3:52         ` Yafang Shao
2025-05-20 11:59   ` Yafang Shao
2025-05-25  3:01 ` Yafang Shao
2025-05-26  7:41   ` Gutierrez Asier
2025-05-26  9:37     ` Yafang Shao
2025-05-26  8:14   ` David Hildenbrand
2025-05-26  9:37     ` Yafang Shao
2025-05-26 10:49       ` David Hildenbrand
2025-05-26 14:53         ` Liam R. Howlett
2025-05-26 15:54           ` Liam R. Howlett
2025-05-26 16:51             ` David Hildenbrand
2025-05-26 17:07               ` Liam R. Howlett
2025-05-26 17:12                 ` David Hildenbrand
2025-05-26 20:30               ` Gutierrez Asier
2025-05-26 20:37                 ` David Hildenbrand
2025-05-27  5:46         ` Yafang Shao
2025-05-27  7:57           ` David Hildenbrand
2025-05-27  8:13             ` Yafang Shao
2025-05-27  8:30               ` David Hildenbrand
2025-05-27  8:40                 ` Yafang Shao
2025-05-27  9:27                   ` David Hildenbrand
2025-05-27  9:43                     ` Yafang Shao
2025-05-27 12:19                       ` David Hildenbrand
2025-05-28  2:04                         ` Yafang Shao
2025-05-28 20:32                           ` David Hildenbrand
2025-05-26 14:32   ` Zi Yan
2025-05-27  5:53     ` 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=82f7bca5-384f-41e5-a0fc-0e1e8e260607@gmail.com \
    --to=usamaarif642@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=david@redhat.com \
    --cc=dev.jain@arm.com \
    --cc=gutierrez.asier@huawei-partners.com \
    --cc=hannes@cmpxchg.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=npache@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=willy@infradead.org \
    --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).