lkml.org 
[lkml]   [2004]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: CONFIG_PREEMPT x86 assembly question
Nikita V. Youshchenko wrote:
> In arch/i386/kernel/entry.S
>
> ...
> ENTRY(resume_kernel)
> cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ?
> jnz restore_all
> need_resched:
> movl TI_flags(%ebp), %ecx # need_resched set ?
> testb $_TIF_NEED_RESCHED, %cl
> jz restore_all
> testl $IF_MASK,EFLAGS(%esp) # interrupts off (exception path) ?
> jz restore_all
> movl $PREEMPT_ACTIVE,TI_preempt_count(%ebp)
> sti
> call schedule
> movl $0,TI_preempt_count(%ebp)
> cli
> jmp need_resched
> #endif
> ...
>
> Why, after return from schedule(), first 0 is written to
> TI_preempt_count(%ebp), and only then interrupts are disabled?
> Wht not the reverse order?
>

It's already reversed in linux-2.6.10-rc2:
...
call schedule
cli
movl $0,TI_preempt_count(%ebp)
jmp need_resched

Michal
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.032 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site