diff options
author | Benjamin Berg <benjamin.berg@intel.com> | 2024-11-11 11:29:10 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-11-12 14:50:31 +0100 |
commit | 2f681ba4b352cdd5658ed2a96062375a12839755 (patch) | |
tree | 8cc0179eb7c009f8c155acee180270918b93af23 /arch/um/kernel/process.c | |
parent | 0f659ff362eac69777c4c191b7e5ccb19d76c67d (diff) |
um: move thread info into task
This selects the THREAD_INFO_IN_TASK option for UM and changes the way
that the current task is discovered. This is trivial though, as UML
already tracks the current task in cpu_tasks[] and this can be used to
retrieve it.
Also remove the signal handler code that copies the thread information
into the IRQ stack. It is obsolete now, which also means that the
mentioned race condition cannot happen anymore.
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Hajime Tazaki <thehajime@gmail.com>
Link: https://patch.msgid.link/20241111102910.46512-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/kernel/process.c')
-rw-r--r-- | arch/um/kernel/process.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 56e7e525fc91..30bdc0a87dc8 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -43,7 +43,8 @@ * 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] = { NULL } }; +struct task_struct *cpu_tasks[NR_CPUS]; +EXPORT_SYMBOL(cpu_tasks); void free_stack(unsigned long stack, int order) { @@ -64,7 +65,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) { task }); + cpu_tasks[task_thread_info(task)->cpu] = task; } struct task_struct *__switch_to(struct task_struct *from, struct task_struct *to) |