aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-05-10 03:44:35 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-05-16 08:42:42 -0400
commit54c27791227756b37504bd35b9ad0a40d1ae4c4b (patch)
tree0bc3deade66273cac996297166c9c82a5a23b392 /arch/s390/mm
parentd5e50a51ccbda36b379aba9d1131a852eb908dda (diff)
s390/pfault: always search for task with reported pid
Make the code a bit more symmetric and always search for the task of the reported pid. This simplifies the code a bit. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/fault.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 67e2d4d14ae6..4306f5e75a33 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -549,19 +549,15 @@ static void pfault_interrupt(struct ext_code ext_code,
549 if ((subcode & 0xff00) != __SUBCODE_MASK) 549 if ((subcode & 0xff00) != __SUBCODE_MASK)
550 return; 550 return;
551 kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++; 551 kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++;
552 if (subcode & 0x0080) { 552 /* Get the token (= pid of the affected task). */
553 /* Get the token (= pid of the affected task). */ 553 pid = sizeof(void *) == 4 ? param32 : param64;
554 pid = sizeof(void *) == 4 ? param32 : param64; 554 rcu_read_lock();
555 rcu_read_lock(); 555 tsk = find_task_by_pid_ns(pid, &init_pid_ns);
556 tsk = find_task_by_pid_ns(pid, &init_pid_ns); 556 if (tsk)
557 if (tsk) 557 get_task_struct(tsk);
558 get_task_struct(tsk); 558 rcu_read_unlock();
559 rcu_read_unlock(); 559 if (!tsk)
560 if (!tsk) 560 return;
561 return;
562 } else {
563 tsk = current;
564 }
565 spin_lock(&pfault_lock); 561 spin_lock(&pfault_lock);
566 if (subcode & 0x0080) { 562 if (subcode & 0x0080) {
567 /* signal bit is set -> a page has been swapped in by VM */ 563 /* signal bit is set -> a page has been swapped in by VM */
@@ -586,7 +582,6 @@ static void pfault_interrupt(struct ext_code ext_code,
586 if (tsk->state == TASK_RUNNING) 582 if (tsk->state == TASK_RUNNING)
587 tsk->thread.pfault_wait = -1; 583 tsk->thread.pfault_wait = -1;
588 } 584 }
589 put_task_struct(tsk);
590 } else { 585 } else {
591 /* signal bit not set -> a real page is missing. */ 586 /* signal bit not set -> a real page is missing. */
592 if (tsk->thread.pfault_wait == 1) { 587 if (tsk->thread.pfault_wait == 1) {
@@ -612,6 +607,7 @@ static void pfault_interrupt(struct ext_code ext_code,
612 } 607 }
613 } 608 }
614 spin_unlock(&pfault_lock); 609 spin_unlock(&pfault_lock);
610 put_task_struct(tsk);
615} 611}
616 612
617static int __cpuinit pfault_cpu_notify(struct notifier_block *self, 613static int __cpuinit pfault_cpu_notify(struct notifier_block *self,