Re: [PATCH v5] hung_task: Deduplicate identical hang reports using explicit blocker tracking

kernel test robot <[email protected]> Wed, 5 Aug 2026 05:41:02 +0800
Newsgroups dev.linux.lists.oe-kbuild-all,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi Aaron,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on tip/sched/core linus/master kees/for-next/execve v7.2-rc6 next-20260804]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Aaron-Tomlin/hung_task-Deduplicate-identical-hang-reports-using-explicit-blocker-tracking/20260804-194519
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20260712202100.123934-1-atomlin%40atomlin.com
patch subject: [PATCH v5] hung_task: Deduplicate identical hang reports using explicit blocker tracking
config: openrisc-randconfig-r071-20260805 (https://download.01.org/0day-ci/archive/20260805/[email protected]/config)
compiler: or1k-linux-gcc (GCC) 12.5.0
smatch: v0.5.0-9187-g5189e3fb
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260805/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   kernel/hung_task.c: In function 'check_hung_uninterruptible_tasks':
>> kernel/hung_task.c:337:14: warning: variable 'scan_completed' set but not used [-Wunused-but-set-variable]
     337 |         bool scan_completed = false;
         |              ^~~~~~~~~~~~~~


vim +/scan_completed +337 kernel/hung_task.c

   323	
   324	/*
   325	 * Check whether a TASK_UNINTERRUPTIBLE does not get woken up for
   326	 * a really long time. If that happens, print out a warning.
   327	 */
   328	static void check_hung_uninterruptible_tasks(unsigned long timeout)
   329	{
   330		int max_count = sysctl_hung_task_check_count;
   331		unsigned long last_break = jiffies;
   332		struct task_struct *g, *t;
   333		unsigned long this_round_count;
   334		int need_warning = sysctl_hung_task_warnings;
   335		unsigned long si_mask = hung_task_si_mask;
   336		unsigned int skip_show_task;
 > 337		bool scan_completed = false;
   338	#ifdef CONFIG_DETECT_HUNG_TASK_BLOCKER
   339		unsigned long blocker;
   340		static int warnings_reset_value;
   341		unsigned long seen_blockers_mask = 0;
   342	#endif
   343	
   344		/*
   345		 * If the system crashed already then all bets are off,
   346		 * do not report extra hung tasks:
   347		 */
   348		if (test_taint(TAINT_DIE) || did_panic)
   349			return;
   350	
   351		this_round_count = 0;
   352		rcu_read_lock();
   353		for_each_process_thread(g, t) {
   354			if (!max_count--)
   355				goto unlock;
   356			if (time_after(jiffies, last_break + HUNG_TASK_LOCK_BREAK)) {
   357				if (!rcu_lock_break(g, t))
   358					goto unlock;
   359				last_break = jiffies;
   360			}
   361	
   362			if (task_is_hung(t, timeout)) {
   363				skip_show_task = t->hung_task_reported;
   364				/*
   365				 * Increment the global counter so that userspace could
   366				 * start migrating tasks ASAP. But count the current
   367				 * round separately because userspace could reset
   368				 * the global counter at any time.
   369				 */
   370				atomic_long_inc(&sysctl_hung_task_detect_count);
   371				this_round_count++;
   372	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki