lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Nov 2023 17:15:15 -0500
From:   John Hubbard <jhubbard@...dia.com>
To:     Baolin Wang <baolin.wang@...ux.alibaba.com>,
        Kefeng Wang <wangkefeng.wang@...wei.com>,
        David Hildenbrand <david@...hat.com>, akpm@...ux-foundation.org
Cc:     ying.huang@...el.com, willy@...radead.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] mm: support large folio numa balancing

On 11/13/23 5:01 AM, Baolin Wang wrote:
> 
> 
> On 11/13/2023 8:10 PM, Kefeng Wang wrote:
>>
>>
>> On 2023/11/13 18:53, David Hildenbrand wrote:
>>> On 13.11.23 11:45, Baolin Wang wrote:
>>>> Currently, the file pages already support large folio, and 
>>>> supporting for
>>>> anonymous pages is also under discussion[1]. Moreover, the numa 
>>>> balancing
>>>> code are converted to use a folio by previous thread[2], and the 
>>>> migrate_pages
>>>> function also already supports the large folio migration.
>>>>
>>>> So now I did not see any reason to continue restricting NUMA 
>>>> balancing for
>>>> large folio.
>>>
>>> I recall John wanted to look into that. CCing him.
>>>
>>> I'll note that the "head page mapcount" heuristic to detect sharers will
>>> now strike on the PTE path and make us believe that a large folios is
>>> exclusive, although it isn't.
>>>
>>> As spelled out in the commit you are referencing:
>>>
>>> commit 6695cf68b15c215d33b8add64c33e01e3cbe236c
>>> Author: Kefeng Wang <wangkefeng.wang@...wei.com>
>>> Date:   Thu Sep 21 15:44:14 2023 +0800
>>>
>>>      mm: memory: use a folio in do_numa_page()
>>>      Numa balancing only try to migrate non-compound page in 
>>> do_numa_page(),
>>>      use a folio in it to save several compound_head calls, note we use
>>>      folio_estimated_sharers(), it is enough to check the folio 
>>> sharers since
>>>      only normal page is handled, if large folio numa balancing is 
>>> supported, a
>>>      precise folio sharers check would be used, no functional change 
>>> intended.
>>>
>>>
>>> I'll send WIP patches for one approach that can improve the situation 
>>> soonish.

To be honest, I'm still catching up on the approximate vs. exact
sharers case. It wasn't clear to me why a precise sharers count
is needed in order to do this. Perhaps the cost of making a wrong
decision is considered just too high?


>>
>> When convert numa balance to use folio, I make similar change, it works
>> with large anon folio(test with v5), but David's precise folio sharers
>> should be merged firstly, also if a large folio shared by many process,
>> we maybe split it, don't sure about it, this need some evaluation.
> 
> IIUC, numa balancing will not split the large folio.

That matches my reading of the code: normal (PMD-based) THPs are
split, but the code does not yet split PTE-THPs (also known as
small-size THPs).

thanks,

-- 
John Hubbard
NVIDIA

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ