sched: move process ID from kernel to TLS for faster access

Add pid field to task_info_s and move getpid() implementation to user
space TLS access. Remove getpid from syscall interface as it now returns
cached PID from thread local storage instead of kernel lookup.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5
2026-01-20 22:33:45 +08:00
committed by Xiang Xiao
parent 0f7c992cea
commit 8bb6758490
8 changed files with 64 additions and 26 deletions
+1
View File
@@ -149,6 +149,7 @@ struct task_info_s
#ifdef CONFIG_PTHREAD_ATFORK
struct list_node ta_atfork; /* Holds the pthread_atfork_s list */
#endif
pid_t ta_pid; /* Process ID */
};
/* struct tls_cleanup_s *****************************************************/
-1
View File
@@ -28,7 +28,6 @@
SYSCALL_LOOKUP1(_exit, 1)
SYSCALL_LOOKUP(_assert, 4)
SYSCALL_LOOKUP(getpid, 0)
SYSCALL_LOOKUP(prctl, 2)
#ifdef CONFIG_SCHED_HAVE_PARENT