Skip to content

Commit f95bab8

Browse files
btw616richardweinberger
authored andcommitted
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: Tiwei Bie <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent dac847a commit f95bab8

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

arch/um/include/shared/as-layout.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <sysdep/ptrace.h>
3232

3333
struct cpu_task {
34-
int pid;
3534
void *task;
3635
};
3736

arch/um/kernel/process.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,7 @@
4343
* cares about its entry, so it's OK if another processor is modifying its
4444
* entry.
4545
*/
46-
struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } };
47-
48-
static inline int external_pid(void)
49-
{
50-
/* FIXME: Need to look up userspace_pid by cpu */
51-
return userspace_pid[0];
52-
}
46+
struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { NULL } };
5347

5448
void free_stack(unsigned long stack, int order)
5549
{
@@ -70,8 +64,7 @@ unsigned long alloc_stack(int order, int atomic)
7064

7165
static inline void set_current(struct task_struct *task)
7266
{
73-
cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task)
74-
{ external_pid(), task });
67+
cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task) { task });
7568
}
7669

7770
struct task_struct *__switch_to(struct task_struct *from, struct task_struct *to)
@@ -206,7 +199,6 @@ void um_idle_sleep(void)
206199

207200
void arch_cpu_idle(void)
208201
{
209-
cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
210202
um_idle_sleep();
211203
}
212204

arch/um/kernel/skas/process.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ extern void start_kernel(void);
1818

1919
static int __init start_kernel_proc(void *unused)
2020
{
21-
int pid;
22-
2321
block_signals_trace();
24-
pid = os_getpid();
2522

26-
cpu_tasks[0].pid = pid;
2723
cpu_tasks[0].task = current;
2824

2925
start_kernel();

0 commit comments

Comments
 (0)