diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-06 00:08:40 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-12 03:39:26 +0200 |
commit | 7721d3c2083c27bfb8e4c1335d343e25ae1a663f (patch) | |
tree | c9b4ed9f85ca2386a665c3f317150fb2cc964d1b | |
parent | alpha: don't open-code trace_report_syscall_{enter,exit} (diff) | |
download | linux-7721d3c2083c27bfb8e4c1335d343e25ae1a663f.tar.xz linux-7721d3c2083c27bfb8e4c1335d343e25ae1a663f.zip |
alpha: simplify TIF_NEED_RESCHED handling
In case we have both NEED_RESCHED and SIGPENDING/NOTIFY_RESUME,
handle the latter first. We'll get to original priorities in
the next commit, but now that allows to simplify the treatment
of NEED_RESCHED-only case nicely. Namely, now there no need to
preserve the data for restarts across the call of schedule() in
$work_resched; we can get there only if we had either returned
from syscall without SIGPENDING (in which case we should've
had no restart-worthy return value and want no restarts) or
already got through do_notify_resume() call (in which case we
want no restarts anymore). So we can just slap 0 into $19
instead of preserving it (and $20).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | arch/alpha/kernel/entry.S | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S index 2a359c9ee3cd..802108b15be8 100644 --- a/arch/alpha/kernel/entry.S +++ b/arch/alpha/kernel/entry.S @@ -372,26 +372,18 @@ $ret_success: .align 4 .ent work_pending work_pending: - and $5, _TIF_NEED_RESCHED, $2 - beq $2, $work_notifysig + and $5, _TIF_NOTIFY_RESUME | _TIF_SIGPENDING, $2 + bne $2, $work_notifysig $work_resched: - subq $sp, 16, $sp - stq $19, 0($sp) /* save syscall nr */ - stq $20, 8($sp) /* and error indication (a3) */ + /* + * We can get here only if we returned from syscall without SIGPENDING + * or got through work_notifysig already. Either case means no syscall + * restarts for us, so let $19 and $20 burn. + */ jsr $26, schedule - ldq $19, 0($sp) - ldq $20, 8($sp) - addq $sp, 16, $sp - /* Make sure need_resched and sigpending don't change between - sampling and the rti. */ - lda $16, 7 - call_pal PAL_swpipl - ldl $5, TI_FLAGS($8) - and $5, _TIF_WORK_MASK, $2 - beq $2, restore_all - and $5, _TIF_NEED_RESCHED, $2 - bne $2, $work_resched + mov 0, $19 + br ret_to_user $work_notifysig: mov $sp, $16 |