HRTICK reprogramming and optimization
Juri Lelli
maintainercover HRTICK reprogramming and optimization
Hi All,
Hung tasks and RCU stall cases were reported on systems which were not 100% busy. Investigation of such unexpected cases (no sign of potential starvation caused by tasks hogging the system) pointed out that the periodic sched tick timer wasn't serviced anymore after a certain point and that caused all machinery that depends on it (timers, RCU, etc.) to stop working as well. This issue was however only reproducible if HRTICK was enabled.
Looking at core dumps it was found that the rbtree of the hrtimer base used also for the hrtick was corrupted (i.e. next as seen from the base root and actual leftmost obtained by traversing the tree are different). Same base is also used for periodic tick hrtimer, which might get "lost" if the rbtree gets corrupted.
Much alike what is described in commit 1f71addd34f4c ("tick/sched: Do not mess with an enqueued hrtimer") there is infact a race window between hrtimer_set_expires() in hrtick_start and hrtimer_start_expires() in __hrtick_restart() in which the former might be operating on an already queued hrtick hrtimer, which might lead to corruption of the base. Patch 01/02 fixes this case.
While at it, it might be desired to avoid HRTICK overhead in cases where it is only actually used to service a specific subset of scheduling classes (currently it services both fair and deadline “at once”). Patch 02/02 proposes an optimization by making HRTICK feature selectable on a per class basis, so one can, say, enable it only to service DEADLINE and leave NORMAL task preemption points less fine grained.
Series available at
https://github.com/jlelli/linux.git sched/hrtick-fixes
Hope they both make sense. Comments, questions and suggestions are more than welcome.
Best,
Juri
Juri Lelli (2):
sched/features: Fix hrtick reprogramming sched/features: Distinguish between NORMAL and DEADLINE hrtick
kernel/sched/core.c | 10 ++++------ kernel/sched/deadline.c | 4 ++-- kernel/sched/fair.c | 4 ++-- kernel/sched/features.h | 1 + kernel/sched/sched.h | 27 +++++++++++++++++++++++++-- 5 files changed, 34 insertions(+), 12 deletions(-)
Signature · 1 line
2.29.2
Juri Lelli
maintainerPATCH 1/2 sched/features: Fix hrtick reprogramming
Hung tasks and RCU stall cases were reported on systems which were not 100% busy. Investigation of such unexpected cases (no sign of potential starvation caused by tasks hogging the system) pointed out that the periodic sched tick timer wasn't serviced anymore after a certain point and that caused all machinery that depends on it (timers, RCU, etc.) to stop working as well. This issues was however only reproducible if HRTICK was enabled.
Looking at core dumps it was found that the rbtree of the hrtimer base used also for the hrtick was corrupted (i.e. next as seen from the base root and actual leftmost obtained by traversing the tree are different). Same base is also used for periodic tick hrtimer, which might get "lost" if the rbtree gets corrupted.
Much alike what described in commit 1f71addd34f4c ("tick/sched: Do not mess with an enqueued hrtimer") there is a race window between hrtimer_set_expires() in hrtick_start and hrtimer_start_expires() in __hrtick_restart() in which the former might be operating on an already queued hrtick hrtimer, which might lead to corruption of the base.
Use hrtick_start() (which removes the timer before enqueuing it back) to ensure hrtick hrtimer reprogramming is entirely guarded by the base lock, so that no race conditions can occur.
--- kernel/sched/core.c | 8 +++----- kernel/sched/sched.h | 1 + 2 files changed, 4 insertions(+), 5 deletions(-)
kernel/sched/core.c +3 -5
@@ -355,8 +355,9 @@ static enum hrtimer_restart hrtick(struct hrtimer *timer)static void __hrtick_restart (struct rq *rq) {struct hrtimer *timer = &rq->hrtick_timer; +ktime_t time = rq->hrtick_time; -hrtimer_start_expires (timer,HRTIMER_MODE_ABS_PINNED_HARD ); +hrtimer_start (timer, time,HRTIMER_MODE_ABS_PINNED_HARD ); }/*
@@ -380,7 +381,6 @@ static void __hrtick_start(void *arg)void hrtick_start (struct rq *rq,u64 delay) {struct hrtimer *timer = &rq->hrtick_timer; -ktime_t time;s64 delta;/*
@@ -388,9 +388,7 @@ void hrtick_start(struct rq *rq, u64 delay)* doesn't make sense and can cause timer DoS. */ delta =max_t (s64, delay,10000LL ); - time =ktime_add_ns (timer->base->get_time (), delta); - -hrtimer_set_expires (timer, time); + rq->hrtick_time =ktime_add_ns (timer->base->get_time (), delta);if (rq ==this_rq ())__hrtick_restart (rq);
kernel/sched/sched.h +1 -0
@@ -1030,6 +1030,7 @@ struct rq {call_single_data_t hrtick_csd;#endif struct hrtimer hrtick_timer; +ktime_t hrtick_time;#endif #ifdef CONFIG_SCHEDSTATS
Signature · 1 line
2.29.2
[tip: sched/core] sched/features: Fix hrtick reprogramming
The following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 0abadfdf696f648ed32fa1bd16d4e0358de19bab Gitweb: https://git.kernel.org/tip/0abadfdf696f648ed32fa1bd16d4e0358de19bab Author: Juri Lelli <[email protected]> AuthorDate: Mon, 08 Feb 2021 08:35:53 +01:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Wed, 10 Feb 2021 14:44:49 +01:00
sched/features: Fix hrtick reprogramming
Hung tasks and RCU stall cases were reported on systems which were not 100% busy. Investigation of such unexpected cases (no sign of potential starvation caused by tasks hogging the system) pointed out that the periodic sched tick timer wasn't serviced anymore after a certain point and that caused all machinery that depends on it (timers, RCU, etc.) to stop working as well. This issues was however only reproducible if HRTICK was enabled.
Looking at core dumps it was found that the rbtree of the hrtimer base used also for the hrtick was corrupted (i.e. next as seen from the base root and actual leftmost obtained by traversing the tree are different). Same base is also used for periodic tick hrtimer, which might get "lost" if the rbtree gets corrupted.
Much alike what described in commit 1f71addd34f4c ("tick/sched: Do not mess with an enqueued hrtimer") there is a race window between hrtimer_set_expires() in hrtick_start and hrtimer_start_expires() in __hrtick_restart() in which the former might be operating on an already queued hrtick hrtimer, which might lead to corruption of the base.
Use hrtick_start() (which removes the timer before enqueuing it back) to ensure hrtick hrtimer reprogramming is entirely guarded by the base lock, so that no race conditions can occur.
--- kernel/sched/core.c | 8 +++----- kernel/sched/sched.h | 1 + 2 files changed, 4 insertions(+), 5 deletions(-)
kernel/sched/core.c +3 -5
@@ -355,8 +355,9 @@ static enum hrtimer_restart hrtick(struct hrtimer *timer)static void __hrtick_restart (struct rq *rq) {struct hrtimer *timer = &rq->hrtick_timer; +ktime_t time = rq->hrtick_time; -hrtimer_start_expires (timer,HRTIMER_MODE_ABS_PINNED_HARD ); +hrtimer_start (timer, time,HRTIMER_MODE_ABS_PINNED_HARD ); }/*
@@ -380,7 +381,6 @@ static void __hrtick_start(void *arg)void hrtick_start (struct rq *rq,u64 delay) {struct hrtimer *timer = &rq->hrtick_timer; -ktime_t time;s64 delta;/*
@@ -388,9 +388,7 @@ void hrtick_start(struct rq *rq, u64 delay)* doesn't make sense and can cause timer DoS. */ delta =max_t (s64, delay,10000LL ); - time =ktime_add_ns (timer->base->get_time (), delta); - -hrtimer_set_expires (timer, time); + rq->hrtick_time =ktime_add_ns (timer->base->get_time (), delta);if (rq ==this_rq ())__hrtick_restart (rq);
kernel/sched/sched.h +1 -0
@@ -1031,6 +1031,7 @@ struct rq {call_single_data_t hrtick_csd;#endif struct hrtimer hrtick_timer; +ktime_t hrtick_time;#endif #ifdef CONFIG_SCHEDSTATS
[tip: sched/core] sched/features: Fix hrtick reprogramming
In reply to Juri LelliThe following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 156ec6f42b8d300dbbf382738ff35c8bad8f4c3a Gitweb: https://git.kernel.org/tip/156ec6f42b8d300dbbf382738ff35c8bad8f4c3a Author: Juri Lelli <[email protected]> AuthorDate: Mon, 08 Feb 2021 08:35:53 +01:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Wed, 17 Feb 2021 14:12:42 +01:00
sched/features: Fix hrtick reprogramming
Hung tasks and RCU stall cases were reported on systems which were not 100% busy. Investigation of such unexpected cases (no sign of potential starvation caused by tasks hogging the system) pointed out that the periodic sched tick timer wasn't serviced anymore after a certain point and that caused all machinery that depends on it (timers, RCU, etc.) to stop working as well. This issues was however only reproducible if HRTICK was enabled.
Looking at core dumps it was found that the rbtree of the hrtimer base used also for the hrtick was corrupted (i.e. next as seen from the base root and actual leftmost obtained by traversing the tree are different). Same base is also used for periodic tick hrtimer, which might get "lost" if the rbtree gets corrupted.
Much alike what described in commit 1f71addd34f4c ("tick/sched: Do not mess with an enqueued hrtimer") there is a race window between hrtimer_set_expires() in hrtick_start and hrtimer_start_expires() in __hrtick_restart() in which the former might be operating on an already queued hrtick hrtimer, which might lead to corruption of the base.
Use hrtick_start() (which removes the timer before enqueuing it back) to ensure hrtick hrtimer reprogramming is entirely guarded by the base lock, so that no race conditions can occur.
--- kernel/sched/core.c | 8 +++----- kernel/sched/sched.h | 1 + 2 files changed, 4 insertions(+), 5 deletions(-)
kernel/sched/core.c +3 -5
@@ -355,8 +355,9 @@ static enum hrtimer_restart hrtick(struct hrtimer *timer)static void __hrtick_restart (struct rq *rq) {struct hrtimer *timer = &rq->hrtick_timer; +ktime_t time = rq->hrtick_time; -hrtimer_start_expires (timer,HRTIMER_MODE_ABS_PINNED_HARD ); +hrtimer_start (timer, time,HRTIMER_MODE_ABS_PINNED_HARD ); }/*
@@ -380,7 +381,6 @@ static void __hrtick_start(void *arg)void hrtick_start (struct rq *rq,u64 delay) {struct hrtimer *timer = &rq->hrtick_timer; -ktime_t time;s64 delta;/*
@@ -388,9 +388,7 @@ void hrtick_start(struct rq *rq, u64 delay)* doesn't make sense and can cause timer DoS. */ delta =max_t (s64, delay,10000LL ); - time =ktime_add_ns (timer->base->get_time (), delta); - -hrtimer_set_expires (timer, time); + rq->hrtick_time =ktime_add_ns (timer->base->get_time (), delta);if (rq ==this_rq ())__hrtick_restart (rq);
kernel/sched/sched.h +1 -0
@@ -1031,6 +1031,7 @@ struct rq {call_single_data_t hrtick_csd;#endif struct hrtimer hrtick_timer; +ktime_t hrtick_time;#endif #ifdef CONFIG_SCHEDSTATS
Juri Lelli
maintainerPATCH 2/2 sched/features: Distinguish between NORMAL and DEADLINE hrtick
In reply to Juri LelliThe HRTICK feature has traditionally been servicing configurations that need precise preemptions point for NORMAL tasks. More recently, the feature has been extended to also service DEADLINE tasks with stringent runtime enforcement needs (e.g., runtime < 1ms with HZ=1000).
Enabling HRTICK sched feature currently enables the additional timer and task tick for both classes, which might introduced undesired overhead for no additional benefit if one needed it only for one of the cases.
Separate HRTICK sched feature in two (and leave the traditional case name unmodified) so that it can be selectively enabled when needed.
With
$ echo HRTICK > /sys/kernel/debug/sched_features
the NORMAL/fair hrtick gets enabled.
With
$ echo HRTICK_DL > /sys/kernel/debug/sched_features
the DEADLINE hrtick gets enabled.
--- kernel/sched/core.c | 2 +- kernel/sched/deadline.c | 4 ++-- kernel/sched/fair.c | 4 ++-- kernel/sched/features.h | 1 + kernel/sched/sched.h | 26 ++++++++++++++++++++++++-- 5 files changed, 30 insertions(+), 7 deletions(-)
kernel/sched/core.c +1 -1
@@ -4955,7 +4955,7 @@ static void __sched notrace __schedule(bool preempt)schedule_debug (prev, preempt); -if (sched_feat (HRTICK )) +if (sched_feat (HRTICK ) ||sched_feat (HRTICK_DL ))hrtick_clear (rq);local_irq_disable ();
kernel/sched/deadline.c +2 -2
@@ -1832,7 +1832,7 @@ static void set_next_task_dl(struct rq *rq, struct task_struct *p, bool first)if (!first)return ; -if (hrtick_enabled (rq)) +if (hrtick_enabled_dl (rq))start_hrtick_dl (rq, p);if (rq->curr->sched_class != &dl_sched_class)
@@ -1895,7 +1895,7 @@ static void task_tick_dl(struct rq *rq, struct task_struct *p, int queued)* not being the leftmost task anymore. In that case NEED_RESCHED will * be set and schedule() will start a new hrtick for the next task. */ -if (hrtick_enabled (rq) && queued && p->dl.runtime >0 && +if (hrtick_enabled_dl (rq) && queued && p->dl.runtime >0 &&is_leftmost (p, &rq->dl))start_hrtick_dl (rq, p); }
kernel/sched/fair.c +2 -2
@@ -5429,7 +5429,7 @@ static void hrtick_update(struct rq *rq) {struct task_struct *curr = rq->curr; -if (!hrtick_enabled (rq) || curr->sched_class != &fair_sched_class) +if (!hrtick_enabled_fair (rq) || curr->sched_class != &fair_sched_class)return ;if (cfs_rq_of (&curr->se)->nr_running < sched_nr_latency)
@@ -7116,7 +7116,7 @@ done: __maybe_unused;list_move (&p->se.group_node, &rq->cfs_tasks);#endif -if (hrtick_enabled (rq)) +if (hrtick_enabled_fair (rq))hrtick_start_fair (rq, p);update_misfit_status (p, rq);
kernel/sched/features.h +1 -0
@@ -38,6 +38,7 @@ SCHED_FEAT(CACHE_HOT_BUDDY, true) SCHED_FEAT(WAKEUP_PREEMPTION, true) SCHED_FEAT(HRTICK, false) +SCHED_FEAT(HRTICK_DL, false)SCHED_FEAT (DOUBLE_TICK , false)/*
kernel/sched/sched.h +24 -2
@@ -2104,17 +2104,39 @@ extern const_debug unsigned int sysctl_sched_migration_cost;*/ static inline int hrtick_enabled (struct rq *rq) { -if (!sched_feat (HRTICK )) -return 0 ;if (!cpu_active (cpu_of (rq)))return 0 ;return hrtimer_is_hres_active (&rq->hrtick_timer); } +static inline int hrtick_enabled_fair (struct rq *rq) +{ +if (!sched_feat (HRTICK )) +return 0 ; +return hrtick_enabled (rq); +} + +static inline int hrtick_enabled_dl (struct rq *rq) +{ +if (!sched_feat (HRTICK_DL )) +return 0 ; +return hrtick_enabled (rq); +} +void hrtick_start (struct rq *rq,u64 delay);#else +static inline int hrtick_enabled_fair (struct rq *rq) +{ +return 0 ; +} + +static inline int hrtick_enabled_dl (struct rq *rq) +{ +return 0 ; +} +static inline int hrtick_enabled (struct rq *rq) {return 0 ;
Signature · 1 line
2.29.2
[tip: sched/core] sched/features: Distinguish between NORMAL and DEADLINE hrtick
The following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: f2ebf3f45f7a68b67d456296e5efbb58577fb771 Gitweb: https://git.kernel.org/tip/f2ebf3f45f7a68b67d456296e5efbb58577fb771 Author: Juri Lelli <[email protected]> AuthorDate: Mon, 08 Feb 2021 08:35:54 +01:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Wed, 10 Feb 2021 14:44:49 +01:00
sched/features: Distinguish between NORMAL and DEADLINE hrtick
The HRTICK feature has traditionally been servicing configurations that need precise preemptions point for NORMAL tasks. More recently, the feature has been extended to also service DEADLINE tasks with stringent runtime enforcement needs (e.g., runtime < 1ms with HZ=1000).
Enabling HRTICK sched feature currently enables the additional timer and task tick for both classes, which might introduced undesired overhead for no additional benefit if one needed it only for one of the cases.
Separate HRTICK sched feature in two (and leave the traditional case name unmodified) so that it can be selectively enabled when needed.
With
$ echo HRTICK > /sys/kernel/debug/sched_features
the NORMAL/fair hrtick gets enabled.
With
$ echo HRTICK_DL > /sys/kernel/debug/sched_features
the DEADLINE hrtick gets enabled.
--- kernel/sched/core.c | 2 +- kernel/sched/deadline.c | 4 ++-- kernel/sched/fair.c | 4 ++-- kernel/sched/features.h | 1 + kernel/sched/sched.h | 26 ++++++++++++++++++++++++-- 5 files changed, 30 insertions(+), 7 deletions(-)
kernel/sched/core.c +1 -1
@@ -4969,7 +4969,7 @@ static void __sched notrace __schedule(bool preempt)schedule_debug (prev, preempt); -if (sched_feat (HRTICK )) +if (sched_feat (HRTICK ) ||sched_feat (HRTICK_DL ))hrtick_clear (rq);local_irq_disable ();
kernel/sched/deadline.c +2 -2
@@ -1832,7 +1832,7 @@ static void set_next_task_dl(struct rq *rq, struct task_struct *p, bool first)if (!first)return ; -if (hrtick_enabled (rq)) +if (hrtick_enabled_dl (rq))start_hrtick_dl (rq, p);if (rq->curr->sched_class != &dl_sched_class)
@@ -1895,7 +1895,7 @@ static void task_tick_dl(struct rq *rq, struct task_struct *p, int queued)* not being the leftmost task anymore. In that case NEED_RESCHED will * be set and schedule() will start a new hrtick for the next task. */ -if (hrtick_enabled (rq) && queued && p->dl.runtime >0 && +if (hrtick_enabled_dl (rq) && queued && p->dl.runtime >0 &&is_leftmost (p, &rq->dl))start_hrtick_dl (rq, p); }
kernel/sched/fair.c +2 -2
@@ -5429,7 +5429,7 @@ static void hrtick_update(struct rq *rq) {struct task_struct *curr = rq->curr; -if (!hrtick_enabled (rq) || curr->sched_class != &fair_sched_class) +if (!hrtick_enabled_fair (rq) || curr->sched_class != &fair_sched_class)return ;if (cfs_rq_of (&curr->se)->nr_running < sched_nr_latency)
@@ -7116,7 +7116,7 @@ done: __maybe_unused;list_move (&p->se.group_node, &rq->cfs_tasks);#endif -if (hrtick_enabled (rq)) +if (hrtick_enabled_fair (rq))hrtick_start_fair (rq, p);update_misfit_status (p, rq);
kernel/sched/features.h +1 -0
@@ -38,6 +38,7 @@ SCHED_FEAT(CACHE_HOT_BUDDY, true) SCHED_FEAT(WAKEUP_PREEMPTION, true) SCHED_FEAT(HRTICK, false) +SCHED_FEAT(HRTICK_DL, false)SCHED_FEAT (DOUBLE_TICK , false)/*
kernel/sched/sched.h +24 -2
@@ -2105,17 +2105,39 @@ extern const_debug unsigned int sysctl_sched_migration_cost;*/ static inline int hrtick_enabled (struct rq *rq) { -if (!sched_feat (HRTICK )) -return 0 ;if (!cpu_active (cpu_of (rq)))return 0 ;return hrtimer_is_hres_active (&rq->hrtick_timer); } +static inline int hrtick_enabled_fair (struct rq *rq) +{ +if (!sched_feat (HRTICK )) +return 0 ; +return hrtick_enabled (rq); +} + +static inline int hrtick_enabled_dl (struct rq *rq) +{ +if (!sched_feat (HRTICK_DL )) +return 0 ; +return hrtick_enabled (rq); +} +void hrtick_start (struct rq *rq,u64 delay);#else +static inline int hrtick_enabled_fair (struct rq *rq) +{ +return 0 ; +} + +static inline int hrtick_enabled_dl (struct rq *rq) +{ +return 0 ; +} +static inline int hrtick_enabled (struct rq *rq) {return 0 ;
[tip: sched/core] sched/features: Distinguish between NORMAL and DEADLINE hrtick
In reply to Juri LelliThe following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: e0ee463c93c43b1657ad69cf2678ff5bf1b754fe Gitweb: https://git.kernel.org/tip/e0ee463c93c43b1657ad69cf2678ff5bf1b754fe Author: Juri Lelli <[email protected]> AuthorDate: Mon, 08 Feb 2021 08:35:54 +01:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Wed, 17 Feb 2021 14:12:42 +01:00
sched/features: Distinguish between NORMAL and DEADLINE hrtick
The HRTICK feature has traditionally been servicing configurations that need precise preemptions point for NORMAL tasks. More recently, the feature has been extended to also service DEADLINE tasks with stringent runtime enforcement needs (e.g., runtime < 1ms with HZ=1000).
Enabling HRTICK sched feature currently enables the additional timer and task tick for both classes, which might introduced undesired overhead for no additional benefit if one needed it only for one of the cases.
Separate HRTICK sched feature in two (and leave the traditional case name unmodified) so that it can be selectively enabled when needed.
With:
$ echo HRTICK > /sys/kernel/debug/sched_features
the NORMAL/fair hrtick gets enabled.
With:
$ echo HRTICK_DL > /sys/kernel/debug/sched_features
the DEADLINE hrtick gets enabled.
--- kernel/sched/core.c | 2 +- kernel/sched/deadline.c | 4 ++-- kernel/sched/fair.c | 4 ++-- kernel/sched/features.h | 1 + kernel/sched/sched.h | 26 ++++++++++++++++++++++++-- 5 files changed, 30 insertions(+), 7 deletions(-)
kernel/sched/core.c +1 -1
@@ -4969,7 +4969,7 @@ static void __sched notrace __schedule(bool preempt)schedule_debug (prev, preempt); -if (sched_feat (HRTICK )) +if (sched_feat (HRTICK ) ||sched_feat (HRTICK_DL ))hrtick_clear (rq);local_irq_disable ();
kernel/sched/deadline.c +2 -2
@@ -1832,7 +1832,7 @@ static void set_next_task_dl(struct rq *rq, struct task_struct *p, bool first)if (!first)return ; -if (hrtick_enabled (rq)) +if (hrtick_enabled_dl (rq))start_hrtick_dl (rq, p);if (rq->curr->sched_class != &dl_sched_class)
@@ -1895,7 +1895,7 @@ static void task_tick_dl(struct rq *rq, struct task_struct *p, int queued)* not being the leftmost task anymore. In that case NEED_RESCHED will * be set and schedule() will start a new hrtick for the next task. */ -if (hrtick_enabled (rq) && queued && p->dl.runtime >0 && +if (hrtick_enabled_dl (rq) && queued && p->dl.runtime >0 &&is_leftmost (p, &rq->dl))start_hrtick_dl (rq, p); }
kernel/sched/fair.c +2 -2
@@ -5429,7 +5429,7 @@ static void hrtick_update(struct rq *rq) {struct task_struct *curr = rq->curr; -if (!hrtick_enabled (rq) || curr->sched_class != &fair_sched_class) +if (!hrtick_enabled_fair (rq) || curr->sched_class != &fair_sched_class)return ;if (cfs_rq_of (&curr->se)->nr_running < sched_nr_latency)
@@ -7116,7 +7116,7 @@ done: __maybe_unused;list_move (&p->se.group_node, &rq->cfs_tasks);#endif -if (hrtick_enabled (rq)) +if (hrtick_enabled_fair (rq))hrtick_start_fair (rq, p);update_misfit_status (p, rq);
kernel/sched/features.h +1 -0
@@ -38,6 +38,7 @@ SCHED_FEAT(CACHE_HOT_BUDDY, true) SCHED_FEAT(WAKEUP_PREEMPTION, true) SCHED_FEAT(HRTICK, false) +SCHED_FEAT(HRTICK_DL, false)SCHED_FEAT (DOUBLE_TICK , false)/*
kernel/sched/sched.h +24 -2
@@ -2105,17 +2105,39 @@ extern const_debug unsigned int sysctl_sched_migration_cost;*/ static inline int hrtick_enabled (struct rq *rq) { -if (!sched_feat (HRTICK )) -return 0 ;if (!cpu_active (cpu_of (rq)))return 0 ;return hrtimer_is_hres_active (&rq->hrtick_timer); } +static inline int hrtick_enabled_fair (struct rq *rq) +{ +if (!sched_feat (HRTICK )) +return 0 ; +return hrtick_enabled (rq); +} + +static inline int hrtick_enabled_dl (struct rq *rq) +{ +if (!sched_feat (HRTICK_DL )) +return 0 ; +return hrtick_enabled (rq); +} +void hrtick_start (struct rq *rq,u64 delay);#else +static inline int hrtick_enabled_fair (struct rq *rq) +{ +return 0 ; +} + +static inline int hrtick_enabled_dl (struct rq *rq) +{ +return 0 ; +} +static inline int hrtick_enabled (struct rq *rq) {return 0 ;
Peter Zijlstra
maintainerQuoted 3 lines · Juri Lelli
Juri Lelli (2):
sched/features: Fix hrtick reprogramming sched/features: Distinguish between NORMAL and DEADLINE hrtick
Thanks!