]> git.karo-electronics.de Git - linux-beck.git/commitdiff
s390/mm/pfault: Convert to hotplug state machine
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 6 Sep 2016 17:04:53 +0000 (19:04 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 19 Sep 2016 19:44:32 +0000 (21:44 +0200)
Install the callbacks via the state machine.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-s390@vger.kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: rt@linutronix.de
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Link: http://lkml.kernel.org/r/20160906170457.32393-18-bigeasy@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/s390/mm/fault.c
include/linux/cpuhotplug.h

index a58bca62a93b3467d55f7d7bb3d5e6beef5cd35f..cbb73fabc91e591a29b41c75d0f26d82a9ea950f 100644 (file)
@@ -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:
index 8f8a48bbe86dfea84315b07ee80d427e093a931d..dea6696c673a76356f5d13d8d57c5b082e710fd3 100644 (file)
@@ -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,