[lkml]   [2008]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: posix-cpu-timers revamp
On Wed, 2008-04-02 at 13:34 -0700, Frank Mayhar wrote:
> One little gotcha we just ran into, though: When checking
> tsk->signal->(anything) in run_posix_cpu_timers(), we have to hold
> tasklist_lock to avoid a race with release_task(). This is going to
> make even the null case always cost more than before.

This race, by the way, is because we're dereferencing task->signal at
interrupt once per tick. We ran into a case where a process was going
through release_task() and being torn down on one CPU while running a
timer tick on another. Under load. It's not a very likely race but
with sufficient time or load it's pretty much inevitable.

My thought is to move thread_group_cputime from the signal structure to
hanging directly off the task structure. It would be shared in the same
way as the signal structure is now but would be deallocated with the
task structure rather than the signal structure. This should mean that
I could avoid getting tasklist_lock under most conditions.

Frank Mayhar <>
Google, Inc.

 \ /
  Last update: 2008-04-02 23:45    [W:0.122 / U:1.116 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site