Re: posix-cpu-timers revamp

From: Frank Mayhar
Date: Wed Apr 02 2008 - 17:43:15 EST


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.

Thoughts?
--
Frank Mayhar <fmayhar@xxxxxxxxxx>
Google, Inc.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/