public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: george anzinger <george@mvista.com>
To: Brian Gerst <bgerst@didntduck.org>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] missing GET_CPU_IDX in i386 entry.S
Date: Sat, 08 Jun 2002 22:48:20 -0700	[thread overview]
Message-ID: <3D02EC24.FC3D5AC0@mvista.com> (raw)
In-Reply-To: <3D0223AD.4030208@quark.didntduck.org>

Brian Gerst wrote:
> 
> resume_kernel uses CPU_IDX but never uses GET_CPU_IDX to get the index.
>   This is an issue when smp and preemption are both enabled.  I also
> removed the unused GET_CURRENT_CPU_IDX.

Gosh, your right.  How did you find this?

I think the better solution, however, is to remove the whole
test.  Since the preempt counter gets bumped on each
interrupt and every local_bh_disable, this code should NEVER
find either of the two counters other than zero (since we
already know preemt count is zero).

Good work.

-g
> 
> --
>                                 Brian Gerst
> 
>   ------------------------------------------------------------
> diff -urN linux-bk/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
> --- linux-bk/arch/i386/kernel/entry.S   Wed May 29 15:06:00 2002
> +++ linux/arch/i386/kernel/entry.S      Sat Jun  8 10:44:44 2002
> @@ -83,13 +83,9 @@
>  #define GET_CPU_IDX \
>                 movl TI_CPU(%ebx), %eax;  \
>                 shll $irq_array_shift, %eax
> -#define GET_CURRENT_CPU_IDX \
> -               GET_THREAD_INFO(%ebx); \
> -               GET_CPU_IDX
>  #define CPU_IDX (,%eax)
>  #else
>  #define GET_CPU_IDX
> -#define GET_CURRENT_CPU_IDX GET_THREAD_INFO(%ebx)
>  #define CPU_IDX
>  #endif
> 
> @@ -236,6 +232,7 @@
>         movl TI_FLAGS(%ebx), %ecx
>         testb $_TIF_NEED_RESCHED, %cl
>         jz restore_all
> +       GET_CPU_IDX
>         movl irq_stat+local_bh_count CPU_IDX, %ecx
>         addl irq_stat+local_irq_count CPU_IDX, %ecx
>         jnz restore_all

-- 
George Anzinger   george@mvista.com
High-res-timers: 
http://sourceforge.net/projects/high-res-timers/
Real time sched:  http://sourceforge.net/projects/rtsched/
Preemption patch:
http://www.kernel.org/pub/linux/kernel/people/rml

      reply	other threads:[~2002-06-09  5:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-08 15:33 [PATCH] missing GET_CPU_IDX in i386 entry.S Brian Gerst
2002-06-09  5:48 ` george anzinger [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=3D02EC24.FC3D5AC0@mvista.com \
    --to=george@mvista.com \
    --cc=bgerst@didntduck.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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