From: Ryan Roberts <ryan.roberts@arm.com>
To: "Yin, Fengwei" <fengwei.yin@intel.com>, Zi Yan <ziy@nvidia.com>,
Matthew Wilcox <willy@infradead.org>,
David Hildenbrand <david@redhat.com>, Yu Zhao <yuzhao@google.com>
Cc: Linux-MM <linux-mm@kvack.org>
Subject: Re: Prerequisites for Large Anon Folios
Date: Thu, 31 Aug 2023 08:16:11 +0100 [thread overview]
Message-ID: <5e2f7c0e-b834-49b8-93bd-0f521513bf56@arm.com> (raw)
In-Reply-To: <20bb4831-1fcc-4cdb-a590-c75b357759a4@intel.com>
On 31/08/2023 01:01, Yin, Fengwei wrote:
>
>
> On 8/30/2023 6:08 PM, Ryan Roberts wrote:
>> On 24/07/2023 10:33, Yin, Fengwei wrote:
>>>
>>>
>>> On 7/24/2023 5:04 PM, Ryan Roberts wrote:
>>>> On 23/07/2023 13:33, Yin, Fengwei wrote:
>>>>>
>>>>>
>>>>> On 7/20/2023 5:41 PM, Ryan Roberts wrote:
>>>>>> Hi All,
>>>>>>
>>>>>> As discussed at Matthew's call yesterday evening, I've put together a list of
>>>>>> items that need to be done as prerequisites for merging large anonymous folios
>>>>>> support.
>>>>>>
>>>>>> It would be great to get some review and confirmation as to whether anything is
>>>>>> missing or incorrect. Most items have an assignee - in that case it would be
>>>>>> good to check that my understanding that you are working on the item is correct.
>>>>>>
>>>>>> I think most things are independent, with the exception of "shared vs exclusive
>>>>>> mappings", which I think becomes a dependency for a couple of things (marked in
>>>>>> depender description); again would be good to confirm.
>>>>>>
>>>>>> Finally, although I'm concentrating on the prerequisites to clear the path for
>>>>>> merging an MVP Large Anon Folios implementation, I've included one "enhancement"
>>>>>> item ("large folios in swap cache"), solely because we explicitly discussed it
>>>>>> last night. My view is that enhancements can come after the initial large anon
>>>>>> folios merge. Over time, I plan to add other enhancements (e.g. retain large
>>>>>> folios over COW, etc).
>>>>>>
>>>>>> I'm posting the table as yaml as that seemed easiest for email. You can convert
>>>>>> to csv with something like this in Python:
>>>>>>
>>>>>> import yaml
>>>>>> import pandas as pd
>>>>>> pd.DataFrame(yaml.safe_load(open('work-items.yml'))).to_csv('work-items.csv')
>>>>>>
>>>>>> Thanks,
>>>>>> Ryan
>>>>> Should we add the mremap case to the list? Like how to handle the case that mremap
>>>>> happens in the middle of large anonymous folio and fails to split it.
>>>>
>>>> What's the issue that you see here? My opinion is that if we do nothing special
>>>> for mremap(), it neither breaks correctness nor performance when we enable large
>>>> anon folios. So on that basis, its not a prerequisite and I'd rather leave it
>>>> off the list. We might want to do something later as an enhancement though?
>>> The issue is related with anonymous folio->index.
>>>
>>> If mremap happens in the middle of the large folio, current code doesn't split it.
>>> So the large folio will be split to two parts: one is in original place and another
>>> is in the new place. These two parts which are in different VMA have same folio->index.
>>> Can rmap_walk_anon() work with this situation? vma_address() combined with head page.
>>> Can it work for the pages not in same vma as head page?
>>>
>>> I could miss something here. Will try to build test against it.
>>
>> Hi Fengwei,
>>
>> Did you ever reach a conclusion on this? Based on David's comment, I'm assuming
>> this is not a problem and already handled correctly for pte-mapped THP?
> Yes. It's not a real problem.
Great - thanks!
>
>>
>> I guess vma->vm_pgoff is fixed up in the new vma representing the remapped
>> portion to take account of the offset? (just a guess).
> Yes. vma->vm_pgoff keep unchanged for mremap target vma. So the rmap walk can
> walk the source vma and target vma.
>
>
> Regards
> Yin, Fengwei
>
>>
>> Thanks,
>> Ryan
>>
>>
>>>
>>>
>>> Regards
>>> Yin, Fengwei
>>>
>>>>
>>>> If we could always guarrantee that large anon folios were always naturally
>>>> aligned in VA space, then that would make many things simpler to implement. And
>>>> in that case, I can see the argument for doing something special in mremap().
>>>> But since splitting a folio may fail, I guess we have to live with non-naturally
>>>> aligned folios for the general case, and therefore the simplification argument
>>>> goes out of the window?
>>>>
>>>>
>>>>
>>
next prev parent reply other threads:[~2023-08-31 7:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 9:41 Prerequisites for Large Anon Folios Ryan Roberts
2023-07-23 12:33 ` Yin, Fengwei
2023-07-24 9:04 ` Ryan Roberts
2023-07-24 9:33 ` Yin, Fengwei
2023-07-24 9:46 ` Ryan Roberts
2023-07-24 9:54 ` Yin, Fengwei
2023-07-24 11:42 ` David Hildenbrand
2023-08-30 10:08 ` Ryan Roberts
2023-08-31 0:01 ` Yin, Fengwei
2023-08-31 7:16 ` Ryan Roberts [this message]
2023-08-30 10:44 ` Ryan Roberts
2023-08-30 16:20 ` David Hildenbrand
2023-08-31 7:26 ` Ryan Roberts
2023-08-31 7:59 ` David Hildenbrand
2023-08-31 9:04 ` Ryan Roberts
2023-09-01 14:44 ` David Hildenbrand
2023-09-04 10:06 ` Ryan Roberts
2023-09-05 20:54 ` David Rientjes
2023-08-31 0:08 ` Yin, Fengwei
2023-08-31 7:18 ` Ryan Roberts
2023-08-31 7:38 ` Yin, Fengwei
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=5e2f7c0e-b834-49b8-93bd-0f521513bf56@arm.com \
--to=ryan.roberts@arm.com \
--cc=david@redhat.com \
--cc=fengwei.yin@intel.com \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
--cc=yuzhao@google.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).