public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove CONFIG_SCHED_HRTICK
@ 2013-11-23 14:36 Christoph Hellwig
  2013-11-26 11:57 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2013-11-23 14:36 UTC (permalink / raw)
  To: Ingo Molnar, Russell King; +Cc: linux-kernel

It's equivalent to CONFIG_HIGH_RES_TIMERS now that all architectures
use the generic helpers it relies on.
    
Signed-off-by: Christoph Hellwig <hch@lst.de>

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a671b58..c4d0371 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1655,12 +1655,6 @@ config HZ
 	default 500 if HZ_500
 	default 1000
 
-config SCHED_HRTICK
-	def_bool HIGH_RES_TIMERS
-
-config SCHED_HRTICK
-	def_bool HIGH_RES_TIMERS
-
 config THUMB2_KERNEL
 	bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY
 	depends on (CPU_V7 || CPU_V7M) && !CPU_V6 && !CPU_V6K
diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz
index 2a202a8..af81343 100644
--- a/kernel/Kconfig.hz
+++ b/kernel/Kconfig.hz
@@ -53,6 +53,3 @@ config HZ
 	default 250 if HZ_250
 	default 300 if HZ_300
 	default 1000 if HZ_1000
-
-config SCHED_HRTICK
-	def_bool HIGH_RES_TIMERS
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5ac63c9..2ebc66c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -367,7 +367,7 @@ static struct rq *this_rq_lock(void)
 	return rq;
 }
 
-#ifdef CONFIG_SCHED_HRTICK
+#ifdef CONFIG_HIGH_RES_TIMERS
 /*
  * Use HR-timers to deliver accurate preemption points.
  */
@@ -492,7 +492,7 @@ static void init_rq_hrtick(struct rq *rq)
 	hrtimer_init(&rq->hrtick_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	rq->hrtick_timer.function = hrtick;
 }
-#else	/* CONFIG_SCHED_HRTICK */
+#else	/* CONFIG_HIGH_RES_TIMERS */
 static inline void hrtick_clear(struct rq *rq)
 {
 }
@@ -504,7 +504,7 @@ static inline void init_rq_hrtick(struct rq *rq)
 static inline void init_hrtick(void)
 {
 }
-#endif	/* CONFIG_SCHED_HRTICK */
+#endif	/* CONFIG_HIGH_RES_TIMERS */
 
 /*
  * resched_task - mark a task 'to be rescheduled now'.
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7c70201..feffcd4 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2034,7 +2034,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued)
 	update_cfs_rq_blocked_load(cfs_rq, 1);
 	update_cfs_shares(cfs_rq);
 
-#ifdef CONFIG_SCHED_HRTICK
+#ifdef CONFIG_HIGH_RES_TIMERS
 	/*
 	 * queued ticks are scheduled to match the slice, so don't bother
 	 * validating it and just reschedule.
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index b3c5653..21b50c8 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -492,7 +492,7 @@ struct rq {
 	unsigned long calc_load_update;
 	long calc_load_active;
 
-#ifdef CONFIG_SCHED_HRTICK
+#ifdef CONFIG_HIGH_RES_TIMERS
 #ifdef CONFIG_SMP
 	int hrtick_csd_pending;
 	struct call_single_data hrtick_csd;
@@ -1103,7 +1103,7 @@ static inline u64 sched_avg_period(void)
 	return (u64)sysctl_sched_time_avg * NSEC_PER_MSEC / 2;
 }
 
-#ifdef CONFIG_SCHED_HRTICK
+#ifdef CONFIG_HIGH_RES_TIMERS
 
 /*
  * Use hrtick when:
@@ -1128,7 +1128,7 @@ static inline int hrtick_enabled(struct rq *rq)
 	return 0;
 }
 
-#endif /* CONFIG_SCHED_HRTICK */
+#endif /* CONFIG_HIGH_RES_TIMERS */
 
 #ifdef CONFIG_SMP
 extern void sched_avg_update(struct rq *rq);

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

* Re: [PATCH] remove CONFIG_SCHED_HRTICK
  2013-11-23 14:36 [PATCH] remove CONFIG_SCHED_HRTICK Christoph Hellwig
@ 2013-11-26 11:57 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2013-11-26 11:57 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Ingo Molnar, Russell King, linux-kernel, Peter Zijlstra,
	Thomas Gleixner, Mike Galbraith


* Christoph Hellwig <hch@infradead.org> wrote:

> It's equivalent to CONFIG_HIGH_RES_TIMERS now that all architectures 
> use the generic helpers it relies on.

So the SCHED_HRTICK variable documents the scheduler's dependencies 
here. It currently indeed clones CONFIG_HIGH_RES_TIMERS, but that's 
just how it's implemented today.

If we were to enable this feature more widely in the future (it's 
expensive right now so disabled by default at the moment) then it will 
be much easier to just change.

That said, while checking the background of the changes here ran 
across two ARM commits that I don't really like:

  commit c9218b163959fafa76ffbee0baa3ef269838f410
  Author: Russell King <rmk+kernel@arm.linux.org.uk>
  Date:   Sat Apr 27 23:31:10 2013 +0100

      ARM: Allow selection HZ values

this commit introduced a nonsensical duplication:

  +config SCHED_HRTICK
  +       def_bool HIGH_RES_TIMERS
 
   config SCHED_HRTICK
          def_bool HIGH_RES_TIMERS

Plus:

  commit b28748fb5d21d5d64c9ce31579ffbbd41f317042
  Author: Russell King <rmk+kernel@arm.linux.org.uk>
  Date:   Sun Feb 17 14:40:33 2013 +0000

    ARM: add SCHED_HRTICK config option
    
    As we don't include kernel/Kconfig.hz as this defines HZ values
    unsuitable for ARM platforms, add the SCHED_HRTICK to properly configure
    the scheduler for hrtimer operation.
    
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

... so if kernel/Kconfig.hz is 'unsuitable for ARM platforms' how 
about fixing it properly and making init/Kconfig.hz suitable for ARM, 
instead of duplicating its options in arch/arm/Kconfig in a messy 
fashion?

Thanks,

	Ingo

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

end of thread, other threads:[~2013-11-26 11:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-23 14:36 [PATCH] remove CONFIG_SCHED_HRTICK Christoph Hellwig
2013-11-26 11:57 ` Ingo Molnar

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