Re: [patch V2 7/9] softirq: Replace barrier() with cpu_relax() in tasklet_unlock_wait()

From: Thomas Gleixner
Date: Mon Dec 07 2020 - 10:22:21 EST


On Mon, Dec 07 2020 at 12:39, Peter Zijlstra wrote:
> On Fri, Dec 04, 2020 at 06:01:58PM +0100, Thomas Gleixner wrote:
>> static inline void tasklet_unlock_wait(struct tasklet_struct *t)
>> {
>> - while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
>> + while (test_bit(TASKLET_STATE_RUN, &(t)->state))
>> + cpu_relax();
>> }
>
> Wouldn't it be nicer to stick a completion in tasklet_struct ? Or at the
> very least use wait_var_event() or something?

It would be nicer. Just need to audit all possible callers. That would
lose the implicit boosting of the preempted softirq thread, but these
wait pathes should not be in any way relevant for user task
latencies. Emphasis on should.

Lemme stare at the callers including the ones which have it wrapped into
some other inline just because.

Thanks,

tglx