From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752483AbbFYTSS (ORCPT ); Thu, 25 Jun 2015 15:18:18 -0400 Received: from casper.infradead.org ([85.118.1.10]:46710 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728AbbFYTSJ (ORCPT ); Thu, 25 Jun 2015 15:18:09 -0400 Date: Thu, 25 Jun 2015 21:18:02 +0200 From: Peter Zijlstra To: Oleg Nesterov Cc: paulmck@linux.vnet.ibm.com, tj@kernel.org, mingo@redhat.com, linux-kernel@vger.kernel.org, der.herr@hofr.at, dave@stgolabs.net, riel@redhat.com, viro@ZenIV.linux.org.uk, torvalds@linux-foundation.org Subject: Re: [RFC][PATCH 12/13] stop_machine: Remove lglock Message-ID: <20150625191802.GX19282@twins.programming.kicks-ass.net> References: <20150622121623.291363374@infradead.org> <20150622122256.765619039@infradead.org> <20150622222152.GA4460@redhat.com> <20150623100932.GB3644@twins.programming.kicks-ass.net> <20150623162024.GA23714@redhat.com> <20150623172416.GA27505@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150623172416.GA27505@redhat.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 23, 2015 at 07:24:16PM +0200, Oleg Nesterov wrote: > IOW. Suppose we add ->work_mutex into struct cpu_stopper. Btw, > I think we should move all per-cpu variables there... > > Now, > > lock_stop_cpus_works(cpumask) > { > for_each_cpu(cpu, cpumask) > mutex_lock(per_cpu(cpu_stopper_task, cpu).work_mutex); > } > > unlock_stop_cpus_works(cpumask) > { > for_each_cpu(cpu, cpumask) > mutex_lock(...); > } > > which should be used instead of stop_cpus_mutex. After this change > stop_two_cpus() can just use stop_cpus(). Right, lockdep annotating that will be 'interesting' though. And stop_two_cpus() then has the problem of allocating a cpumask. Simpler to let it keep 'abuse' the queueing spinlock in there. > Off-topic. Can't we make __stop_machine() static? The only caller, > _cpu_down() can safely call stop_machine(), get_online_cpus() is > fine under cpu_hotplug_begin(). Can do I think.