diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2016-09-06 13:04:53 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-19 15:44:32 -0400 |
commit | 84c9ceefecb8fe51c4bfa2a5424dd73bc024e41d (patch) | |
tree | 81fb7b9d601af08259ffbf44058cb4e4e659b4db /arch/s390/mm | |
parent | e476d3129100ba18daea2224f38fdd7195118d4b (diff) |
s390/mm/pfault: Convert to hotplug state machine
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>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r-- | arch/s390/mm/fault.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index a58bca62a93b..cbb73fabc91e 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c | |||
@@ -740,28 +740,21 @@ out: | |||
740 | put_task_struct(tsk); | 740 | put_task_struct(tsk); |
741 | } | 741 | } |
742 | 742 | ||
743 | static int pfault_cpu_notify(struct notifier_block *self, unsigned long action, | 743 | static int pfault_cpu_dead(unsigned int cpu) |
744 | void *hcpu) | ||
745 | { | 744 | { |
746 | struct thread_struct *thread, *next; | 745 | struct thread_struct *thread, *next; |
747 | struct task_struct *tsk; | 746 | struct task_struct *tsk; |
748 | 747 | ||
749 | switch (action & ~CPU_TASKS_FROZEN) { | 748 | spin_lock_irq(&pfault_lock); |
750 | case CPU_DEAD: | 749 | list_for_each_entry_safe(thread, next, &pfault_list, list) { |
751 | spin_lock_irq(&pfault_lock); | 750 | thread->pfault_wait = 0; |
752 | list_for_each_entry_safe(thread, next, &pfault_list, list) { | 751 | list_del(&thread->list); |
753 | thread->pfault_wait = 0; | 752 | tsk = container_of(thread, struct task_struct, thread); |
754 | list_del(&thread->list); | 753 | wake_up_process(tsk); |
755 | tsk = container_of(thread, struct task_struct, thread); | 754 | put_task_struct(tsk); |
756 | wake_up_process(tsk); | ||
757 | put_task_struct(tsk); | ||
758 | } | ||
759 | spin_unlock_irq(&pfault_lock); | ||
760 | break; | ||
761 | default: | ||
762 | break; | ||
763 | } | 755 | } |
764 | return NOTIFY_OK; | 756 | spin_unlock_irq(&pfault_lock); |
757 | return 0; | ||
765 | } | 758 | } |
766 | 759 | ||
767 | static int __init pfault_irq_init(void) | 760 | static int __init pfault_irq_init(void) |
@@ -775,7 +768,8 @@ static int __init pfault_irq_init(void) | |||
775 | if (rc) | 768 | if (rc) |
776 | goto out_pfault; | 769 | goto out_pfault; |
777 | irq_subclass_register(IRQ_SUBCLASS_SERVICE_SIGNAL); | 770 | irq_subclass_register(IRQ_SUBCLASS_SERVICE_SIGNAL); |
778 | hotcpu_notifier(pfault_cpu_notify, 0); | 771 | cpuhp_setup_state_nocalls(CPUHP_S390_PFAULT_DEAD, "s390/pfault:dead", |
772 | NULL, pfault_cpu_dead); | ||
779 | return 0; | 773 | return 0; |
780 | 774 | ||
781 | out_pfault: | 775 | out_pfault: |