Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [tj-sched-ext:scx-bypass-scalability-v2 33/37] kernel/watchdog.c:206:7: error: call to undeclared function 'scx_hardlockup'; ISO C99 and later do not support implicit function declarations
@ 2025-11-11 23:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-11-11 23:57 UTC (permalink / raw)
  To: Tejun Heo; +Cc: llvm, oe-kbuild-all, Andrea Righi

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git scx-bypass-scalability-v2
head:   27ab0bfd9e10121f25b6dd1b5500c7b627c5d215
commit: 2b9c2213630da8f6f2a256005f9ce9070e39847f [33/37] sched_ext: Hook up hardlockup detector
config: i386-randconfig-013-20251112 (https://download.01.org/0day-ci/archive/20251112/202511120732.yXirARWn-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251112/202511120732.yXirARWn-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511120732.yXirARWn-lkp@intel.com/

All errors (new ones prefixed by >>):

>> kernel/watchdog.c:206:7: error: call to undeclared function 'scx_hardlockup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     206 |                 if (scx_hardlockup())
         |                     ^
   kernel/watchdog.c:206:7: note: did you mean 'is_hardlockup'?
   kernel/watchdog.c:154:13: note: 'is_hardlockup' declared here
     154 | static bool is_hardlockup(unsigned int cpu)
         |             ^
   1 error generated.


vim +/scx_hardlockup +206 kernel/watchdog.c

   178	
   179	void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs)
   180	{
   181		if (per_cpu(watchdog_hardlockup_touched, cpu)) {
   182			per_cpu(watchdog_hardlockup_touched, cpu) = false;
   183			return;
   184		}
   185	
   186		/*
   187		 * Check for a hardlockup by making sure the CPU's timer
   188		 * interrupt is incrementing. The timer interrupt should have
   189		 * fired multiple times before we overflow'd. If it hasn't
   190		 * then this is a good indication the cpu is stuck
   191		 */
   192		if (is_hardlockup(cpu)) {
   193			unsigned int this_cpu = smp_processor_id();
   194			unsigned long flags;
   195	
   196	#ifdef CONFIG_SYSFS
   197			++hardlockup_count;
   198	#endif
   199			/*
   200			 * A poorly behaving BPF scheduler can trigger hard lockup by
   201			 * e.g. putting numerous affinitized tasks in a single queue and
   202			 * directing all CPUs at it. The following call can return true
   203			 * only once when sched_ext is enabled and will immediately
   204			 * abort the BPF scheduler and print out a warning message.
   205			 */
 > 206			if (scx_hardlockup())
   207				return;
   208	
   209			/* Only print hardlockups once. */
   210			if (per_cpu(watchdog_hardlockup_warned, cpu))
   211				return;
   212	
   213			/*
   214			 * Prevent multiple hard-lockup reports if one cpu is already
   215			 * engaged in dumping all cpu back traces.
   216			 */
   217			if (sysctl_hardlockup_all_cpu_backtrace) {
   218				if (test_and_set_bit_lock(0, &hard_lockup_nmi_warn))
   219					return;
   220			}
   221	
   222			/*
   223			 * NOTE: we call printk_cpu_sync_get_irqsave() after printing
   224			 * the lockup message. While it would be nice to serialize
   225			 * that printout, we really want to make sure that if some
   226			 * other CPU somehow locked up while holding the lock associated
   227			 * with printk_cpu_sync_get_irqsave() that we can still at least
   228			 * get the message about the lockup out.
   229			 */
   230			pr_emerg("CPU%u: Watchdog detected hard LOCKUP on cpu %u\n", this_cpu, cpu);
   231			printk_cpu_sync_get_irqsave(flags);
   232	
   233			print_modules();
   234			print_irqtrace_events(current);
   235			if (cpu == this_cpu) {
   236				if (regs)
   237					show_regs(regs);
   238				else
   239					dump_stack();
   240				printk_cpu_sync_put_irqrestore(flags);
   241			} else {
   242				printk_cpu_sync_put_irqrestore(flags);
   243				trigger_single_cpu_backtrace(cpu);
   244			}
   245	
   246			if (sysctl_hardlockup_all_cpu_backtrace) {
   247				trigger_allbutcpu_cpu_backtrace(cpu);
   248				if (!hardlockup_panic)
   249					clear_bit_unlock(0, &hard_lockup_nmi_warn);
   250			}
   251	
   252			if (hardlockup_panic)
   253				nmi_panic(regs, "Hard LOCKUP");
   254	
   255			per_cpu(watchdog_hardlockup_warned, cpu) = true;
   256		} else {
   257			per_cpu(watchdog_hardlockup_warned, cpu) = false;
   258		}
   259	}
   260	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-11 23:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-11 23:57 [tj-sched-ext:scx-bypass-scalability-v2 33/37] kernel/watchdog.c:206:7: error: call to undeclared function 'scx_hardlockup'; ISO C99 and later do not support implicit function declarations kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox