Re: [PATCH 2.6.27-rc5 resubmit] Fix itimer/many thread hang.

From: Ingo Molnar
Date: Sun Sep 14 2008 - 11:14:34 EST



* Frank Mayhar <fmayhar@xxxxxxxxxx> 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
--
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/