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: <YUHZU4OHaJy3WtRk@dhcp22.suse.cz>
Date:   Wed, 15 Sep 2021 13:30:27 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     Feng Tang <feng.tang@...el.com>
Cc:     David Rientjes <rientjes@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Vlastimil Babka <vbabka@...e.cz>, linux-mm@...ck.org,
        cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] mm/page_alloc: detect allocation forbidden by cpuset
 and bail out early

On Wed 15-09-21 13:32:47, Feng Tang wrote:
> On Tue, Sep 14, 2021 at 05:30:03PM -0700, David Rientjes wrote:
[...]
> > I'm wondering about a single node nodemask, for example, where all 
> > ZONE_NORMAL memory is hot-removed.

While this is theoretically possible it is highly unlikely to happen.
Non movable memory just takes one kernel allocation to prevent any
hotremove operation to finish. I have to say I was not aware of the
hotplug callback. It all seems rather suspicious. I will have a look.

Anyway something worth having covered "just in case". Thanks for
pointing it out.
 
> Thanks for the reminding! Yes, memory hot remove can change the
> cpuset's effective nodemask, we may need to add similar check inside
> cpuset_hotplug_update_tasks() which is called by cpuset_hotplug_workfn(), 
> something like below?
> 
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index 7fa633e..d5f6776 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -3186,6 +3186,14 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp)
>  	cpus_updated = !cpumask_equal(&new_cpus, cs->effective_cpus);
>  	mems_updated = !nodes_equal(new_mems, cs->effective_mems);
>  
> +	if (mems_updated && !cpusets_insane_config() &&
> +		movable_only_nodes(new_mems)) {
> +		static_branch_enable(&cpusets_insane_config_key);
> +		pr_info("Unsupported (movable nodes only) cpuset configuration detected (nmask=%*pbl) after memory hotplug."
> +			"Cpuset allocations might fail even with a lot of memory available.\n",
> +			nodemask_pr_args(new_mems);
> +	}

Please create a helper rather than two copies of the same. Thanks!
> +
>  	if (is_in_v2_mode())
>  		hotplug_update_tasks(cs, &new_cpus, &new_mems,
>  				     cpus_updated, mems_updated);
> 
> Thanks,
> Feng

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ