[lkml]   [2004]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] CPU time clock support in clock_* syscalls
Roland McGrath wrote:
>>It seemed like a syscall could read the values from a task currently
>>running on another CPU. If not, great.
> Indeed it can. And yes, there is no locking against updates for this. For
> sched_time on 32-bit platforms, there is the possibility it could be read
> during an update and give a bogus value if the high half is updated before
> the low half. Since there are no guarantees about accuracy, period, I
> decided not to worry about such an anomaly. Perhaps it would be better to
> do something about this, but AFAIK nothing perfect can be done without
> adding more words to task_struct (e.g. seqcount). I don't know if the
> nature of SMP cache behavior makes something like:
> do {
> sample = p->sched_time;
> } while (p->sched_time != sample);
> sufficient. That would certainly be easy to do.

I don't think that will be quite sufficient.

A seqcount would probably be the way to go.
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 14:06    [W:0.047 / U:6.640 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site