Thread (25 messages) flat view 25 messages, 9 authors, 2006-05-18

Re: [RFC/PATCH] Make powerpc64 use __thread for per-cpu variables

From: Paul Mackerras <hidden>
Date: 2006-05-10 23:05:52
Also in: linux-arch, lkml

Richard Henderson writes:
How do you plan to address the compiler optimizing

	__thread int foo;
	{
	  use(foo);
	  schedule();
	  use(foo);
	}

into

	{
	  int *tmp = &foo;	// tls arithmetic here
	  use(*tmp);
	  schedule();
	  use(*tmp);
	}
Hmmm...  Would it be sufficient to use a RELOC_HIDE in __get_cpu_var,
like this?

#define __get_cpu_var(x)	(*(RELOC_HIDE(&per_cpu__##x, 0)))

Paul.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help