Unverified Commit a647a846 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!1022 [sync] PR-978: io_uring: fix the problem of running

Merge Pull Request from: @openeuler-sync-bot 
 

Origin pull request: 
https://gitee.com/openeuler/kernel/pulls/978 
 
PR sync from:  Li Lingfeng <lilingfeng3@huawei.com>
 https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/thread/DP5GHDF7ULWL52W5DGYZWS6HBE5WJ52E/ 
patch1: arch: setup PF_IO_WORKER threads like PF_KTHREAD
  pre patch of patch4
patch2: arch: ensure parisc/powerpc handle PF_IO_WORKER in copy_thread()
  fix patch of patch1
patch3: kernel: don't call do_exit() for PF_IO_WORKER threads
  fix the segfault
patch4: x86/process: setup io_threads more like normal user space
threads
  allow io worker to exit

Jens Axboe (3):
  arch: setup PF_IO_WORKER threads like PF_KTHREAD
  arch: ensure parisc/powerpc handle PF_IO_WORKER in copy_thread()
  kernel: don't call do_exit() for PF_IO_WORKER threads

Stefan Metzmacher (1):
  x86/process: setup io_threads more like normal user space threads


-- 
2.31.1
 
 
Link:https://gitee.com/openeuler/kernel/pulls/1022

 

Reviewed-by: default avatarZucheng Zheng <zhengzucheng@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 0ecacc94 0bfedcf3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
	childti->pcb.ksp = (unsigned long) childstack;
	childti->pcb.flags = 1;	/* set FEN, clear everything else */

	if (unlikely(p->flags & PF_KTHREAD)) {
	if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
		/* kernel thread */
		memset(childstack, 0,
			sizeof(struct switch_stack) + sizeof(struct pt_regs));
+1 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
	childksp[0] = 0;			/* fp */
	childksp[1] = (unsigned long)ret_from_fork; /* blink */

	if (unlikely(p->flags & PF_KTHREAD)) {
	if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
		memset(c_regs, 0, sizeof(struct pt_regs));

		c_callee->r13 = kthread_arg;
+1 −1
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start,
	thread->cpu_domain = get_domain();
#endif

	if (likely(!(p->flags & PF_KTHREAD))) {
	if (likely(!(p->flags & (PF_KTHREAD | PF_IO_WORKER)))) {
		*childregs = *current_pt_regs();
		childregs->ARM_r0 = 0;
		if (stack_start)
+1 −1
Original line number Diff line number Diff line
@@ -405,7 +405,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start,

	ptrauth_thread_init_kernel(p);

	if (likely(!(p->flags & PF_KTHREAD))) {
	if (likely(!(p->flags & (PF_KTHREAD | PF_IO_WORKER)))) {
		*childregs = *current_pt_regs();
		childregs->regs[0] = 0;

+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ int copy_thread(unsigned long clone_flags,
	/* setup thread.sp for switch_to !!! */
	p->thread.sp = (unsigned long)childstack;

	if (unlikely(p->flags & PF_KTHREAD)) {
	if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
		memset(childregs, 0, sizeof(struct pt_regs));
		childstack->r15 = (unsigned long) ret_from_kernel_thread;
		childstack->r10 = kthread_arg;
Loading