From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754108Ab3AaMQN (ORCPT ); Thu, 31 Jan 2013 07:16:13 -0500 Received: from www.linutronix.de ([62.245.132.108]:56092 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754044Ab3AaMLh (ORCPT ); Thu, 31 Jan 2013 07:11:37 -0500 Message-Id: <20130131120743.453821790@linutronix.de> User-Agent: quilt/0.48-1 Date: Thu, 31 Jan 2013 12:11:35 -0000 From: Thomas Gleixner To: LKML Cc: Ingo Molnar , Peter Zijlstra , Rusty Russell , Paul McKenney , "Srivatsa S. Bhat" , Arjan van de Veen , Paul Turner , Richard Weinberger , Magnus Damm Subject: [patch 29/40] s390: Convert vtime to hotplug state machine References: <20130131120348.372374706@linutronix.de> Content-Disposition: inline; filename=s390-vtime-convert.patch X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Thomas Gleixner --- arch/s390/kernel/vtime.c | 18 +++++------------- include/linux/cpuhotplug.h | 1 + 2 files changed, 6 insertions(+), 13 deletions(-) Index: linux-2.6/arch/s390/kernel/vtime.c =================================================================== --- linux-2.6.orig/arch/s390/kernel/vtime.c +++ linux-2.6/arch/s390/kernel/vtime.c @@ -382,25 +382,17 @@ void __cpuinit init_cpu_vtimer(void) set_vtimer(VTIMER_MAX_SLICE); } -static int __cpuinit s390_nohz_notify(struct notifier_block *self, - unsigned long action, void *hcpu) +static int __cpuinit s390_vtime_dying_cpu(unsigned int cpu) { - struct s390_idle_data *idle; - long cpu = (long) hcpu; + struct s390_idle_data *idle = &per_cpu(s390_idle, cpu); - idle = &per_cpu(s390_idle, cpu); - switch (action & ~CPU_TASKS_FROZEN) { - case CPU_DYING: - idle->nohz_delay = 0; - default: - break; - } - return NOTIFY_OK; + idle->nohz_delay = 0; + return 0; } void __init vtime_init(void) { /* Enable cpu timer interrupts on the boot cpu. */ init_cpu_vtimer(); - cpu_notifier(s390_nohz_notify, 0); + cpuhp_setup_state(CPUHP_AP_S390_VTIME_DYING, NULL, s390_vtime_dying_cpu); } Index: linux-2.6/include/linux/cpuhotplug.h =================================================================== --- linux-2.6.orig/include/linux/cpuhotplug.h +++ linux-2.6/include/linux/cpuhotplug.h @@ -27,6 +27,7 @@ enum cpuhp_states { CPUHP_AP_ARM64_TIMER_STARTING, CPUHP_AP_KVM_STARTING, CPUHP_AP_NOTIFY_DYING, + CPUHP_AP_S390_VTIME_DYING, CPUHP_AP_SCHED_MIGRATE_DYING, CPUHP_AP_MAX, CPUHP_TEARDOWN_CPU,