lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3pafybrou47nar5l2xxqjvmbhupmsxr4vvawhdadd5qeyhu3sf@mmugthbxe2cs>
Date: Mon, 26 Jan 2026 15:14:27 -0500
From: Aaron Tomlin <atomlin@...mlin.com>
To: Lance Yang <lance.yang@...ux.dev>
Cc: neelx@...e.com, sean@...e.io, pmladek@...e.com, mhiramat@...nel.org, 
	akpm@...ux-foundation.org, joel.granados@...nel.org, mproche@...il.com, chjohnst@...il.com, 
	nick.lange@...il.com, gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hung_task: Skip scan on idle systems

On Mon, Jan 26, 2026 at 01:23:01PM +0800, Lance Yang wrote:
> Hi Aaron,

Hi Lance,

> Keep one patch or series under review at a time, especially in the
> same subsystem ...

Understood. That's fair.

> > @@ -503,6 +504,7 @@ static int watchdog(void *dummy)
> >   	for ( ; ; ) {
> >   		unsigned long timeout = sysctl_hung_task_timeout_secs;
> >   		unsigned long interval = sysctl_hung_task_check_interval_secs;
> > +		unsigned long load[3];
> >   		long t;
> >   		if (interval == 0)
> > @@ -511,8 +513,12 @@ static int watchdog(void *dummy)
> >   		t = hung_timeout_jiffies(hung_last_checked, interval);
> >   		if (t <= 0) {
> >   			if (!atomic_xchg(&reset_hung_task, 0) &&
> > -			    !hung_detector_suspended)
> > -				check_hung_uninterruptible_tasks(timeout);
> > +			    !hung_detector_suspended) {
> > +				/* Check 1-min load to detect idle system */
> > +				get_avenrun(load, 0, 0);
> > +				if (load[0] > 0)
> > +					check_hung_uninterruptible_tasks(timeout);
> 
> The optimization is not worth the trouble.
> 
> I don't think the assumption that "load[0] == 0 means no hung tasks" is
> 100% correct.
> 
> So that would miss actual hung tasks - a false negative, which is worse
> than the "wasted scan" you're trying to avoid.
> 
> Also, I don't *really* care about optimizing something that runs once
> every 120 seconds :)
> 
> Nacked-by: Lance Yang <lance.yang@...ux.dev>

Yes, please ignore. This is indeed wrong.

Regarding the value of the optimisation, while a 120-second interval
implies a low frequency, the cost of the scan is O(N). On large servers
with high thread counts (even if idle), iterating the entire task list
dirties cache lines and consumes memory bandwidth unnecessarily.

Nevertheless, we currently do not have a way to economically compute the
total number of tasks in TASK_UNINTERRUPTIBLE state.


Kind regards,
-- 
Aaron Tomlin

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ