From: Usama Arif <usamaarif642@gmail.com>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
David Hildenbrand <david@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>, Jann Horn <jannh@google.com>,
Arnd Bergmann <arnd@arndb.de>,
Christian Brauner <brauner@kernel.org>,
linux-mm@kvack.org, linux-arch@vger.kernel.org,
linux-kernel@vger.kernel.org, SeongJae Park <sj@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Shakeel Butt <shakeel.butt@linux.dev>, Zi Yan <ziy@nvidia.com>
Subject: Re: [RFC PATCH 0/5] add process_madvise() flags to modify behaviour
Date: Tue, 20 May 2025 19:24:04 +0100 [thread overview]
Message-ID: <ae53fa82-d8de-4c02-95f7-7650a03ea8e7@gmail.com> (raw)
In-Reply-To: <c54d2c5b-e061-4e77-ac10-3c29d5ccf419@lucifer.local>
On 20/05/2025 18:47, Lorenzo Stoakes wrote:
> On Tue, May 20, 2025 at 05:28:35PM +0200, David Hildenbrand wrote:
>> On 19.05.25 22:52, Lorenzo Stoakes wrote:
>>> REVIEWERS NOTES:
>>> ================
>>>
>>> This is a VERY EARLY version of the idea, it's relatively untested, and I'm
>>> 'putting it out there' for feedback. Any serious version of this will add a
>>> bunch of self-tests to assert correct behaviour and I will more carefully
>>> confirm everything's working.
>>>
>>> This is based on discussion arising from Usama's series [0], SJ's input on
>>> the thread around process_madvise() behaviour [1] (and a subsequent
>>> response by me [2]) and prior discussion about a new madvise() interface
>>> [3].
>>>
>>> [0]: https://lore.kernel.org/linux-mm/20250515133519.2779639-1-usamaarif642@gmail.com/
>>> [1]: https://lore.kernel.org/linux-mm/20250517162048.36347-1-sj@kernel.org/
>>> [2]: https://lore.kernel.org/linux-mm/e3ba284c-3cb1-42c1-a0ba-9c59374d0541@lucifer.local/
>>> [3]: https://lore.kernel.org/linux-mm/c390dd7e-0770-4d29-bb0e-f410ff6678e3@lucifer.local/
>>>
>>> ================
>>>
>>> Currently, we are rather restricted in how madvise() operations
>>> proceed. While effort has been put in to expanding what process_madvise()
>>> can do (that is - unrestricted application of advice to the local process
>>> alongside recent improvements on the efficiency of TLB operations over
>>> these batvches), we are still constrained by existing madvise() limitations
>>> and default behaviours.
>>>
>>> This series makes use of the currently unused flags field in
>>> process_madvise() to provide more flexiblity.
>>>
>>
>> In general, sounds like an interesting approach.
>
> Thanks!
>
> If you agree this is workable, then I'll go ahead and put some more effort
> into writing tests etc. on the next respin.
>
So the prctl and process_madvise patches both are trying to accomplish a
similar end goal.
Would it make sense to discuss what would be the best way forward before we
continue developing the solutions? If we are not at that stage and a clear
picture has not formed yet, happy to continue refining the solutions.
But just thought I would check.
I feel like changing process_madvise which was designed to work on an array
of iovec structures to have flags to skip errors and ignore the iovec
makes it function similar to a prctl call is not the right approach.
IMHO, prctl is a more direct solution to this.
I know that Lonenzo doesn't like prctl and wants to unify this in process_madvise.
But if in the end, we want to have a THP auto way which is truly transparent,
would it not be better to just have this as prctl and not change the madvise
structure? Maybe in a few years we wont need any of this, and it will be lost
in prctl and madvise wouldn't have changed for this?
Again, this is just to have a discussion (and not an aggressive argument :)),
and would love to get feedback from everyone in the community.
If its too early to have this discussion, its completely fine and we can
still keep developing the RFCs :)
Thanks!
Usama
next prev parent reply other threads:[~2025-05-20 18:24 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-19 20:52 [RFC PATCH 0/5] add process_madvise() flags to modify behaviour Lorenzo Stoakes
2025-05-19 20:52 ` [RFC PATCH 1/5] mm: madvise: refactor madvise_populate() Lorenzo Stoakes
2025-05-20 10:30 ` David Hildenbrand
2025-05-20 10:36 ` Lorenzo Stoakes
2025-05-20 10:42 ` David Hildenbrand
2025-05-22 12:32 ` Mike Rapoport
2025-05-19 20:52 ` [RFC PATCH 2/5] mm/madvise: add PMADV_SKIP_ERRORS process_madvise() flag Lorenzo Stoakes
2025-05-19 20:52 ` [RFC PATCH 3/5] mm/madvise: add PMADV_NO_ERROR_ON_UNMAPPED " Lorenzo Stoakes
2025-05-19 20:52 ` [RFC PATCH 4/5] mm/madvise: add PMADV_SET_FORK_EXEC_DEFAULT " Lorenzo Stoakes
2025-05-20 8:38 ` Pedro Falcato
2025-05-20 10:21 ` Lorenzo Stoakes
2025-05-20 11:41 ` Pedro Falcato
2025-05-20 13:39 ` Lorenzo Stoakes
2025-05-20 16:11 ` Jann Horn
2025-05-20 16:19 ` Lorenzo Stoakes
2025-05-20 16:35 ` David Hildenbrand
2025-05-20 22:26 ` Johannes Weiner
2025-05-29 14:46 ` Lorenzo Stoakes
2025-05-19 20:52 ` [RFC PATCH 5/5] mm/madvise: add PMADV_ENTIRE_ADDRESS_SPACE " Lorenzo Stoakes
2025-05-19 21:53 ` [RFC PATCH 0/5] add process_madvise() flags to modify behaviour Jann Horn
2025-05-20 5:35 ` Lorenzo Stoakes
2025-05-20 16:04 ` Jann Horn
2025-05-20 16:14 ` Lorenzo Stoakes
2025-05-20 15:28 ` David Hildenbrand
2025-05-20 17:47 ` Lorenzo Stoakes
2025-05-20 18:24 ` Usama Arif [this message]
2025-05-20 19:21 ` Lorenzo Stoakes
2025-05-20 19:42 ` Usama Arif
2025-05-20 20:15 ` Lorenzo Stoakes
2025-05-20 18:25 ` Lorenzo Stoakes
2025-05-20 18:39 ` David Hildenbrand
2025-05-20 18:25 ` Shakeel Butt
2025-05-20 18:45 ` Lorenzo Stoakes
2025-05-20 19:49 ` Shakeel Butt
2025-05-20 20:39 ` Lorenzo Stoakes
2025-05-20 22:02 ` Shakeel Butt
2025-05-21 4:21 ` Lorenzo Stoakes
2025-05-21 16:28 ` Shakeel Butt
2025-05-21 16:49 ` Lorenzo Stoakes
2025-05-21 17:39 ` Shakeel Butt
2025-05-22 13:05 ` David Hildenbrand
2025-05-22 13:21 ` Lorenzo Stoakes
2025-05-22 20:53 ` Shakeel Butt
2025-05-26 12:57 ` David Hildenbrand
2025-05-21 16:57 ` Usama Arif
2025-05-21 17:39 ` Lorenzo Stoakes
2025-05-21 18:25 ` Usama Arif
2025-05-21 18:40 ` Lorenzo Stoakes
2025-05-21 18:45 ` Usama Arif
2025-05-21 17:32 ` Johannes Weiner
2025-05-21 18:11 ` Lorenzo Stoakes
2025-05-22 12:45 ` David Hildenbrand
2025-05-22 13:49 ` Lorenzo Stoakes
2025-05-22 15:32 ` Mike Rapoport
2025-05-22 15:47 ` Lorenzo Stoakes
2025-05-21 2:16 ` Liam R. Howlett
2025-05-22 12:12 ` Mike Rapoport
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=ae53fa82-d8de-4c02-95f7-7650a03ea8e7@gmail.com \
--to=usamaarif642@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=brauner@kernel.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=jannh@google.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=shakeel.butt@linux.dev \
--cc=sj@kernel.org \
--cc=vbabka@suse.cz \
--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).