Commit f95bab86 authored by Tiwei Bie's avatar Tiwei Bie Committed by Richard Weinberger

um: Stop tracking host PID in cpu_tasks

The host PID tracked in 'cpu_tasks' is no longer used. Stopping
tracking it will also save some cycles.
Signed-off-by: default avatarTiwei Bie <tiwei.btw@antgroup.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent dac847ae
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <sysdep/ptrace.h> #include <sysdep/ptrace.h>
struct cpu_task { struct cpu_task {
int pid;
void *task; void *task;
}; };
......
...@@ -43,13 +43,7 @@ ...@@ -43,13 +43,7 @@
* cares about its entry, so it's OK if another processor is modifying its * cares about its entry, so it's OK if another processor is modifying its
* entry. * entry.
*/ */
struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } }; struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { NULL } };
static inline int external_pid(void)
{
/* FIXME: Need to look up userspace_pid by cpu */
return userspace_pid[0];
}
void free_stack(unsigned long stack, int order) void free_stack(unsigned long stack, int order)
{ {
...@@ -70,8 +64,7 @@ unsigned long alloc_stack(int order, int atomic) ...@@ -70,8 +64,7 @@ unsigned long alloc_stack(int order, int atomic)
static inline void set_current(struct task_struct *task) static inline void set_current(struct task_struct *task)
{ {
cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task) cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task) { task });
{ external_pid(), task });
} }
struct task_struct *__switch_to(struct task_struct *from, struct task_struct *to) struct task_struct *__switch_to(struct task_struct *from, struct task_struct *to)
...@@ -206,7 +199,6 @@ void um_idle_sleep(void) ...@@ -206,7 +199,6 @@ void um_idle_sleep(void)
void arch_cpu_idle(void) void arch_cpu_idle(void)
{ {
cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
um_idle_sleep(); um_idle_sleep();
} }
......
...@@ -18,12 +18,8 @@ extern void start_kernel(void); ...@@ -18,12 +18,8 @@ extern void start_kernel(void);
static int __init start_kernel_proc(void *unused) static int __init start_kernel_proc(void *unused)
{ {
int pid;
block_signals_trace(); block_signals_trace();
pid = os_getpid();
cpu_tasks[0].pid = pid;
cpu_tasks[0].task = current; cpu_tasks[0].task = current;
start_kernel(); start_kernel();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment