Re: posix-cpu-timers revamp

Frank Mayhar
2008-04-02T18:43:45Z

On Tue, 2008-04-01 at 19:07 -0700, Roland McGrath wrote:
> > To deal with the need for bookkeeping with multiple threads in the SMP
> > case (where there isn't a per-cpu structure until it's needed), I'll
> > allocate the per-cpu structure in __exit_signal() where the relevant
> > fields are updated. I'll also allocate it where I do now, in
> > do_setitimer(), when needed. The allocation will be a "return 0" for UP
> > and a call to "thread_group_times_alloc_smp()" (which lives in sched.c)
> > for SMP.
>
> By do_setitimer, you mean set_process_cpu_timer and posix_cpu_timer_set.

And another quick note: It appears that with the "allocate percpu
storage in copy_signal CLONE_THREAD case" mechanism, I don't need to
worry about allocating it anywhere else. If I need it (which is only in
the case of multiple threads and an interval timer) then I'll have it
because it was allocated with the second thread. So I just eliminate
the allocation in do_setitimer() entirely.