linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	akpm@linux-foundation.org, riel@surriel.com, vbabka@suse.cz,
	harry.yoo@oracle.com, jannh@google.com, baohua@kernel.org,
	linux-mm@kvack.org
Subject: Re: [RFC Patch 0/5] Make anon_vma operations testable
Date: Wed, 30 Apr 2025 23:36:55 +0200	[thread overview]
Message-ID: <77adaca4-fef3-4a5d-9dc7-a0e8d41eaf4c@redhat.com> (raw)
In-Reply-To: <20250430154406.aadkqzguil2zafq5@master>

On 30.04.25 17:44, Wei Yang wrote:
> On Wed, Apr 30, 2025 at 09:47:16AM +0200, David Hildenbrand wrote:
>> On 30.04.25 01:56, Wei Yang wrote:
>>> On Tue, Apr 29, 2025 at 10:41:27AM +0100, Lorenzo Stoakes wrote:
>>>> On Tue, Apr 29, 2025 at 11:38:23AM +0200, David Hildenbrand wrote:
>>>>> On 29.04.25 11:31, Lorenzo Stoakes wrote:
>>>>>> Wei,
>>>>>>
>>>>>> NACK the whole series.
>>>>>>
>>>>>> I'm really not sure how to get through to you. You were _explicitly_
>>>>>> advised not to send this series. And yet you've sent it anyway.
>>>>>>
>>>>>> I mean, I appreciate your enthusiasm and the fact you've made tests here
>>>>>> etc. obviously. And you've clearly put a TON of work in. But I just don't
>>>>>> know why you would when explicitly told not to without at least discussing
>>>>>> it first?
>>>>>>
>>>>>> This just isn't a great way of interacting with the community. We're all
>>>>>> human, please try to have some empathy for others here, as I really do try
>>>>>> to have with you as best I can.
>>>>>>
>>>>>> This adds a ton of churn and LOCKS IN assumptions about how anon_vma works,
>>>>>> clashes with other series (most notably series I've been working on), takes
>>>>>> away from efforts I want to make to start to join file-backed and anon
>>>>>> reverse mapping logic, separates the two in such a way as to encourage this
>>>>>> to nonly grow and generally isn't conducive to where I want to go with
>>>>>> rmap.
>>>>>
>>>>> anon_vma, the unloved child. :)
>>>>>
>>>>> I would love to see a simplification that makes it less special, and I can
>>>>> understand how adding tests for the ways it is special can be
>>>>> counter-productive.
>>>>>
>>>>>>
>>>>>> This is part of why I explicitly told you please don't go down this road,
>>>>>> because you're likely to end up doing work that doesn't get used. It's not
>>>>>> a great use of your time either.
>>>>>>
>>>>>> Since there's something useful here in tests, I may at a later date come
>>>>>> back to those.
>>>>>
>>>>> Agreed, skimming over the tests there are some nice diagrams and cases.
>>>>>
>>>>> But I would hope that for most of these cases we could test on a higher
>>>>> level: test our expectations when running real programs that we want to
>>>>> check, especially when performing internal changes on how we handle anon
>>>>> memory + rmap.
>>>>>
>>>>> E.g., do fork(), then test if we can successfully perform rmap
>>>>> lookups/updates (e.g., migrate folio to a different numa node etc).
>>>>>
>>>>
>>>> That's a great point! Wei - if you could look at making some self-tests
>>>> (i.e. that live in tools/testing/selftests/mm) that try to recreate _real_
>>>> scenarios that use the rmap like this and assert correct behaviour there,
>>>> that could be a positive way of moving forward with this.
>>>>
>>>
>>> I am trying to understand what scenarios you want.
>>
>> That is exactly the task to figure out: how can we actually test our rmap
>> implementation from a higher level. The example regarding fork and migration
>> is possibly a low-hanging fruit.
>>
>> We might already have the functionality to achieve it, *maybe* we'd even want
>> some extensions to make it all even easier to test.
>>
>> For example, MADV_PAGEOUT is refused on folios that are mapped into multiple
>> processes. Maybe we'd want the option to *still* page it out, just like
>> MPOL_MF_MOVE_ALL allows with CAP_SYS_NICE to *still* migrate a folio that is
>> mapped into multiple processes.
>>
>> Some rmap tests could make sense for both, anon and pagecache folios.
>>
>>>
>>> Something like below?
>>>
>>>     * fork and migrate a range in child
>>>     * fork/unmap in parent and migrate a range in child
>>>
>>> If the operation is successful, then we are good, right?
>>
>> Yes. And one can come up with a bunch of similar rmap test cases, like doing
>> a partial mremap() of a THP, then testing if the rmap walk still works as
>> expected, pairing the whole thing with for etc.
>>
>> One "problem" here is that even with MPOL_MF_MOVE_ALL,
>> move_pages() will not move a folio if it already resides on the target node.
>> So one always needs two NUMA nodes, which is a bit suboptimal for testing
>> purposes.
>>
>> For testing purposes, it could have been helpful a couple of times already to
>> just have a way of migrating a folio even if it already resides on the
>> expected node.
>>
> 
> Thanks for all those detail explanation. I need some time to digest it.
> 
> Since lack of some background knowledge, I may have further questions on this.
> Hope won't bother you too much.

Sure, feel free to reach out. Having more selftests that test rmap 
behavior could be really helpful.

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2025-04-30 21:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29  9:06 Wei Yang
2025-04-29  9:06 ` [RFC Patch 1/5] mm: move anon_vma manipulation functions to own file Wei Yang
2025-04-29  9:06 ` [RFC Patch 2/5] anon_vma: add skeleton code for userland testing of anon_vma logic Wei Yang
2025-05-01  1:31   ` Wei Yang
2025-05-01  9:41     ` Lorenzo Stoakes
2025-05-01 14:45       ` Wei Yang
2025-04-29  9:06 ` [RFC Patch 3/5] anon_vma: add test for mergeable anon_vma Wei Yang
2025-04-29  9:06 ` [RFC Patch 4/5] anon_vma: add test for reusable anon_vma Wei Yang
2025-04-29  9:06 ` [RFC Patch 5/5] anon_vma: add test to assert no double-reuse Wei Yang
2025-04-29  9:31 ` [RFC Patch 0/5] Make anon_vma operations testable Lorenzo Stoakes
2025-04-29  9:38   ` David Hildenbrand
2025-04-29  9:41     ` Lorenzo Stoakes
2025-04-29 23:56       ` Wei Yang
2025-04-30  7:47         ` David Hildenbrand
2025-04-30 15:44           ` Wei Yang
2025-04-30 21:36             ` David Hildenbrand [this message]
2025-05-14  1:23           ` Wei Yang
2025-05-27  6:34             ` Wei Yang
2025-05-27 11:31               ` David Hildenbrand
2025-05-28  1:17                 ` Wei Yang
2025-05-30  2:11                 ` Wei Yang
2025-05-30  8:00                   ` David Hildenbrand
2025-05-30 14:05                     ` Wei Yang
2025-05-30 14:39                       ` David Hildenbrand
2025-05-30 23:23                         ` Wei Yang
2025-06-03 21:31                           ` David Hildenbrand
2025-04-29 23:15   ` Wei Yang
2025-04-30 14:38     ` Lorenzo Stoakes
2025-04-30 15:41       ` Wei Yang

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=77adaca4-fef3-4a5d-9dc7-a0e8d41eaf4c@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=harry.yoo@oracle.com \
    --cc=jannh@google.com \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=richard.weiyang@gmail.com \
    --cc=riel@surriel.com \
    --cc=vbabka@suse.cz \
    /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