[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250702173816.59935-1-sj@kernel.org>
Date: Wed, 2 Jul 2025 10:38:16 -0700
From: SeongJae Park <sj@...nel.org>
To: Usama Arif <usamaarif642@...il.com>
Cc: SeongJae Park <sj@...nel.org>,
David Hildenbrand <david@...hat.com>,
linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
Shakeel Butt <shakeel.butt@...ux.dev>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Jann Horn <jannh@...gle.com>,
Arnd Bergmann <arnd@...db.de>,
Christian Brauner <brauner@...nel.org>,
Mike Rapoport <rppt@...nel.org>,
Johannes Weiner <hannes@...xchg.org>,
Barry Song <21cnbao@...il.com>,
linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-api@...r.kernel.org,
Pedro Falcato <pfalcato@...e.de>,
Matthew Wilcox <willy@...radead.org>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Subject: Re: [DISCUSSION] proposed mctl() API
On Wed, 2 Jul 2025 15:15:01 +0100 Usama Arif <usamaarif642@...il.com> wrote:
[...]
> In terms of the approach of doing this, IMHO, I dont think the way to do this
> is controversial. After the great feedback from Lorenzo on the prctl series, the
> approach would be for userpsace to make a call that just does for_each_vma of the process,
> madvises the VMAs,
One dirty hack that I can think off the top of my head for doing this without
new kernel changes is, unsurprisingly, using DAMOS. Using DAMOS, users can do
madvise(MADV_HUGEPAGE) to virtual address ranges of specific access patterns.
It is aimed to be used for hot regions, while using similar one of
MADV_NOHUGEPAGE for cold regions. An experiment with a prototype[1] showed it
eliminates about 80% of internal fragmentation caused memory overhead while
keeping 46% of performance improvement under a constrained situation.
If you set the access pattern as any pattern, hence, you can do
madvise(MADV_HUGEPAGE) for effectively entire virtual address space of the
process. DAMON user-space tool supports periodically tracking childs and
applying same DAMOS scheme to those. So, for example, below hack could be
tried.
# damo start $(pidof XXX) --damos_action hugepage --include_child_tasks
I'm working with Usama at Meta but not very closely involved in THP works, so
I'm not sure if this works for Usama's case and others. I even not tried this
at all on any test environment. So I'm not recommending this but just sharing
a thought for more brainsorming, and that's why I call this a dirty hack.
[1] https://assets.amazon.science/b7/2b/ce53222247739b174f2b54498d1a/daos-data-access-aware-operating-system.pdf
Thanks,
SJ
[...]
Powered by blists - more mailing lists