Empty function in rt.c/deadline.c in Linux Kernel -
i studying real time scheduling algorithms within linux kernel , saw there many function calls literally nil defined in them:
(on kernel 3.15) instance:
rt.c 1392 : dequeue_pushable_task(rq, p); rt.c 365 : static inline void dequeue_pushable_task(struct rq *rq, struct task_struct *p) { } rt.c 1394 : set_post_schedule(rq); rt.c 365 : static inline void set_post_schedule(struct rq *rq) { }
they redefined in ifdef checks smp. wanted sure, these functions specific smp? or there reason having empty functions.
as per comment @ sched/deadline: add together sched_deadline smp-related info structures & logic 1baca4ce16b8cc7d4f50be1f7914799af30a2861 commit.
these methods keeping deadline tasks in cpu specific run queues , concept of pushable or pullable deadline task requires multiple cpu run queues force , pull tasks between. if config_smp isn't set there 1 cpu run queue , hence there no migration of tasks required.
so yes function implementation specific smp , reason have empty functions in order have code compile nil when config_smp isn't defined instead of having implement more ifdef checks @ each calling site.
c linux linux-kernel real-time sched-deadline
No comments:
Post a Comment