Re: [PATCH v2] hung_task: Add per-round stack trace deduplication

kernel test robot <[email protected]>
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 errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v7.2-rc7 next-20260813]
[cannot apply to linux-review/Aaron-Tomlin/hung_task-Add-per-round-stack-trace-deduplication/20260618-025656]
[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-Add-per-round-stack-trace-deduplication/20260814-211006
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20260620013559.1537893-1-atomlin%40atomlin.com
patch subject: [PATCH v2] hung_task: Add per-round stack trace deduplication
config: alpha-allmodconfig (https://download.01.org/0day-ci/archive/20260815/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260815/[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 errors (new ones prefixed by >>):

   In file included from <command-line>:
   kernel/hung_task.c: In function 'check_hung_uninterruptible_tasks':
>> kernel/hung_task.c:388:72: error: 'sysctl_hung_task_dedup' undeclared (first use in this function); did you mean 'sysctl_hung_task_panic'?
     388 |         bool dedup_enabled = IS_ENABLED(CONFIG_STACKTRACE) ? READ_ONCE(sysctl_hung_task_dedup) : 0;
         |                                                                        ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:682:23: note: in definition of macro '__compiletime_assert'
     682 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:702:9: note: in expansion of macro '_compiletime_assert'
     702 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |         ^~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                            ^~~~~~~~~~~~~
   include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      49 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/hung_task.c:388:62: note: in expansion of macro 'READ_ONCE'
     388 |         bool dedup_enabled = IS_ENABLED(CONFIG_STACKTRACE) ? READ_ONCE(sysctl_hung_task_dedup) : 0;
         |                                                              ^~~~~~~~~
   kernel/hung_task.c:388:72: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/compiler_types.h:682:23: note: in definition of macro '__compiletime_assert'
     682 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:702:9: note: in expansion of macro '_compiletime_assert'
     702 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |         ^~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                            ^~~~~~~~~~~~~
   include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      49 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/hung_task.c:388:62: note: in expansion of macro 'READ_ONCE'
     388 |         bool dedup_enabled = IS_ENABLED(CONFIG_STACKTRACE) ? READ_ONCE(sysctl_hung_task_dedup) : 0;
         |                                                              ^~~~~~~~~


vim +388 kernel/hung_task.c

   375	
   376	/*
   377	 * Check whether a TASK_UNINTERRUPTIBLE does not get woken up for
   378	 * a really long time. If that happens, print out a warning.
   379	 */
   380	static void check_hung_uninterruptible_tasks(unsigned long timeout)
   381	{
   382		int max_count = sysctl_hung_task_check_count;
   383		unsigned long last_break = jiffies;
   384		struct task_struct *g, *t;
   385		unsigned long this_round_count;
   386		int need_warning = sysctl_hung_task_warnings;
   387		unsigned long si_mask = hung_task_si_mask;
 > 388		bool dedup_enabled = IS_ENABLED(CONFIG_STACKTRACE) ? READ_ONCE(sysctl_hung_task_dedup) : 0;
   389	
   390		/*
   391		 * If the system crashed already then all bets are off,
   392		 * do not report extra hung tasks:
   393		 */
   394		if (test_taint(TAINT_DIE) || did_panic)
   395			return;
   396	
   397		/*
   398		 * Reset the de-duplicator hash table for this new detection round.
   399		 * This prevents stale hashes from permanently suppressing.
   400		 */
   401		if (dedup_enabled)
   402			hung_task_dedup_flush();
   403	
   404		this_round_count = 0;
   405		rcu_read_lock();
   406		for_each_process_thread(g, t) {
   407			if (!max_count--)
   408				goto unlock;
   409			if (time_after(jiffies, last_break + HUNG_TASK_LOCK_BREAK)) {
   410				if (!rcu_lock_break(g, t))
   411					goto unlock;
   412				last_break = jiffies;
   413			}
   414	
   415			if (task_is_hung(t, timeout)) {
   416				/*
   417				 * Increment the global counter so that userspace could
   418				 * start migrating tasks ASAP. But count the current
   419				 * round separately because userspace could reset
   420				 * the global counter at any time.
   421				 */
   422				atomic_long_inc(&sysctl_hung_task_detect_count);
   423				this_round_count++;
   424				hung_task_info(t, timeout, this_round_count, dedup_enabled);
   425			}
   426		}
   427	 unlock:
   428		rcu_read_unlock();
   429	
   430		if (!this_round_count)
   431			return;
   432	
   433		if (need_warning || hung_task_call_panic) {
   434			si_mask |= SYS_INFO_LOCKS;
   435	
   436			if (sysctl_hung_task_all_cpu_backtrace)
   437				si_mask |= SYS_INFO_ALL_BT;
   438		}
   439	
   440		sys_info(si_mask);
   441	
   442		if (hung_task_call_panic)
   443			panic("hung_task: blocked tasks");
   444	}
   445	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.