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: <20210226123716.6bc2a463e0ee9d1770c7966b@linux-foundation.org>
Date:   Fri, 26 Feb 2021 12:37:16 -0800
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     Palmer Dabbelt <palmer@...belt.com>
Cc:     atishp@...shpatra.org, peterz@...radead.org,
        srikar@...ux.vnet.ibm.com, valentin.schneider@....com,
        vbabka@...e.cz, mpe@...erman.id.au,
        Palmer Dabbelt <palmerdabbelt@...gle.com>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        kernel-team@...roid.com,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCH 1/2] mm: Guard a use of node_reclaim_distance with
 CONFIFG_NUMA

On Fri, 26 Feb 2021 12:17:20 -0800 Palmer Dabbelt <palmer@...belt.com> wrote:

> From: Palmer Dabbelt <palmerdabbelt@...gle.com>
> 
> This is only useful under CONFIG_NUMA.  IIUC skipping the check is the
> right thing to do here, as without CONFIG_NUMA there will never be any
> large node distances on non-NUMA systems.
> 
> I expected this to manifest as a link failure under (!CONFIG_NUMA &&
> CONFIG_TRANSPARENT_HUGE_PAGES), but I'm not actually seeing that.  I
> think the reference is just getting pruned before it's checked, but I
> didn't get that from reading the code so I'm worried I'm missing
> something.
> 
> Either way, this is necessary to guard the definition of
> node_reclaim_distance with CONFIG_NUMA.
> 
> Signed-off-by: Palmer Dabbelt <palmerdabbelt@...gle.com>
> ---
>  mm/khugepaged.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index a7d6cb912b05..b1bf191c3a54 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -819,8 +819,10 @@ static bool khugepaged_scan_abort(int nid)
>  	for (i = 0; i < MAX_NUMNODES; i++) {
>  		if (!khugepaged_node_load[i])
>  			continue;
> +#ifdef CONFIG_NUMA
>  		if (node_distance(nid, i) > node_reclaim_distance)
>  			return true;
> +#endif
>  	}
>  	return false;
>  }

This makes the entire loop a no-op.  Perhaps Kirill can help take a
look at removing unnecessary code in khugepaged.c when CONFIG_NUMA=n?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ