Re: [PATCH] workqueue: Control the frequency of intensive warning through cmdline

Tejun Heo
2024-02-21T05:44:32Z

Hello,

On Wed, Feb 21, 2024 at 10:01:17AM +0800, Xuewen Yan wrote:
> cnt = atomic64_inc_return_relaxed(&ent->cnt);
> - if (cnt >= 4 && is_power_of_2(cnt))
> + if (cnt == wq_cpu_intensive_warning_nth ||
> + (cnt > wq_cpu_intensive_warning_nth && is_power_of_2(cnt)))

If we do this the nth name doesn't really make sense. Maybe something like
wq_cpu_intensive_warning_thresh is better? Also, something like the
following might be more predictable. Let's say
wq_cpu_intensive_warning_thresh of 0 disables the warnings and it's
initialized to 4 by default.

if (cnt >= wq_cpu_intensive_warning_thresh &&
is_power_of_2(cnt + 1 - wq_cpu_intensive_warning_thresh))

Thanks.

--
tejun