lkml.org 
[lkml]   [2006]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: broken local_t on i386
On Mon, 12 Jun 2006, Andi Kleen wrote:

> > #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
>
> It is also affected by your race. The inc would only be atomic if the counter
> was in the PDA, but standard per cpu data isn't. So it has to follow
> a pointer and then it could already have switched.

I thought the above would refer to a PDA memory area that is specially
mapped by each processor? That is the only thing that would get this
working right because we would map to a different PDA if the process
would be mapped to a different processor.

> Fix would be to disable preemption. I don't think it needs cli/sti
> on non preemptible kernels.

Yuck. The advantage of local.t was that it does not need any of these
tricks. What is the point of local.t if one needs to disable preemption?
-
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: 2006-06-12 18:57    [from the cache]
©2003-2011 Jasper Spaans