Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [RFC] io_uring: fix the dead lock between io_uring and core dump
       [not found] <20250226113936.385747-1-haifeng.xu@shopee.com>
@ 2025-02-27 18:24 ` kernel test robot
  2025-02-28  9:40   ` Haifeng Xu
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-02-27 18:24 UTC (permalink / raw)
  To: Haifeng Xu; +Cc: llvm, oe-kbuild-all

Hi Haifeng,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on brauner-vfs/vfs.all linus/master v6.14-rc4 next-20250227]
[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/Haifeng-Xu/io_uring-fix-the-dead-lock-between-io_uring-and-core-dump/20250226-194045
base:   tip/sched/core
patch link:    https://lore.kernel.org/r/20250226113936.385747-1-haifeng.xu%40shopee.com
patch subject: [RFC] io_uring: fix the dead lock between io_uring and core dump
config: i386-buildonly-randconfig-003-20250227 (https://download.01.org/0day-ci/archive/20250228/202502280245.WT5bW0xf-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250228/202502280245.WT5bW0xf-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/202502280245.WT5bW0xf-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from kernel/sched/core.c:10:
   In file included from include/linux/highmem.h:8:
   In file included from include/linux/cacheflush.h:5:
   In file included from arch/x86/include/asm/cacheflush.h:5:
   In file included from include/linux/mm.h:2224:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> kernel/sched/core.c:6791:40: error: no member named 'io_uring' in 'struct task_struct'
    6791 |         struct io_uring_task *io_uring = tsk->io_uring;
         |                                          ~~~  ^
   2 warnings and 1 error generated.


vim +6791 kernel/sched/core.c

  6786	
  6787	static inline void sched_submit_work(struct task_struct *tsk)
  6788	{
  6789		static DEFINE_WAIT_OVERRIDE_MAP(sched_map, LD_WAIT_CONFIG);
  6790		unsigned int task_flags;
> 6791		struct io_uring_task *io_uring = tsk->io_uring;
  6792	
  6793		/*
  6794		 * Establish LD_WAIT_CONFIG context to ensure none of the code called
  6795		 * will use a blocking primitive -- which would lead to recursion.
  6796		 */
  6797		lock_map_acquire_try(&sched_map);
  6798	
  6799		task_flags = tsk->flags;
  6800		/*
  6801		 * If a worker goes to sleep, notify and ask workqueue whether it
  6802		 * wants to wake up a task to maintain concurrency.
  6803		 */
  6804		if (task_flags & PF_WQ_WORKER)
  6805			wq_worker_sleeping(tsk);
  6806		else if (task_flags & PF_IO_WORKER)
  6807			io_wq_worker_sleeping(tsk);
  6808		else if ((task_flags & PF_DUMPCORE) && io_uring) {
  6809			struct io_wq *wq = io_uring->io_wq;
  6810	
  6811			io_wq_cancel_tw_create(wq);
  6812		}
  6813	
  6814		/*
  6815		 * spinlock and rwlock must not flush block requests.  This will
  6816		 * deadlock if the callback attempts to acquire a lock which is
  6817		 * already acquired.
  6818		 */
  6819		SCHED_WARN_ON(current->__state & TASK_RTLOCK_WAIT);
  6820	
  6821		/*
  6822		 * If we are going to sleep and we have plugged IO queued,
  6823		 * make sure to submit it to avoid deadlocks.
  6824		 */
  6825		blk_flush_plug(tsk->plug, true);
  6826	
  6827		lock_map_release(&sched_map);
  6828	}
  6829	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC] io_uring: fix the dead lock between io_uring and core dump
  2025-02-27 18:24 ` [RFC] io_uring: fix the dead lock between io_uring and core dump kernel test robot
@ 2025-02-28  9:40   ` Haifeng Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Haifeng Xu @ 2025-02-28  9:40 UTC (permalink / raw)
  To: kernel test robot; +Cc: llvm, oe-kbuild-all



On 2025/2/28 02:24, kernel test robot wrote:
> Hi Haifeng,
> 
> [This is a private test report for your RFC patch.]
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on tip/sched/core]
> [also build test ERROR on brauner-vfs/vfs.all linus/master v6.14-rc4 next-20250227]
> [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/Haifeng-Xu/io_uring-fix-the-dead-lock-between-io_uring-and-core-dump/20250226-194045
> base:   tip/sched/core
> patch link:    https://lore.kernel.org/r/20250226113936.385747-1-haifeng.xu%40shopee.com
> patch subject: [RFC] io_uring: fix the dead lock between io_uring and core dump
> config: i386-buildonly-randconfig-003-20250227 (https://download.01.org/0day-ci/archive/20250228/202502280245.WT5bW0xf-lkp@intel.com/config)
> compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250228/202502280245.WT5bW0xf-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/202502280245.WT5bW0xf-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from kernel/sched/core.c:10:
>    In file included from include/linux/highmem.h:8:
>    In file included from include/linux/cacheflush.h:5:
>    In file included from arch/x86/include/asm/cacheflush.h:5:
>    In file included from include/linux/mm.h:2224:
>    include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
>      504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
>          |                            ~~~~~~~~~~~~~~~~~~~~~ ^
>      505 |                            item];
>          |                            ~~~~
>    include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
>      511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
>          |                            ~~~~~~~~~~~~~~~~~~~~~ ^
>      512 |                            NR_VM_NUMA_EVENT_ITEMS +
>          |                            ~~~~~~~~~~~~~~~~~~~~~~
>>> kernel/sched/core.c:6791:40: error: no member named 'io_uring' in 'struct task_struct'
>     6791 |         struct io_uring_task *io_uring = tsk->io_uring;
>          |                                          ~~~  ^
>    2 warnings and 1 error generated.
> 
> 

The CONFIG_IO_URING isn't enables, so 'io_uring' can't be found in 'struct task_struct'.
I'll post a new version later.

> vim +6791 kernel/sched/core.c
> 
>   6786	
>   6787	static inline void sched_submit_work(struct task_struct *tsk)
>   6788	{
>   6789		static DEFINE_WAIT_OVERRIDE_MAP(sched_map, LD_WAIT_CONFIG);
>   6790		unsigned int task_flags;
>> 6791		struct io_uring_task *io_uring = tsk->io_uring;
>   6792	
>   6793		/*
>   6794		 * Establish LD_WAIT_CONFIG context to ensure none of the code called
>   6795		 * will use a blocking primitive -- which would lead to recursion.
>   6796		 */
>   6797		lock_map_acquire_try(&sched_map);
>   6798	
>   6799		task_flags = tsk->flags;
>   6800		/*
>   6801		 * If a worker goes to sleep, notify and ask workqueue whether it
>   6802		 * wants to wake up a task to maintain concurrency.
>   6803		 */
>   6804		if (task_flags & PF_WQ_WORKER)
>   6805			wq_worker_sleeping(tsk);
>   6806		else if (task_flags & PF_IO_WORKER)
>   6807			io_wq_worker_sleeping(tsk);
>   6808		else if ((task_flags & PF_DUMPCORE) && io_uring) {
>   6809			struct io_wq *wq = io_uring->io_wq;
>   6810	
>   6811			io_wq_cancel_tw_create(wq);
>   6812		}
>   6813	
>   6814		/*
>   6815		 * spinlock and rwlock must not flush block requests.  This will
>   6816		 * deadlock if the callback attempts to acquire a lock which is
>   6817		 * already acquired.
>   6818		 */
>   6819		SCHED_WARN_ON(current->__state & TASK_RTLOCK_WAIT);
>   6820	
>   6821		/*
>   6822		 * If we are going to sleep and we have plugged IO queued,
>   6823		 * make sure to submit it to avoid deadlocks.
>   6824		 */
>   6825		blk_flush_plug(tsk->plug, true);
>   6826	
>   6827		lock_map_release(&sched_map);
>   6828	}
>   6829	
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-28  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250226113936.385747-1-haifeng.xu@shopee.com>
2025-02-27 18:24 ` [RFC] io_uring: fix the dead lock between io_uring and core dump kernel test robot
2025-02-28  9:40   ` Haifeng Xu

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