diff options
| author | Tiwei Bie <tiwei.btw@antgroup.com> | 2025-07-11 14:50:21 +0800 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2025-07-13 19:42:49 +0200 |
| commit | f7e9077a1649877d4b33ce91d58711d393a63c1b (patch) | |
| tree | 792e1b7cd7bb2c70979090c1aaacf9a853c81230 /arch/um/include | |
| parent | b3fb0eb5c28766e3768f9f5b2968d33da00c4cea (diff) | |
| download | lwn-f7e9077a1649877d4b33ce91d58711d393a63c1b.tar.gz lwn-f7e9077a1649877d4b33ce91d58711d393a63c1b.zip | |
um: Stop tracking stub's PID via userspace_pid[]
The PID of the stub process can be obtained from current_mm_id().
There is no need to track it via userspace_pid[]. Stop doing that
to simplify the code.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20250711065021.2535362-4-tiwei.bie@linux.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/include')
| -rw-r--r-- | arch/um/include/asm/mmu_context.h | 9 | ||||
| -rw-r--r-- | arch/um/include/shared/skas/mm_id.h | 2 | ||||
| -rw-r--r-- | arch/um/include/shared/skas/skas.h | 1 |
3 files changed, 1 insertions, 11 deletions
diff --git a/arch/um/include/asm/mmu_context.h b/arch/um/include/asm/mmu_context.h index 23dcc914d44e..0bbb24868557 100644 --- a/arch/um/include/asm/mmu_context.h +++ b/arch/um/include/asm/mmu_context.h @@ -16,11 +16,6 @@ #define activate_mm activate_mm static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) { - /* - * This is called by fs/exec.c and sys_unshare() - * when the new ->mm is used for the first time. - */ - __switch_mm(&new->context.id); } static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, @@ -28,11 +23,9 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, { unsigned cpu = smp_processor_id(); - if(prev != next){ + if (prev != next) { cpumask_clear_cpu(cpu, mm_cpumask(prev)); cpumask_set_cpu(cpu, mm_cpumask(next)); - if(next != &init_mm) - __switch_mm(&next->context.id); } } diff --git a/arch/um/include/shared/skas/mm_id.h b/arch/um/include/shared/skas/mm_id.h index 89df9a55fbea..4f977ef5dda5 100644 --- a/arch/um/include/shared/skas/mm_id.h +++ b/arch/um/include/shared/skas/mm_id.h @@ -19,8 +19,6 @@ struct mm_id { int syscall_fd_map[STUB_MAX_FDS]; }; -void __switch_mm(struct mm_id *mm_idp); - void notify_mm_kill(int pid); #endif diff --git a/arch/um/include/shared/skas/skas.h b/arch/um/include/shared/skas/skas.h index 7d1de4cab551..807514e10538 100644 --- a/arch/um/include/shared/skas/skas.h +++ b/arch/um/include/shared/skas/skas.h @@ -9,7 +9,6 @@ #include <sysdep/ptrace.h> extern int using_seccomp; -extern int userspace_pid[]; extern void new_thread_handler(void); extern void handle_syscall(struct uml_pt_regs *regs); |
