Messages in this thread | | | Date | Sun, 14 Sep 2008 17:14:04 +0200 | From | Ingo Molnar <> | Subject | Re: [PATCH 2.6.27-rc5 resubmit] Fix itimer/many thread hang. |
| |
* Frank Mayhar <fmayhar@google.com> wrote:
> --- a/include/linux/sched.h > +++ b/include/linux/sched.h
> +/** > + * thread_group_cputime_account_user - Maintain utime for a thread group. > + * > + * @tgtimes: Pointer to thread_group_cputime structure. > + * @cputime: Time value by which to increment the utime field of that > + * structure. > + * > + * If thread group time is being maintained, get the structure for the > + * running CPU and update the utime field there. > + */ > +static inline void thread_group_cputime_account_user( > + struct thread_group_cputime *tgtimes, > + cputime_t cputime) > +{ > + if (tgtimes->totals) { > + struct task_cputime *times; > + > + times = per_cpu_ptr(tgtimes->totals, get_cpu()); > + times->utime = cputime_add(times->utime, cputime); > + put_cpu_no_resched(); > + } > +} > + > +/** > + * thread_group_cputime_account_system - Maintain stime for a thread group. > + * > + * @tgtimes: Pointer to thread_group_cputime structure. > + * @cputime: Time value by which to increment the stime field of that > + * structure. > + * > + * If thread group time is being maintained, get the structure for the > + * running CPU and update the stime field there. > + */ > +static inline void thread_group_cputime_account_system( > + struct thread_group_cputime *tgtimes, > + cputime_t cputime) > +{ > + if (tgtimes->totals) { > + struct task_cputime *times; > + > + times = per_cpu_ptr(tgtimes->totals, get_cpu()); > + times->stime = cputime_add(times->stime, cputime); > + put_cpu_no_resched(); > + } > +} > + > +/** > + * thread_group_cputime_account_exec_runtime - Maintain exec runtime for a > + * thread group. > + * > + * @tgtimes: Pointer to thread_group_cputime structure. > + * @ns: Time value by which to increment the sum_exec_runtime field > + * of that structure. > + * > + * If thread group time is being maintained, get the structure for the > + * running CPU and update the sum_exec_runtime field there. > + */ > +static inline void thread_group_cputime_account_exec_runtime( > + struct thread_group_cputime *tgtimes, > + unsigned long long ns) > +{ > + if (tgtimes->totals) { > + struct task_cputime *times; > + > + times = per_cpu_ptr(tgtimes->totals, get_cpu()); > + times->sum_exec_runtime += ns; > + put_cpu_no_resched(); > + } > +}
please uninline these functions.
Ingo
| |