Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched: Move MM CID related functions to sched.h

There is nothing mm specific in that and including mm.h can cause header
recursion hell.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20251027084306.778457951@linutronix.de

authored by

Thomas Gleixner and committed by
Ingo Molnar
4fc9225d 7702a9c2

+26 -25
-25
include/linux/mm.h
··· 2401 2401 /* Set in unmap_vmas() to indicate a final unmap call. Only used by hugetlb */ 2402 2402 #define ZAP_FLAG_UNMAP ((__force zap_flags_t) BIT(1)) 2403 2403 2404 - #ifdef CONFIG_SCHED_MM_CID 2405 - void sched_mm_cid_before_execve(struct task_struct *t); 2406 - void sched_mm_cid_after_execve(struct task_struct *t); 2407 - void sched_mm_cid_fork(struct task_struct *t); 2408 - void sched_mm_cid_exit_signals(struct task_struct *t); 2409 - static inline int task_mm_cid(struct task_struct *t) 2410 - { 2411 - return t->mm_cid; 2412 - } 2413 - #else 2414 - static inline void sched_mm_cid_before_execve(struct task_struct *t) { } 2415 - static inline void sched_mm_cid_after_execve(struct task_struct *t) { } 2416 - static inline void sched_mm_cid_fork(struct task_struct *t) { } 2417 - static inline void sched_mm_cid_exit_signals(struct task_struct *t) { } 2418 - static inline int task_mm_cid(struct task_struct *t) 2419 - { 2420 - /* 2421 - * Use the processor id as a fall-back when the mm cid feature is 2422 - * disabled. This provides functional per-cpu data structure accesses 2423 - * in user-space, althrough it won't provide the memory usage benefits. 2424 - */ 2425 - return raw_smp_processor_id(); 2426 - } 2427 - #endif 2428 - 2429 2404 #ifdef CONFIG_MMU 2430 2405 extern bool can_do_mlock(void); 2431 2406 #else
+26
include/linux/sched.h
··· 2310 2310 #define alloc_tag_restore(_tag, _old) do {} while (0) 2311 2311 #endif 2312 2312 2313 + /* Avoids recursive inclusion hell */ 2314 + #ifdef CONFIG_SCHED_MM_CID 2315 + void sched_mm_cid_before_execve(struct task_struct *t); 2316 + void sched_mm_cid_after_execve(struct task_struct *t); 2317 + void sched_mm_cid_fork(struct task_struct *t); 2318 + void sched_mm_cid_exit_signals(struct task_struct *t); 2319 + static inline int task_mm_cid(struct task_struct *t) 2320 + { 2321 + return t->mm_cid; 2322 + } 2323 + #else 2324 + static inline void sched_mm_cid_before_execve(struct task_struct *t) { } 2325 + static inline void sched_mm_cid_after_execve(struct task_struct *t) { } 2326 + static inline void sched_mm_cid_fork(struct task_struct *t) { } 2327 + static inline void sched_mm_cid_exit_signals(struct task_struct *t) { } 2328 + static inline int task_mm_cid(struct task_struct *t) 2329 + { 2330 + /* 2331 + * Use the processor id as a fall-back when the mm cid feature is 2332 + * disabled. This provides functional per-cpu data structure accesses 2333 + * in user-space, althrough it won't provide the memory usage benefits. 2334 + */ 2335 + return task_cpu(t); 2336 + } 2337 + #endif 2338 + 2313 2339 #ifndef MODULE 2314 2340 #ifndef COMPILE_OFFSETS 2315 2341