Re: [REPOST] RFC: sched: Prevent wakeup to enter critical section needlessly

From: Andi Kleen
Date: Tue Oct 09 2012 - 09:37:22 EST


Ivo Sieben <meltedpianoman@xxxxxxxxx> writes:

> Check the waitqueue task list to be non empty before entering the critical
> section. This prevents locking the spin lock needlessly in case the queue
> was empty, and therefor also prevent scheduling overhead on a PREEMPT_RT
> system.
>
> Signed-off-by: Ivo Sieben <meltedpianoman@xxxxxxxxx>
> ---
>
> REPOST:
> Request for comments:
> - Does this make any sense?

Looks good to me. Avoiding any spinlock is good. I don't even think you
need "careful", if you miss an update it was just as it happened a
little later.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
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/