From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753564AbbF3BJm (ORCPT ); Mon, 29 Jun 2015 21:09:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48923 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796AbbF3BJf (ORCPT ); Mon, 29 Jun 2015 21:09:35 -0400 Date: Tue, 30 Jun 2015 03:08:11 +0200 From: Oleg Nesterov To: Peter Zijlstra Cc: paulmck@linux.vnet.ibm.com, tj@kernel.org, mingo@redhat.com, der.herr@hofr.at, dave@stgolabs.net, riel@redhat.com, viro@ZenIV.linux.org.uk, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/6] stop_machine: kill stop_cpus_mutex and stop_cpus_lock Message-ID: <20150630010811.GB22559@redhat.com> References: <20150626021455.GA5675@redhat.com> <20150626122330.GY19282@twins.programming.kicks-ass.net> <20150626204612.GA14573@redhat.com> <20150629040251.GA14558@redhat.com> <20150629085127.GF19282@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150629085127.GF19282@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/29, Peter Zijlstra wrote: > > On Mon, Jun 29, 2015 at 06:02:51AM +0200, Oleg Nesterov wrote: > > > If we change stop_two_cpus() to use stop_work_alloc_one() it can use > > cpu_online(), > > So the one user of this actually needs cpu_active(); we do not want to > go move tasks to an inactive cpu. > > So if you change this to cpu_online() we need to audit the user is doing > the stricter test. Hmm. But the user (migrate_swap_stop) should check cpu_active() anyway? The cpu_active() checks in stop_two_cpus() can only help to ensure that multi_cpu_stop() won't hang. CPU_DOWN_PREPARE can deactivate either CPU right after the check? Or stop_two_cpus() needs get_online_cpus(). Or I missed something. Oleg.