mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Travis <travis@sgi.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
	David Miller <davem@davemloft.net>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] percpu: fix DEBUG_PREEMPT per_cpu checking
Date: Mon, 11 Feb 2008 11:37:05 -0800	[thread overview]
Message-ID: <47B0A3E1.1010306@sgi.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0802081818580.6273@blonde.site>

Thanks Hugh for catching this.  I've added it to my test code base
and it works fine for x86_64...

Reviewed-by: Mike Travis <travis@sgi.com>

Hugh Dickins wrote:
> Recent percpu changes have broken CONFIG_DEBUG_PREEMPT's per_cpu checking
> on several architectures.  On s390, sparc64 and x86 it's been weakened to
> not checking at all; whereas on powerpc64 it's become too strict, issuing
> warnings from __raw_get_cpu_var in io_schedule and init_timer for example.
> 
> Fix this by weakening powerpc's __my_cpu_offset to use the non-checking
> local_paca instead of get_paca (which itself contains such a check);
> and strengthening the generic my_cpu_offset to go the old slow way via
> smp_processor_id when CONFIG_DEBUG_PREEMPT (debug_smp_processor_id is
> where all the knowledge of what's correct when lives).
> 
> Signed-off-by: Hugh Dickins <hugh@veritas.com>
> ---
> ia64 would be in the first group too, but does not support DEBUG_PREEMPT?
> 
>  include/asm-generic/percpu.h |    2 ++
>  include/asm-powerpc/percpu.h |    2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> --- 2.6.24-git18/include/asm-generic/percpu.h	2008-02-08 11:31:30.000000000 +0000
> +++ linux/include/asm-generic/percpu.h	2008-02-08 12:27:08.000000000 +0000
> @@ -32,6 +32,8 @@ extern unsigned long __per_cpu_offset[NR
>   */
>  #ifndef __my_cpu_offset
>  #define __my_cpu_offset per_cpu_offset(raw_smp_processor_id())
> +#endif
> +#ifdef CONFIG_DEBUG_PREEMPT
>  #define my_cpu_offset per_cpu_offset(smp_processor_id())
>  #else
>  #define my_cpu_offset __my_cpu_offset
> --- 2.6.24-git18/include/asm-powerpc/percpu.h	2008-02-08 11:31:31.000000000 +0000
> +++ linux/include/asm-powerpc/percpu.h	2008-02-08 12:29:17.000000000 +0000
> @@ -13,7 +13,7 @@
>  #include <asm/paca.h>
>  
>  #define __per_cpu_offset(cpu) (paca[cpu].data_offset)
> -#define __my_cpu_offset get_paca()->data_offset
> +#define __my_cpu_offset local_paca->data_offset
>  #define per_cpu_offset(x) (__per_cpu_offset(x))
>  
>  #endif /* CONFIG_SMP */


  reply	other threads:[~2008-02-11 19:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 18:23 Hugh Dickins
2008-02-11 19:37 ` Mike Travis [this message]
2008-02-23 19:40 Hugh Dickins
2008-02-23 20:06 ` Andrew Morton
2008-02-23 20:09   ` Linus Torvalds

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=47B0A3E1.1010306@sgi.com \
    --to=travis@sgi.com \
    --cc=davem@davemloft.net \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=schwidefsky@de.ibm.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

Powered by JetHome