[lkml]   [2007]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [rfc 37/45] x86_64: Support for fast per cpu operations
H. Peter Anvin writes:

> There was, at some point, discussion about using the gcc TLS mechanism,
> which should permit even better code to be generated. Unfortunately, it
> would require gcc to be able to reference %gs instead of %fs (and vice
> versa for i386), which I don't think is available in anything except
> maybe the most cutting-edge version of gcc.
> However, if we're doing a masssive revampt it would be good to get an
> idea of how to migrate to that model eventually, or why it doesn't make
> sense at all.

The problem I found when I tried to do that on powerpc is that gcc
believes it can cache addresses of TLS variables. If you try and use
TLS accesses for per-cpu variables then you end up accessing the wrong
cpu's variables due to that, since our "TLS" pointer can change at any
point where preemption is enabled.

If we wanted to do per-task variables then TLS would be perfect for

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-11-20 03:49    [W:0.114 / U:0.280 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site