From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753708AbbJTJeq (ORCPT ); Tue, 20 Oct 2015 05:34:46 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49780 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753631AbbJTJem (ORCPT ); Tue, 20 Oct 2015 05:34:42 -0400 Date: Tue, 20 Oct 2015 02:34:01 -0700 From: tip-bot for Oleg Nesterov Message-ID: Cc: oleg@redhat.com, tglx@linutronix.de, paulmck@linux.vnet.ibm.com, akpm@linux-foundation.org, mingo@kernel.org, torvalds@linux-foundation.org, tj@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, riel@redhat.com, efault@gmx.de, peterz@infradead.org Reply-To: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, tj@kernel.org, mingo@kernel.org, paulmck@linux.vnet.ibm.com, akpm@linux-foundation.org, oleg@redhat.com, tglx@linutronix.de, peterz@infradead.org, efault@gmx.de, riel@redhat.com, hpa@zytor.com In-Reply-To: <20151009160051.GA10169@redhat.com> References: <20151009160051.GA10169@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] stop_machine: Kill cpu_stop_threads->setup() and cpu_stop_unpark() Git-Commit-ID: f0cf16cbd0659d2dd21352da9f06f3fab7a51596 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f0cf16cbd0659d2dd21352da9f06f3fab7a51596 Gitweb: http://git.kernel.org/tip/f0cf16cbd0659d2dd21352da9f06f3fab7a51596 Author: Oleg Nesterov AuthorDate: Fri, 9 Oct 2015 18:00:51 +0200 Committer: Ingo Molnar CommitDate: Tue, 20 Oct 2015 10:23:56 +0200 stop_machine: Kill cpu_stop_threads->setup() and cpu_stop_unpark() Now that we always use stop_machine_unpark() to wake the stopper threas up, we can kill ->setup() and fold cpu_stop_unpark() into stop_machine_unpark(). And we do not need stopper->lock to set stopper->enabled = true. Signed-off-by: Oleg Nesterov Signed-off-by: Peter Zijlstra (Intel) Cc: Andrew Morton Cc: Linus Torvalds Cc: Mike Galbraith Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Rik van Riel Cc: Tejun Heo Cc: Thomas Gleixner Cc: heiko.carstens@de.ibm.com Link: http://lkml.kernel.org/r/20151009160051.GA10169@redhat.com Signed-off-by: Ingo Molnar --- kernel/stop_machine.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 59096a5..e5a09d2 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -504,20 +504,11 @@ static void cpu_stop_park(unsigned int cpu) WARN_ON(!list_empty(&stopper->works)); } -static void cpu_stop_unpark(unsigned int cpu) -{ - struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu); - - spin_lock_irq(&stopper->lock); - stopper->enabled = true; - spin_unlock_irq(&stopper->lock); -} - void stop_machine_unpark(int cpu) { struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu); - cpu_stop_unpark(cpu); + stopper->enabled = true; kthread_unpark(stopper->thread); } @@ -527,7 +518,6 @@ static struct smp_hotplug_thread cpu_stop_threads = { .thread_fn = cpu_stopper_thread, .thread_comm = "migration/%u", .create = cpu_stop_create, - .setup = cpu_stop_unpark, .park = cpu_stop_park, .selfparking = true, };