public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/fair: avoid redundant hrtimer check
@ 2022-06-06 12:26 Huichun Feng
  2022-06-09 12:29 ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: Huichun Feng @ 2022-06-06 12:26 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, Valentin Schneider,
	open list:SCHEDULER, jserv, Chin-En Lin

The check is required iff HRTICK is enabled and DOUBLE_TICK is disabled,
avoid the redundant check by adding corresponding sched_feat() .

Signed-off-by: Huichun Feng <foxhoundsk.tw@gmail.com>
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 77b2048a9..80cc1a924 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4668,7 +4668,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued)
 	/*
 	 * don't let the period tick interfere with the hrtick preemption
 	 */
-	if (!sched_feat(DOUBLE_TICK) &&
+	if (sched_feat(HRTICK) && !sched_feat(DOUBLE_TICK) &&
 			hrtimer_active(&rq_of(cfs_rq)->hrtick_timer))
 		return;
 #endif
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sched/fair: avoid redundant hrtimer check
  2022-06-06 12:26 [PATCH] sched/fair: avoid redundant hrtimer check Huichun Feng
@ 2022-06-09 12:29 ` Peter Zijlstra
  2022-06-09 13:23   ` Huichun Feng
  2022-06-18 17:54   ` [PATCH v2] " Huichun Feng
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Zijlstra @ 2022-06-09 12:29 UTC (permalink / raw)
  To: Huichun Feng
  Cc: Ingo Molnar, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, Valentin Schneider,
	open list:SCHEDULER, jserv, Chin-En Lin

On Mon, Jun 06, 2022 at 08:26:12PM +0800, Huichun Feng wrote:
> The check is required iff HRTICK is enabled and DOUBLE_TICK is disabled,
> avoid the redundant check by adding corresponding sched_feat() .

How about: 'don't do that then'?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sched/fair: avoid redundant hrtimer check
  2022-06-09 12:29 ` Peter Zijlstra
@ 2022-06-09 13:23   ` Huichun Feng
  2022-06-18 17:54   ` [PATCH v2] " Huichun Feng
  1 sibling, 0 replies; 4+ messages in thread
From: Huichun Feng @ 2022-06-09 13:23 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, Valentin Schneider,
	open list:SCHEDULER, Ching-Chun Huang, Chin-En Lin

Peter Zijlstra <peterz@infradead.org> 於 2022年6月9日 週四 下午8:29寫道:
>
> On Mon, Jun 06, 2022 at 08:26:12PM +0800, Huichun Feng wrote:
> > The check is required iff HRTICK is enabled and DOUBLE_TICK is disabled,
> > avoid the redundant check by adding corresponding sched_feat() .
>
> How about: 'don't do that then'?

Looks good!

Should I send a v2 for this? Or could you help amend it directly?

Thank you!
Huichun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] sched/fair: avoid redundant hrtimer check
  2022-06-09 12:29 ` Peter Zijlstra
  2022-06-09 13:23   ` Huichun Feng
@ 2022-06-18 17:54   ` Huichun Feng
  1 sibling, 0 replies; 4+ messages in thread
From: Huichun Feng @ 2022-06-18 17:54 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, Valentin Schneider,
	open list:SCHEDULER, jserv, Chin-En Lin

The check is required iff HRTICK is enabled and DOUBLE_TICK is disabled,
don't do that then.

Signed-off-by: Huichun Feng <foxhoundsk.tw@gmail.com>
---

Changes since v1:
- Refine commit message

 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 77b2048a9..80cc1a924 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4668,7 +4668,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued)
        /*
         * don't let the period tick interfere with the hrtick preemption
         */
-       if (!sched_feat(DOUBLE_TICK) &&
+       if (sched_feat(HRTICK) && !sched_feat(DOUBLE_TICK) &&
                        hrtimer_active(&rq_of(cfs_rq)->hrtick_timer))
                return;
 #endif
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-18 17:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-06 12:26 [PATCH] sched/fair: avoid redundant hrtimer check Huichun Feng
2022-06-09 12:29 ` Peter Zijlstra
2022-06-09 13:23   ` Huichun Feng
2022-06-18 17:54   ` [PATCH v2] " Huichun Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox