From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932629AbcIST7k (ORCPT ); Mon, 19 Sep 2016 15:59:40 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37166 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932163AbcIST7i (ORCPT ); Mon, 19 Sep 2016 15:59:38 -0400 Date: Mon, 19 Sep 2016 12:59:04 -0700 From: tip-bot for Sebastian Andrzej Siewior Message-ID: Cc: bigeasy@linutronix.de, tglx@linutronix.de, hpa@zytor.com, heiko.carstens@de.ibm.com, peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, schwidefsky@de.ibm.com Reply-To: linux-kernel@vger.kernel.org, schwidefsky@de.ibm.com, hpa@zytor.com, tglx@linutronix.de, bigeasy@linutronix.de, mingo@kernel.org, peterz@infradead.org, heiko.carstens@de.ibm.com In-Reply-To: <20160906170457.32393-18-bigeasy@linutronix.de> References: <20160906170457.32393-18-bigeasy@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] s390/mm/pfault: Convert to hotplug state machine Git-Commit-ID: 84c9ceefecb8fe51c4bfa2a5424dd73bc024e41d 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: 84c9ceefecb8fe51c4bfa2a5424dd73bc024e41d Gitweb: http://git.kernel.org/tip/84c9ceefecb8fe51c4bfa2a5424dd73bc024e41d Author: Sebastian Andrzej Siewior AuthorDate: Tue, 6 Sep 2016 19:04:53 +0200 Committer: Thomas Gleixner CommitDate: Mon, 19 Sep 2016 21:44:32 +0200 s390/mm/pfault: Convert to hotplug state machine Install the callbacks via the state machine. Signed-off-by: Sebastian Andrzej Siewior Cc: linux-s390@vger.kernel.org Cc: Peter Zijlstra Cc: Heiko Carstens Cc: rt@linutronix.de Cc: Martin Schwidefsky Link: http://lkml.kernel.org/r/20160906170457.32393-18-bigeasy@linutronix.de Signed-off-by: Thomas Gleixner --- arch/s390/mm/fault.c | 30 ++++++++++++------------------ include/linux/cpuhotplug.h | 1 + 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index a58bca6..cbb73fa 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -740,28 +740,21 @@ out: put_task_struct(tsk); } -static int pfault_cpu_notify(struct notifier_block *self, unsigned long action, - void *hcpu) +static int pfault_cpu_dead(unsigned int cpu) { struct thread_struct *thread, *next; struct task_struct *tsk; - switch (action & ~CPU_TASKS_FROZEN) { - case CPU_DEAD: - spin_lock_irq(&pfault_lock); - list_for_each_entry_safe(thread, next, &pfault_list, list) { - thread->pfault_wait = 0; - list_del(&thread->list); - tsk = container_of(thread, struct task_struct, thread); - wake_up_process(tsk); - put_task_struct(tsk); - } - spin_unlock_irq(&pfault_lock); - break; - default: - break; + spin_lock_irq(&pfault_lock); + list_for_each_entry_safe(thread, next, &pfault_list, list) { + thread->pfault_wait = 0; + list_del(&thread->list); + tsk = container_of(thread, struct task_struct, thread); + wake_up_process(tsk); + put_task_struct(tsk); } - return NOTIFY_OK; + spin_unlock_irq(&pfault_lock); + return 0; } static int __init pfault_irq_init(void) @@ -775,7 +768,8 @@ static int __init pfault_irq_init(void) if (rc) goto out_pfault; irq_subclass_register(IRQ_SUBCLASS_SERVICE_SIGNAL); - hotcpu_notifier(pfault_cpu_notify, 0); + cpuhp_setup_state_nocalls(CPUHP_S390_PFAULT_DEAD, "s390/pfault:dead", + NULL, pfault_cpu_dead); return 0; out_pfault: diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 8f8a48b..dea6696 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -26,6 +26,7 @@ enum cpuhp_state { CPUHP_BLOCK_SOFTIRQ_DEAD, CPUHP_VIRT_SCSI_DEAD, CPUHP_ACPI_CPUDRV_DEAD, + CPUHP_S390_PFAULT_DEAD, CPUHP_WORKQUEUE_PREP, CPUHP_POWER_NUMA_PREPARE, CPUHP_HRTIMERS_PREPARE,