[lkml]   [2003]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Why is get_current() not const function?
In article <>,
Jakub Jelinek <> wrote:
>Anyone remembers why get_current function (on arches which define
>current to get_current()) is not const

Because it makes no difference at all on x86, since gcc will ignore
"const" for inline functions. At least that used to be true.

> and why on x86-64
>the movq %%gs:0, %0 inline asm is volatile with "memory" clobber?

Can't help you on that one, but it looks like it uses various helper
functions for doing the x86-64 per-processor data structures, and I bet
those helper functions are shared by _other_ users who definitely want
to have their data properly re-read. Ie "current()" may be constant in
process context, but that sure isn't true about a lot of other things in
the per-processor data structures.

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: 2005-03-22 13:34    [W:0.030 / U:2.948 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site