lkml.org 
[lkml]   [2008]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2008-09-14 17:17    [W:2.095 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site