Re: [PATCH 3/8] Add a PF flag for ksoftirqd identification

From: Eric Dumazet
Date: Fri Oct 15 2010 - 10:46:42 EST


Le lundi 04 octobre 2010 Ã 17:03 -0700, Venkatesh Pallipadi a Ãcrit :
> To account softirq time cleanly in scheduler, we need to identify whether
> softirq is invoked in ksoftirqd context or softirq at hardirq tail context.
> Add PF_KSOFTIRQD for that purpose.
>
> As all PF flag bits are currently taken, create space by moving one of the
> infrequently used bits (PF_THREAD_BOUND) down in task_struct to be along
> with some other state fields.
>
> Signed-off-by: Venkatesh Pallipadi <venki@xxxxxxxxxx>

Instead of using one bit per task (and fight to find a free bit) why not
using existing :

DEFINE_PER_CPU(struct task_struct *, ksoftirqd);

And check if current is ksoftirqd ?

if (__get_cpu_var(ksoftirqd) == current) ...


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