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]
Message-ID: <20210324103104.GN15768@suse.de>
Date:   Wed, 24 Mar 2021 10:31:04 +0000
From:   Mel Gorman <mgorman@...e.de>
To:     Huang Ying <ying.huang@...el.com>
Cc:     linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, Yu Zhao <yuzhao@...gle.com>,
        Hillf Danton <hdanton@...a.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Matthew Wilcox <willy@...radead.org>,
        Michal Hocko <mhocko@...e.com>, Roman Gushchin <guro@...com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Wei Yang <richard.weiyang@...ux.alibaba.com>,
        Yang Shi <shy828301@...il.com>
Subject: Re: [RFC] mm: activate access-more-than-once page via NUMA balancing

On Wed, Mar 24, 2021 at 04:32:09PM +0800, Huang Ying wrote:
> One idea behind the LRU page reclaiming algorithm is to put the
> access-once pages in the inactive list and access-more-than-once pages
> in the active list.  This is true for the file pages that are accessed
> via syscall (read()/write(), etc.), but not for the pages accessed via
> the page tables.  We can only activate them via page reclaim scanning
> now.  This may cause some problems.  For example, even if there are
> only hot file pages accessed via the page tables in the inactive list,
> we will enable the cache trim mode incorrectly to scan only the hot
> file pages instead of cold anon pages.
> 

I caution against this patch.

It's non-deterministic for a number of reasons. As it requires NUMA
balancing to be enabled, the pageout behaviour of a system changes when
NUMA balancing is active. If this led to pages being artificially and
inappropriately preserved, NUMA balancing could be disabled for the
wrong reasons.  It only applies to pages that have no target node so
memory policies affect which pages are activated differently. Similarly,
NUMA balancing does not scan all VMAs and some pages may never trap a
NUMA fault as a result. The timing of when an address space gets scanned
is driven by the locality of pages and so the timing of page activation
potentially becomes linked to whether pages are local or need to migrate
(although not right now for this patch as it only affects pages with a
target nid of NUMA_NO_NODE). In other words, changes in NUMA balancing
that affect migration potentially affect the aging rate.  Similarly,
the activate rate of a process with a single thread and multiple threads
potentially have different activation rates.

Finally, the NUMA balancing scan algorithm is sub-optimal. It potentially
scans the entire address space even though only a small number of pages
are scanned. This is particularly problematic when a process has a lot
of threads because threads are redundantly scanning the same regions. If
NUMA balancing ever introduced range tracking of faulted pages to limit
how much scanning it has to do, it would inadvertently cause a change in
page activation rate.

NUMA balancing is about page locality, it should not get conflated with
page aging.

-- 
Mel Gorman
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ