Commit e868c063 authored by Robert Love's avatar Robert Love Committed by Linus Torvalds

[PATCH] 2.5: preempt on UP critical fix

During 2.5.5-pre schedule_tail was optimized away under UP.  We need it
for preempt-kernel, too, since it decrements the preempt_count to 0
coming off do_fork.

Without this patch, CONFIG_PREEMPT + !CONFIG_SMP does not gain one very
much.  

	Robert Love
parent f60852d2
......@@ -495,7 +495,7 @@ alpha_switch_to:
ret $31,($26),1
.end alpha_switch_to
#ifdef CONFIG_SMP
#if CONFIG_SMP || CONFIG_PREEMPT
.globl ret_from_fork
.align 3
.ent ret_from_fork
......
......@@ -195,7 +195,7 @@ ENTRY(lcall27)
ENTRY(ret_from_fork)
#if CONFIG_SMP
#if CONFIG_SMP || CONFIG_PREEMPT
call SYMBOL_NAME(schedule_tail)
#endif
GET_THREAD_INFO(%ebx)
......
......@@ -332,7 +332,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
.globl ret_from_fork
ret_from_fork:
#ifdef CONFIG_SMP
#if CONFIG_SMP || CONFIG_PREEMPT
bl schedule_tail
#endif
rlwinm r3,r1,0,0,18
......
......@@ -311,7 +311,7 @@ _GLOBAL(_switch)
blr
_GLOBAL(ret_from_fork)
#ifdef CONFIG_SMP
#if CONFIG_SMP || CONFIG_PREEMPT
bl .schedule_tail
#endif
clrrdi r4,r1,THREAD_SHIFT
......
......@@ -295,7 +295,7 @@ ret_from_fork:
stosm 24(%r15),0x03 # reenable interrupts
sr %r0,%r0 # child returns 0
st %r0,SP_R2(%r15) # store return value (change R2 on stack)
#ifdef CONFIG_SMP
#if CONFIG_SMP || CONFIG_PREEMPT
l %r1,BASED(.Lschedtail)
la %r14,BASED(sysc_return)
br %r1 # call schedule_tail, return to sysc_return
......@@ -896,7 +896,7 @@ restart_go:
#error .Ltrace: .long syscall_trace
.Lvfork: .long sys_vfork
#ifdef CONFIG_SMP
#if CONFIG_SMP || CONFIG_PREEMPT
.Lschedtail: .long schedule_tail
#endif
......@@ -280,7 +280,7 @@ ret_from_fork:
GET_CURRENT # load pointer to task_struct to R9
stosm 48(%r15),0x03 # reenable interrupts
xc SP_R2(8,%r15),SP_R2(%r15) # child returns 0
#ifdef CONFIG_SMP
#if CONFIG_SMP || CONFIG_PREEMPT
larl %r14,sysc_return
jg schedule_tail # return to sysc_return
#else
......
......@@ -397,7 +397,7 @@ void sched_exit(task_t * p)
p->sleep_avg) / (EXIT_WEIGHT + 1);
}
#if CONFIG_SMP
#if CONFIG_SMP || CONFIG_PREEMPT
asmlinkage void schedule_tail(void)
{
spin_unlock_irq(&this_rq()->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment