Re: [PATCH v23 4/9] sched: Add assert_balance_callbacks_empty helper
From: K Prateek Nayak
Date: Thu Oct 30 2025 - 03:38:34 EST
Hello John,
On 10/30/2025 5:48 AM, John Stultz wrote:
> +#ifdef CONFIG_PROVE_LOCKING
> +static inline void assert_balance_callbacks_empty(struct rq *rq)
> +{
> + WARN_ON_ONCE(rq->balance_callback && rq->balance_callback != &balance_push_callback);
Can we instead use "IS_ENABLED(CONFIG_PROVE_LOCKING) && ..." and avoid
the empty stub?
I see similar pattern used inside WARN_ON_ONCE() by RCU and
context-tracking bits so I'm assuming compiler is smart enough to
optimize it out when the config is disabled :)
Apart from that nit, feel free to include:
Reviewed-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>
> +}
> +#else
> +static inline void assert_balance_callbacks_empty(struct rq *rq) {}
> +#endif
> +
--
Thanks and Regards,
Prateek