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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YfK0bnylHxiMzYj+@kernel.org>
Date:   Thu, 27 Jan 2022 17:04:14 +0200
From:   Mike Rapoport <rppt@...nel.org>
To:     Michal Hocko <mhocko@...e.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        LKML <linux-kernel@...r.kernel.org>,
        David Hildenbrand <david@...hat.com>,
        Alexey Makhalov <amakhalov@...are.com>,
        Dennis Zhou <dennis@...nel.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        Oscar Salvador <osalvador@...e.de>, Tejun Heo <tj@...nel.org>,
        Christoph Lameter <cl@...ux.com>,
        Nico Pache <npache@...hat.com>,
        Wei Yang <richard.weiyang@...il.com>,
        Rafael Aquini <raquini@...hat.com>
Subject: Re: [PATCH 2/6] mm: handle uninitialized numa nodes gracefully

On Thu, Jan 27, 2022 at 03:47:40PM +0100, Michal Hocko wrote:
> On Thu 27-01-22 15:37:23, Mike Rapoport wrote:
> > On Thu, Jan 27, 2022 at 09:53:01AM +0100, Michal Hocko wrote:
> [...]
> > > +		if (!node_online(nid)) {
> > > +			pr_warn("Node %d uninitialized by the platform. Please report with boot dmesg.\n", nid);
> > 
> > Do we assume that platform code must allocate node data for all nodes in
> > the system? Because if we don't this warning is misleading.
> 
> At least x86 does that (init_cpu_to_node). Now that you brought that up
> I guess you are right that this could be more misleading than helpful.

I'm not sure if other architectures allocate memoryless nodes, but for sure
only x86 initializes it with free_area_init_memoryless_node().

> What about
> 			pr_info("Initializing node %d as memoryless\n", nid);
> Is this better?

I think yes.

> > > +
> > > +			/* Allocator not initialized yet */
> > > +			pgdat = arch_alloc_nodedata(nid);
> > > +			if (!pgdat) {
> > > +				pr_err("Cannot allocate %zuB for node %d.\n",
> > > +						sizeof(*pgdat), nid);
> > > +				continue;
> > > +			}
> > > +			arch_refresh_nodedata(nid, pgdat);
> > > +			free_area_init_memoryless_node(nid);
> > > +			/*
> > > +			 * not marking this node online because we do not want to
> > > +			 * confuse userspace by sysfs files/directories for node
> > > +			 * without any memory attached to it (see topology_init)
> > > +			 * The pgdat will get fully initialized when a memory is
> > > +			 * hotpluged into it by hotadd_init_pgdat
> > > +			 */
> > > +			continue;
> > 
> > This can be made slightly more concise if we fall through after
> > arch_refresh_nodedata(), e.g. something like
> > 
> > 			...
> > 
> > 			arch_refresh_nodedata(nid, pgdat);
> > 		}
> > 
> > 		pgdat = NODE_DATA(nid);
> > 		free_area_init_node(nid);
> > 
> > 		/*
> > 		 * Do not mark memoryless node online because we do not want to
> > 		 * confuse userspace by sysfs files/directories for node
> > 		 * without any memory attached to it (see topology_init)
> > 		 * The pgdat will get fully initialized when a memory is
> > 		 * hotpluged into it by hotadd_init_pgdat
> > 		 */
> > 		if (!pgdat->node_present_pages)
> > 			continue;
> > 
> > but I don't feel strongly about it.
> 
> I do not have strong preference either way. Unless this is considered
> better by more people I would stick with what I have.
> -- 
> Michal Hocko
> SUSE Labs

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ