Re: [PATCH 1/6] Free up pf flag PF_KSOFTIRQD

From: Christoph Lameter
Date: Thu Oct 21 2010 - 11:14:00 EST


On Wed, 20 Oct 2010, Venkatesh Pallipadi wrote:

> diff --git a/kernel/sched.c b/kernel/sched.c
> index abf8440..5d4afe9 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -1984,9 +1984,9 @@ void account_system_vtime(struct task_struct *curr)
> * in that case, so as not to confuse scheduler with a special task
> * that do not consume any time, but still wants to run.
> */
> - if (hardirq_count())
> + if (in_irq())
> per_cpu(cpu_hardirq_time, cpu) += delta;

If cpu is always the current cpu then you can optimize the code:

this_cpu_add(cpu_hardirq_time, delta)

> - else if (in_serving_softirq() && !(curr->flags & PF_KSOFTIRQD))
> + else if (in_serving_softirq() && !(is_ksoftirqd_context()))
> per_cpu(cpu_softirq_time, cpu) += delta;

Same here.

--
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/