From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752997AbdBIPst (ORCPT ); Thu, 9 Feb 2017 10:48:49 -0500 Received: from resqmta-ch2-11v.sys.comcast.net ([69.252.207.43]:49734 "EHLO resqmta-ch2-11v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751027AbdBIPsr (ORCPT ); Thu, 9 Feb 2017 10:48:47 -0500 Date: Thu, 9 Feb 2017 09:42:09 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: Thomas Gleixner 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> Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfAv4gQ/Wu6zEMrlek/FlrG3BtX8L9CPEDDiQXhM2gNLyQKMSzihXJWY8RRqcO6+OhQzuSWQeUjsZszi/YMsl/bBnQc1OVnTo/vOLH3FLZIIp/592fN2q P6K8FTubOE09NkOYFT6DLEZ2pJ2b5FVn7ldkSfeB9pqBBCLhOjvDoWAmDgCoJCHlNDIAaf65PT3wviefLgF4SlJmwNlz79VC23WGXfhOuUJBEHRuHNgVEgXN auM9spvZzn5dgmU2sVWJFa4XSo2tCMJxliFMYrfRzQznDNL2hyH7W0QA2930cQpI0nHoTSlRplFwReWa1XHHvck4gKooCgcqhMNmlVVS+J0oTciA3sT93Kxl MBeUSi2nJLy1L+J94Pa++8CUJ1fpE7xSD5bMuyOAxjjS7OvehLXAmGPb3AJIakh/CFTfcFLTEwlolsH1AfsTXemWviCvepxljBrw49N6IvNMZq94d0jOG+Cn pf44tbIVssMUhMfnNigDxtqxmlMdE4oT5WuZmg== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Lets get rid of get_online_cpus() etc.