Commit 612e7a4c authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull kernel_clone() updates from Christian Brauner:
 "During the v5.9 merge window we reworked the process creation
  codepaths across multiple architectures. After this work we were only
  left with the _do_fork() helper based on the struct kernel_clone_args
  calling convention. As was pointed out _do_fork() isn't valid
  kernelese especially for a helper that isn't just static.

  This series removes the _do_fork() helper and introduces the new
  kernel_clone() helper. The process creation cleanup didn't change the
  name to something more reasonable mainly because _do_fork() was used
  in quite a few places. So sending this as a separate series seemed the
  better strategy.

  I originally intended to send this early in the v5.9 development cycle
  after the merge window had closed but given that this was touching
  quite a few places I decided to defer this until the v5.10 merge
  window"

* tag 'kernel-clone-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
  sched: remove _do_fork()
  tracing: switch to kernel_clone()
  kgdbts: switch to kernel_clone()
  kprobes: switch to kernel_clone()
  x86: switch to kernel_clone()
  sparc: switch to kernel_clone()
  nios2: switch to kernel_clone()
  m68k: switch to kernel_clone()
  ia64: switch to kernel_clone()
  h8300: switch to kernel_clone()
  fork: introduce kernel_clone()
parents 9e51183e 06fe4563
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1495,7 +1495,7 @@ Extended error information
    #

    { stacktrace:
             _do_fork+0x18e/0x330
             kernel_clone+0x18e/0x330
             kernel_thread+0x29/0x30
             kthreadd+0x154/0x1b0
             ret_from_fork+0x3f/0x70
@@ -1588,7 +1588,7 @@ Extended error information
             SYSC_sendto+0xef/0x170
    } hitcount:         88
    { stacktrace:
             _do_fork+0x18e/0x330
             kernel_clone+0x18e/0x330
             SyS_clone+0x19/0x20
             entry_SYSCALL_64_fastpath+0x12/0x6a
    } hitcount:        244
+1 −1
Original line number Diff line number Diff line
@@ -172,5 +172,5 @@ asmlinkage int sys_clone(unsigned long __user *args)
	kargs.exit_signal	= (lower_32_bits(clone_flags) & CSIGNAL);
	kargs.stack		= newsp;

	return _do_fork(&kargs);
	return kernel_clone(&kargs);
}
+2 −2
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ ia64_load_extra (struct task_struct *task)
 *
 *	<clone syscall>	        <some kernel call frames>
 *	sys_clone		   :
 *	_do_fork		_do_fork
 *	kernel_clone		kernel_clone
 *	copy_thread		copy_thread
 *
 * This means that the stack layout is as follows:
@@ -411,7 +411,7 @@ asmlinkage long ia64_clone(unsigned long clone_flags, unsigned long stack_start,
		.tls		= tls,
	};

	return _do_fork(&args);
	return kernel_clone(&args);
}

static void
+5 −5
Original line number Diff line number Diff line
@@ -107,10 +107,10 @@ void flush_thread(void)
 * on top of pt_regs, which means that sys_clone() arguments would be
 * buried.  We could, of course, copy them, but it's too costly for no
 * good reason - generic clone() would have to copy them *again* for
 * _do_fork() anyway.  So in this case it's actually better to pass pt_regs *
 * and extract arguments for _do_fork() from there.  Eventually we might
 * go for calling _do_fork() directly from the wrapper, but only after we
 * are finished with _do_fork() prototype conversion.
 * kernel_clone() anyway.  So in this case it's actually better to pass pt_regs *
 * and extract arguments for kernel_clone() from there.  Eventually we might
 * go for calling kernel_clone() directly from the wrapper, but only after we
 * are finished with kernel_clone() prototype conversion.
 */
asmlinkage int m68k_clone(struct pt_regs *regs)
{
@@ -125,7 +125,7 @@ asmlinkage int m68k_clone(struct pt_regs *regs)
		.tls		= regs->d5,
	};

	return _do_fork(&args);
	return kernel_clone(&args);
}

/*
+1 −1
Original line number Diff line number Diff line
@@ -266,5 +266,5 @@ asmlinkage int nios2_clone(unsigned long clone_flags, unsigned long newsp,
		.tls		= tls,
	};

	return _do_fork(&args);
	return kernel_clone(&args);
}
Loading