public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
To: "Nikita V. Youshchenko" <yoush@cs.msu.su>
Cc: linux-kernel@vger.kernel.org
Subject: Re: CONFIG_PREEMPT x86 assembly question
Date: Mon, 22 Nov 2004 23:10:39 +0100	[thread overview]
Message-ID: <41A263DF.2040907@stud.feec.vutbr.cz> (raw)
In-Reply-To: <200411201746.44804@sercond.localdomain>

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

      reply	other threads:[~2004-11-22 22:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-20 14:43 CONFIG_PREEMPT x86 assembly question Nikita V. Youshchenko
2004-11-22 22:10 ` Michal Schmidt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41A263DF.2040907@stud.feec.vutbr.cz \
    --to=xschmi00@stud.feec.vutbr.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yoush@cs.msu.su \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox