From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753850AbbHCPA6 (ORCPT ); Mon, 3 Aug 2015 11:00:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39617 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753585AbbHCPAa (ORCPT ); Mon, 3 Aug 2015 11:00:30 -0400 Date: Mon, 3 Aug 2015 16:58:27 +0200 From: Oleg Nesterov To: Peter Zijlstra Cc: Ingo Molnar , Rik van Riel , Tejun Heo , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 6/6] stop_machine: kill stop_cpus_lock and lg_double_lock/unlock() Message-ID: <20150803145827.GA13192@redhat.com> References: <20150721192219.GA31150@redhat.com> <20150721192247.GA31191@redhat.com> <20150730215527.GQ25159@twins.programming.kicks-ass.net> <20150731111246.GS18673@twins.programming.kicks-ass.net> <20150731141753.GT18673@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150731141753.GT18673@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 07/31, Peter Zijlstra wrote: > > + for_each_cpu(cpu, cpumask) > + arch_spin_lock((arch_spinlock_t *)&per_cpu(cpu_stopper.lock, cpu)); > + > for_each_cpu(cpu, cpumask) { > work = &per_cpu(cpu_stopper.stop_work, cpu); > work->fn = fn; > work->arg = arg; > work->done = done; > - cpu_stop_queue_work(cpu, work); > + __cpu_stop_queue_work(cpu, work); > } > - lg_global_unlock(&stop_cpus_lock); > + > + for_each_cpu(cpu, cpumask) > + arch_spin_unlock((arch_spinlock_t *)&per_cpu(cpu_stopper.lock, cpu)); Of course, we discussed this before and I think this should work too. However to me this looks more ugly (although better than the current code), and this is what I tried to avoid. But! of course "more ugly" is very much subjective, so I won't really argue if you prefer this change. That said, let me write another email in reply to your initial review. Oleg.