Messages in this thread | | | Date | Fri, 26 Mar 2010 08:59:24 +0100 | From | Stanislaw Gruszka <> | Subject | Re: [RFC,PATCH 2/2] cputimers/proc: do_task_stat()->thread_group_times() is racy and O(n) under ->siglock |
| |
On Thu, Mar 25, 2010 at 01:12:50PM +0100, Oleg Nesterov wrote: > > but more importantly I think > > clock_gettime(CLOCK_PROCESS_CPUTIME_ID) should indeed use ->siglock to > > ensure it serializes against do_exit() so that either we iterate the > > thread or get the accumulated runtime from signal_struct but not both > > (or neither). > > Oh. I forgot everything I knew about posix-cpu-timers... But, it seems, > posix_cpu_clock_get() calls thread_group_cputime() under tasklist and > thus can't race with exit.
We assure thread_group_cputime() is called with one of: tasklist_lock or ->siglock to avoid races with __exit_signal. Except oom killer and elf core-dump code where is no lock, where we assume exit is not called or we don't care of inaccurate results.
Stanislaw
| |