lkml.org 
[lkml]   [2001]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] take 2 of the tr-based current

Hi,

> No. const == never changes.
> get_TR changes if a task calls schedule, and return on another cpu.

Yes, I found this exact problem on ppc64 where we would cache the
processor data area across a schedule(). What was interesting was that
__attribute__ ((pure)) was not enough to fix this.

static inline struct Paca *get_paca(void) __attribute__ ((pure));
static inline struct Paca *get_paca(void)
{
struct Paca *rval;
__asm__ ("mfspr %0,0x113" : "=r" (rval));
return rval;
}

Alan Modra came to the rescue and found that gcc was optimising too much
and since the function did not touch any global variables, it would
upgrade the pure to const. This was on gcc 3.0.X.

Anton
-
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 13:13    [W:0.087 / U:4.000 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site