um: Stop tracking host PID in cpu_tasks
authorTiwei Bie <tiwei.btw@antgroup.com>
Wed, 6 Mar 2024 10:19:22 +0000 (18:19 +0800)
committerRichard Weinberger <richard@nod.at>
Tue, 30 Apr 2024 12:11:30 +0000 (14:11 +0200)
The host PID tracked in 'cpu_tasks' is no longer used. Stopping
tracking it will also save some cycles.

Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/include/shared/as-layout.h
arch/um/kernel/process.c
arch/um/kernel/skas/process.c

index 9ec3015bc5e2e2c74dfcf7f615bcd37c4cc5e47b..c22f46a757dcffccaf032f29b3178dfe9f8c703d 100644 (file)
@@ -31,7 +31,6 @@
 #include <sysdep/ptrace.h>
 
 struct cpu_task {
-       int pid;
        void *task;
 };
 
index e5d7d24045a23eae89ad5b8534b7b824c546e94e..d2134802f6a83c37ebd5b85ca4b51ed6ac639085 100644 (file)
  * cares about its entry, so it's OK if another processor is modifying its
  * entry.
  */
-struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } };
-
-static inline int external_pid(void)
-{
-       /* FIXME: Need to look up userspace_pid by cpu */
-       return userspace_pid[0];
-}
+struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { NULL } };
 
 void free_stack(unsigned long stack, int order)
 {
@@ -70,8 +64,7 @@ unsigned long alloc_stack(int order, int atomic)
 
 static inline void set_current(struct task_struct *task)
 {
-       cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task)
-               { external_pid(), task });
+       cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task) { task });
 }
 
 struct task_struct *__switch_to(struct task_struct *from, struct task_struct *to)
@@ -206,7 +199,6 @@ void um_idle_sleep(void)
 
 void arch_cpu_idle(void)
 {
-       cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
        um_idle_sleep();
 }
 
index fdd5922f9222a6b98ccfe3217ffe259ecd9eeafb..99a5cbb36083284718d7fd6f9fef2e054cee1bb6 100644 (file)
@@ -18,12 +18,8 @@ extern void start_kernel(void);
 
 static int __init start_kernel_proc(void *unused)
 {
-       int pid;
-
        block_signals_trace();
-       pid = os_getpid();
 
-       cpu_tasks[0].pid = pid;
        cpu_tasks[0].task = current;
 
        start_kernel();