lkml.org 
[lkml]   [2004]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: 2.6.9-rc3-mm2
From
Date
On Fri, 2004-10-15 at 11:44, Andrew Morton wrote:
> Rusty Russell <rusty@rustcorp.com.au> wrote:
> > Please, please please! Never use per_cpu(XXX, smp_processor_id())!
>
> Why?

Because that's what get_cpu_var() does, and an arch might not need to
get the processor id to do it. As more things get per-cpu-ified, and
smp_processor_id() for its own sake becomes more unusual, I expect archs
to go to smp_processor_id() as a per-cpu variable, and a register
holding the per-cpu offset. (This needs a real dynamic per-cpu
allocator, as well, which I've been meaning to polish off).

> We were getting warnings from somewhere or other due to smp_processor_id()
> within preemptible code - I don't recall the callsite.

That's weird, but implies bogosity in the caller. Covering it up like
this is not necessarily a win.

Rusty.
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell

-
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:07    [W:0.052 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site