From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753022AbdBIQOP (ORCPT ); Thu, 9 Feb 2017 11:14:15 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:56958 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751577AbdBIQOK (ORCPT ); Thu, 9 Feb 2017 11:14:10 -0500 Date: Thu, 9 Feb 2017 17:12:46 +0100 (CET) From: Thomas Gleixner To: Christoph Lameter cc: Michal Hocko , Mel Gorman , Vlastimil Babka , Dmitry Vyukov , Tejun Heo , "linux-mm@kvack.org" , LKML , Ingo Molnar , Peter Zijlstra , syzkaller , Andrew Morton Subject: Re: mm: deadlock between get_online_cpus/pcpu_alloc In-Reply-To: Message-ID: References: <20170207123708.GO5065@dhcp22.suse.cz> <20170207135846.usfrn7e4znjhmogn@techsingularity.net> <20170207141911.GR5065@dhcp22.suse.cz> <20170207153459.GV5065@dhcp22.suse.cz> <20170207162224.elnrlgibjegswsgn@techsingularity.net> <20170207164130.GY5065@dhcp22.suse.cz> <20170208073527.GA5686@dhcp22.suse.cz> <20170208152106.GP5686@dhcp22.suse.cz> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 9 Feb 2017, Christoph Lameter wrote: > On Thu, 9 Feb 2017, Thomas Gleixner wrote: > > > > The stop_machine would need to ensure that all cpus cease processing > > > before proceeding. > > > > Ok. I try again: > > > > CPU 0 CPU 1 > > for_each_online_cpu(cpu) > > ==> cpu = 1 > > stop_machine() > > > > Stops processing on all CPUs by preempting the current execution and > > forcing them into a high priority busy loop with interrupts disabled. > > Exactly that means we are outside of the sections marked with > get_online_cpous(). > > > It does exactly what you describe. It stops processing on all other cpus > > until release, but that does not invalidate any data on those cpus. > > Why would it need to invalidate any data? The change of the cpu masks > would need to be done when the machine is stopped. This sounds exactly > like what we need and much of it is already there. You are just not getting it, really. The problem is that this for_each_online_cpu() is racy against a concurrent hot unplug and therefor can queue stuff for a not longer online cpu. That's what the mm folks tried to avoid by preventing a CPU hotplug operation before entering that loop. > Lets get rid of get_online_cpus() etc. And that solves what? Can you please start to understand the scope of the whole hotplug machinery including the requirements for get_online_cpus() before you waste everybodys time with your uninformed and halfbaken proposals? Thanks, tglx