Thread (148 messages) 148 messages, 17 authors, 2022-06-09

Re: [PATCH 26/35] x86/process: Change copy_thread() argument 'arg' to 'stack_size'

From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Date: 2022-02-11 02:09:46
Also in: linux-arch, linux-doc, linux-mm, lkml

On Tue, 2022-02-08 at 09:38 +0100, Thomas Gleixner wrote:
On Sun, Jan 30 2022 at 13:18, Rick Edgecombe wrote:
quoted
-int copy_thread(unsigned long clone_flags, unsigned long sp,
unsigned long arg,
-             struct task_struct *p, unsigned long tls)
+int copy_thread(unsigned long clone_flags, unsigned long sp,
+             unsigned long stack_size, struct task_struct *p,
+             unsigned long tls)
  {
       struct inactive_task_frame *frame;
       struct fork_frame *fork_frame;
@@ -175,7 +176,7 @@ int copy_thread(unsigned long clone_flags,
unsigned long sp, unsigned long arg,
       if (unlikely(p->flags & PF_KTHREAD)) {
               p->thread.pkru = pkru_get_init_value();
               memset(childregs, 0, sizeof(struct pt_regs));
-             kthread_frame_init(frame, sp, arg);
+             kthread_frame_init(frame, sp, stack_size);
               return 0;
       }
  
@@ -208,7 +209,7 @@ int copy_thread(unsigned long clone_flags,
unsigned long sp, unsigned long arg,
                */
               childregs->sp = 0;
               childregs->ip = 0;
-             kthread_frame_init(frame, sp, arg);
+             kthread_frame_init(frame, sp, stack_size);
               return 0;
       }
Can you please change the prototypes too for completeness sake?
In the header it's:
extern int copy_thread(unsigned long, unsigned long, unsigned long,
		       struct task_struct *, unsigned long);

And the various arch implementations call the stack size: arg,
kthread_arg, stk_sz, etc.

Adding names to the prototype would conflict with the some arch's names
unless they were all unified. Is it a worthwhile refactor?

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help