提交 54c27791 编写于 作者: H Heiko Carstens 提交者: Martin Schwidefsky

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: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 d5e50a51
...@@ -549,7 +549,6 @@ static void pfault_interrupt(struct ext_code ext_code, ...@@ -549,7 +549,6 @@ static void pfault_interrupt(struct ext_code ext_code,
if ((subcode & 0xff00) != __SUBCODE_MASK) if ((subcode & 0xff00) != __SUBCODE_MASK)
return; return;
kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++; kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++;
if (subcode & 0x0080) {
/* Get the token (= pid of the affected task). */ /* Get the token (= pid of the affected task). */
pid = sizeof(void *) == 4 ? param32 : param64; pid = sizeof(void *) == 4 ? param32 : param64;
rcu_read_lock(); rcu_read_lock();
...@@ -559,9 +558,6 @@ static void pfault_interrupt(struct ext_code ext_code, ...@@ -559,9 +558,6 @@ static void pfault_interrupt(struct ext_code ext_code,
rcu_read_unlock(); rcu_read_unlock();
if (!tsk) if (!tsk)
return; return;
} else {
tsk = current;
}
spin_lock(&pfault_lock); spin_lock(&pfault_lock);
if (subcode & 0x0080) { if (subcode & 0x0080) {
/* signal bit is set -> a page has been swapped in by VM */ /* 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,7 +582,6 @@ static void pfault_interrupt(struct ext_code ext_code,
if (tsk->state == TASK_RUNNING) if (tsk->state == TASK_RUNNING)
tsk->thread.pfault_wait = -1; tsk->thread.pfault_wait = -1;
} }
put_task_struct(tsk);
} else { } else {
/* signal bit not set -> a real page is missing. */ /* signal bit not set -> a real page is missing. */
if (tsk->thread.pfault_wait == 1) { if (tsk->thread.pfault_wait == 1) {
...@@ -612,6 +607,7 @@ static void pfault_interrupt(struct ext_code ext_code, ...@@ -612,6 +607,7 @@ static void pfault_interrupt(struct ext_code ext_code,
} }
} }
spin_unlock(&pfault_lock); spin_unlock(&pfault_lock);
put_task_struct(tsk);
} }
static int __cpuinit pfault_cpu_notify(struct notifier_block *self, static int __cpuinit pfault_cpu_notify(struct notifier_block *self,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部