Hi Johan,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 108b9a92793f61e1abf94d341c676515421e57a2 commit: 3d01105a68b1318bdc3cef3bbcfcb544e2da856e [13613/30000] workqueue: fix state-dump console deadlock config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20240921/202409211946.NL6KIvwJ-lkp@i...) compiler: aarch64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240921/202409211946.NL6KIvwJ-lkp@i...)
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/202409211946.NL6KIvwJ-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/workqueue.c: In function 'show_workqueue_state':
kernel/workqueue.c:4821:33: error: implicit declaration of function 'printk_safe_enter'; did you mean 'printk_nmi_enter'? [-Werror=implicit-function-declaration]
4821 | printk_safe_enter(); | ^~~~~~~~~~~~~~~~~ | printk_nmi_enter
kernel/workqueue.c:4823:33: error: implicit declaration of function 'printk_safe_exit'; did you mean 'printk_nmi_exit'? [-Werror=implicit-function-declaration]
4823 | printk_safe_exit(); | ^~~~~~~~~~~~~~~~ | printk_nmi_exit kernel/workqueue.c: In function 'create_worker': kernel/workqueue.c:1935:54: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size between 5 and 14 [-Wformat-truncation=] 1935 | snprintf(id_buf, sizeof(id_buf), "%d:%d%s", pool->cpu, id, | ^~ kernel/workqueue.c:1935:50: note: directive argument in the range [0, 2147483647] 1935 | snprintf(id_buf, sizeof(id_buf), "%d:%d%s", pool->cpu, id, | ^~~~~~~~~ kernel/workqueue.c:1935:17: note: 'snprintf' output between 4 and 23 bytes into a destination of size 16 1935 | snprintf(id_buf, sizeof(id_buf), "%d:%d%s", pool->cpu, id, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1936 | pool->attrs->nice < 0 ? "H" : ""); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors
vim +4821 kernel/workqueue.c
4780 4781 /** 4782 * show_workqueue_state - dump workqueue state 4783 * 4784 * Called from a sysrq handler or try_to_freeze_tasks() and prints out 4785 * all busy workqueues and pools. 4786 */ 4787 void show_workqueue_state(void) 4788 { 4789 struct workqueue_struct *wq; 4790 struct worker_pool *pool; 4791 unsigned long flags; 4792 int pi; 4793 4794 rcu_read_lock(); 4795 4796 pr_info("Showing busy workqueues and worker pools:\n"); 4797 4798 list_for_each_entry_rcu(wq, &workqueues, list) { 4799 struct pool_workqueue *pwq; 4800 bool idle = true; 4801 4802 for_each_pwq(pwq, wq) { 4803 if (pwq->nr_active || !list_empty(&pwq->delayed_works)) { 4804 idle = false; 4805 break; 4806 } 4807 } 4808 if (idle) 4809 continue; 4810 4811 pr_info("workqueue %s: flags=0x%x\n", wq->name, wq->flags); 4812 4813 for_each_pwq(pwq, wq) { 4814 raw_spin_lock_irqsave(&pwq->pool->lock, flags); 4815 if (pwq->nr_active || !list_empty(&pwq->delayed_works)) { 4816 /* 4817 * Defer printing to avoid deadlocks in console 4818 * drivers that queue work while holding locks 4819 * also taken in their write paths. 4820 */
4821 printk_safe_enter();
4822 show_pwq(pwq);
4823 printk_safe_exit();
4824 } 4825 raw_spin_unlock_irqrestore(&pwq->pool->lock, flags); 4826 /* 4827 * We could be printing a lot from atomic context, e.g. 4828 * sysrq-t -> show_workqueue_state(). Avoid triggering 4829 * hard lockup. 4830 */ 4831 touch_nmi_watchdog(); 4832 } 4833 } 4834 4835 for_each_pool(pool, pi) { 4836 struct worker *worker; 4837 bool first = true; 4838 4839 raw_spin_lock_irqsave(&pool->lock, flags); 4840 if (pool->nr_workers == pool->nr_idle) 4841 goto next_pool; 4842 /* 4843 * Defer printing to avoid deadlocks in console drivers that 4844 * queue work while holding locks also taken in their write 4845 * paths. 4846 */ 4847 printk_safe_enter(); 4848 pr_info("pool %d:", pool->id); 4849 pr_cont_pool_info(pool); 4850 pr_cont(" hung=%us workers=%d", 4851 jiffies_to_msecs(jiffies - pool->watchdog_ts) / 1000, 4852 pool->nr_workers); 4853 if (pool->manager) 4854 pr_cont(" manager: %d", 4855 task_pid_nr(pool->manager->task)); 4856 list_for_each_entry(worker, &pool->idle_list, entry) { 4857 pr_cont(" %s%d", first ? "idle: " : "", 4858 task_pid_nr(worker->task)); 4859 first = false; 4860 } 4861 pr_cont("\n"); 4862 printk_safe_exit(); 4863 next_pool: 4864 raw_spin_unlock_irqrestore(&pool->lock, flags); 4865 /* 4866 * We could be printing a lot from atomic context, e.g. 4867 * sysrq-t -> show_workqueue_state(). Avoid triggering 4868 * hard lockup. 4869 */ 4870 touch_nmi_watchdog(); 4871 } 4872 4873 rcu_read_unlock(); 4874 } 4875