Re: [PATCH] tasklets: simplify code in tasklet_action_common()

From: Thomas Gleixner
Date: Tue Aug 10 2021 - 09:12:20 EST


On Fri, Apr 30 2021 at 20:25, Mingzhe Yang wrote:

> Use tasklet_is_disabled() to simplify the code in
> tasklet_action_common.

This changelog is not really helpful. Use a new function does not tell
anything. Neither does it explain why there need to be two new functions
and worse

> +static inline bool tasklet_is_enabled(struct tasklet_struct *t)
> +{
> + smp_rmb();

why there is suddenly a new undocumented SMP barrier in the code.

> + return !atomic_read(&t->count);
> +}
> +
> +static inline bool tasklet_is_disabled(struct tasklet_struct *t)
> +{
> + return !tasklet_is_enabled(t);
> +}
> +

Aside of that there is no point in exposing these functions in a global
header.

Thanks,

tglx