Skip to contentSkip to conversation

more sched.h reorganization

PATCH In review Clark Williams 4 participants 7 messages Feb 20, 2013 – Feb 22, 2013

Subsystems (13)
Arm (32-bit) x86 VFS Block layer +9 more subsystems
lore
Share & tools
lore
#0 lore raw

cover more sched.h reorganization

Ingo,

These two patches continue the sched.h reorganizatin. The first is a simple move of the RR_TIMESLICE definition from sysctl to rt.h.

The second moves the clock-related items from sched.h into sched/clock.h

Tested against allmodconfigs for x86_64, arm, mips, alpha and ia64.

Clark Williams (2):
sched: move RR_TIMESLICE from sysctl.h to rt.h
sched: move clock definitions from sched.h to new file

 arch/arm/kernel/sched_clock.c |  2 +-
 arch/x86/kernel/cpu/amd.c     |  2 +-
 arch/x86/kernel/cpu/intel.c   |  2 +-
 arch/x86/kernel/tsc.c         |  2 +-
 drivers/acpi/apei/ghes.c      |  1 +
 drivers/acpi/processor_idle.c |  2 +-
 fs/bio-integrity.c            |  1 +
 include/linux/blkdev.h        |  2 +-
 include/linux/ftrace.h        |  2 +-
 include/linux/sched.h         | 61 -------------------------------------------
 include/linux/sched/rt.h      |  6 +++++
 include/linux/sched/sysctl.h  |  6 -----
 init/do_mounts.c              |  2 +-
 init/do_mounts_initrd.c       |  2 +-
 init/main.c                   |  2 +-
 kernel/events/core.c          |  1 +
 kernel/lockdep.c              |  2 +-
 kernel/printk.c               |  1 +
 kernel/rcutorture.c           |  2 +-
 kernel/sched/sched.h          |  1 +
 kernel/time/tick-sched.c      |  2 +-
 kernel/trace/ring_buffer.c    |  1 +
 kernel/trace/trace_clock.c    |  2 +-
 kernel/watchdog.c             |  1 +
 lib/plist.c                   |  2 +-
 25 files changed, 28 insertions(+), 82 deletions(-)
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/2 sched: move RR_TIMESLICE from sysctl.h to rt.h

---
 include/linux/sched/rt.h     | 6 ++++++
 include/linux/sched/sysctl.h | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)
include/linux/sched/rt.h +6 -0
index 94e19ea..440434d 100644
@@ -55,4 +55,10 @@ static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
 extern void normalize_rt_tasks(void);
 
 
+/*
+ * default timeslice is 100 msecs (used only for SCHED_RR tasks).
+ * Timeslices get refilled after they expire.
+ */
+#define RR_TIMESLICE		(100 * HZ / 1000)
+
 #endif /* _SCHED_RT_H */
include/linux/sched/sysctl.h +0 -6
index d2bb0ae..bf8086b 100644
@@ -91,12 +91,6 @@ extern unsigned int sysctl_sched_cfs_bandwidth_slice;
 extern unsigned int sysctl_sched_autogroup_enabled;
 #endif
 
-/*
- * default timeslice is 100 msecs (used only for SCHED_RR tasks).
- * Timeslices get refilled after they expire.
- */
-#define RR_TIMESLICE		(100 * HZ / 1000)
-
 extern int sched_rr_timeslice;
 
 extern int sched_rr_handler(struct ctl_table *table, int write,
Signature · 1 line
1.8.1.2
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] sched: move RR_TIMESLICE from sysctl.h to rt.h

Quoted 2 lines · Clark Williams

---

This happens to unbreak the ia64 build which is currently grumbling about:

arch/ia64/kernel/init_task.c:38: error: 'RR_TIMESLICE' undeclared here (not in a function)

So I'd be happy if it got applied directly to Linus tree before I get too big of a bisection gap.

Quoted 40 lines
 include/linux/sched/rt.h     | 6 ++++++
 include/linux/sched/sysctl.h | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)
include/linux/sched/rt.h +6 -0
index 94e19ea..440434d 100644
@@ -55,4 +55,10 @@ static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
 extern void normalize_rt_tasks(void);
 
 
+/*
+ * default timeslice is 100 msecs (used only for SCHED_RR tasks).
+ * Timeslices get refilled after they expire.
+ */
+#define RR_TIMESLICE           (100 * HZ / 1000)
+
 #endif /* _SCHED_RT_H */
include/linux/sched/sysctl.h +0 -7
index d2bb0ae..bf8086b 100644
@@ -91,12 +91,6 @@ extern unsigned int sysctl_sched_cfs_bandwidth_slice;
 extern unsigned int sysctl_sched_autogroup_enabled;
 #endif
 
-/*
- * default timeslice is 100 msecs (used only for SCHED_RR tasks).
- * Timeslices get refilled after they expire.
- */
-#define RR_TIMESLICE           (100 * HZ / 1000)
-
 extern int sched_rr_timeslice;
 
 extern int sched_rr_handler(struct ctl_table *table, int write,
--

1.8.1.2

--

maintainer
#3 lore raw

Re: [PATCH 1/2] sched: move RR_TIMESLICE from sysctl.h to rt.h

Quoted 5 lines · Tony Luck
Quoted 2 lines · Clark Williams

---

Quoted 7 lines

This happens to unbreak the ia64 build which is currently grumbling about:

arch/ia64/kernel/init_task.c:38: error: 'RR_TIMESLICE' undeclared here (not in a function)

So I'd be happy if it got applied directly to Linus tree before I get too big of a bisection gap.

Hm, didn't it get fixed via the commit below?

Thanks,

Ingo

--------------------->
commit 77852fea6e2442a0e654a9292060489895de18c7

Author: Ingo Molnar <[email protected]>
Date:   Sat Feb 16 09:46:48 2013 +0100

sched/rt: Add <linux/sched/rt.h> header to <linux/init_task.h>

IA64 relied on it through sched.h inclusion:

arch/ia64/kernel/init_task.c:38:11: error: 'MAX_PRIO' undeclared here (not in a function) arch/ia64/kernel/init_task.c:38:11: error: 'RR_TIMESLICE' undeclared here (not in a function)

#4 lore raw

Re: [PATCH 1/2] sched: move RR_TIMESLICE from sysctl.h to rt.h

Quoted 1 line · Ingo Molnar

Hm, didn't it get fixed via the commit below?

Together with moving RR_TIMESLICE to rt.h ... ia64 is good. But I see commit 77852fea6e24 in the tree I built and still see the RR_TIMESLICE errors.

I don't see the MAX_PRIO half of the problem - so it did help a bit.

-Tony

#5 lore raw

[tip:sched/urgent] sched: Move RR_TIMESLICE from sysctl.h to rt.h

In reply to Clark Williams
sched: Move RR_TIMESLICE from sysctl.h to rt.h
Commit-ID:  45ebd3945b2a3cf4eb89d5fb0090a3cb71af7973
Gitweb:     http://git.kernel.org/tip/45ebd3945b2a3cf4eb89d5fb0090a3cb71af7973
Author:     Clark Williams <[email protected]>
AuthorDate: Wed, 20 Feb 2013 09:19:09 -0600
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 22 Feb 2013 10:44:46 +0100

sched: Move RR_TIMESLICE from sysctl.h to rt.h

This fixes an ia64 build bug reported by Tony Luck.

---
 include/linux/sched/rt.h     | 6 ++++++
 include/linux/sched/sysctl.h | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)
include/linux/sched/rt.h +6 -0
index 94e19ea..440434d 100644
@@ -55,4 +55,10 @@ static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
 extern void normalize_rt_tasks(void);
 
 
+/*
+ * default timeslice is 100 msecs (used only for SCHED_RR tasks).
+ * Timeslices get refilled after they expire.
+ */
+#define RR_TIMESLICE		(100 * HZ / 1000)
+
 #endif /* _SCHED_RT_H */
include/linux/sched/sysctl.h +0 -6
index d2bb0ae..bf8086b 100644
@@ -91,12 +91,6 @@ extern unsigned int sysctl_sched_cfs_bandwidth_slice;
 extern unsigned int sysctl_sched_autogroup_enabled;
 #endif
 
-/*
- * default timeslice is 100 msecs (used only for SCHED_RR tasks).
- * Timeslices get refilled after they expire.
- */
-#define RR_TIMESLICE		(100 * HZ / 1000)
-
 extern int sched_rr_timeslice;
 
 extern int sched_rr_handler(struct ctl_table *table, int write,
#6 lore raw

PATCH 2/2 sched: move clock definitions from sched.h to new file

In reply to Clark Williams

Move the various scheduler clock definitions out of include/linux/sched.h into a new file include/linux/sched/clock.h.

---
 arch/arm/kernel/sched_clock.c |  2 +-
 arch/x86/kernel/cpu/amd.c     |  2 +-
 arch/x86/kernel/cpu/intel.c   |  2 +-
 arch/x86/kernel/tsc.c         |  2 +-
 drivers/acpi/apei/ghes.c      |  1 +
 drivers/acpi/processor_idle.c |  2 +-
 fs/bio-integrity.c            |  1 +
 include/linux/blkdev.h        |  2 +-
 include/linux/ftrace.h        |  2 +-
 include/linux/sched.h         | 61 -------------------------------------------
 init/do_mounts.c              |  2 +-
 init/do_mounts_initrd.c       |  2 +-
 init/main.c                   |  2 +-
 kernel/events/core.c          |  1 +
 kernel/lockdep.c              |  2 +-
 kernel/printk.c               |  1 +
 kernel/rcutorture.c           |  2 +-
 kernel/sched/sched.h          |  1 +
 kernel/time/tick-sched.c      |  2 +-
 kernel/trace/ring_buffer.c    |  1 +
 kernel/trace/trace_clock.c    |  2 +-
 kernel/watchdog.c             |  1 +
 lib/plist.c                   |  2 +-
 23 files changed, 22 insertions(+), 76 deletions(-)
arch/arm/kernel/sched_clock.c +1 -1
index fc6692e..8e6f986 100644
@@ -10,7 +10,7 @@
 #include <linux/jiffies.h>
 #include <linux/kernel.h>
 #include <linux/moduleparam.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/syscore_ops.h>
 #include <linux/timer.h>
 
arch/x86/kernel/cpu/amd.c +1 -1
index e3b01e5..f4838e9 100644
@@ -5,7 +5,7 @@
 #include <linux/mm.h>
 
 #include <linux/io.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <asm/processor.h>
 #include <asm/apic.h>
 #include <asm/cpu.h>
arch/x86/kernel/cpu/intel.c +1 -1
index 1905ce9..e7fc935 100644
@@ -4,7 +4,7 @@
 #include <linux/string.h>
 #include <linux/bitops.h>
 #include <linux/smp.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/thread_info.h>
 #include <linux/module.h>
 #include <linux/uaccess.h>
arch/x86/kernel/tsc.c +1 -1
index 4b9ea10..9a72176 100644
@@ -1,7 +1,7 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/kernel.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/timer.h>
drivers/acpi/apei/ghes.c +1 -0
index 7ae2750..eec858d 100644
@@ -48,6 +48,7 @@
 #include <linux/genalloc.h>
 #include <linux/pci.h>
 #include <linux/aer.h>
+#include <linux/sched/clock.h>
 #include <acpi/apei.h>
 #include <acpi/hed.h>
 #include <asm/mce.h>
drivers/acpi/processor_idle.c +1 -1
index ed9a1cc..f68208a 100644
@@ -36,7 +36,7 @@
 #include <linux/acpi.h>
 #include <linux/dmi.h>
 #include <linux/moduleparam.h>
-#include <linux/sched.h>	/* need_resched() */
+#include <linux/sched/clock.h>
 #include <linux/pm_qos.h>
 #include <linux/clockchips.h>
 #include <linux/cpuidle.h>
fs/bio-integrity.c +1 -0
index a3f28f3..090b64d 100644
@@ -26,6 +26,7 @@
 #include <linux/bio.h>
 #include <linux/workqueue.h>
 #include <linux/slab.h>
+#include <linux/sched/clock.h>
 
 struct integrity_slab {
 	struct kmem_cache *slab;
include/linux/blkdev.h +1 -1
index f94bc83..89f9b7d 100644
@@ -1,7 +1,7 @@
 #ifndef _LINUX_BLKDEV_H
 #define _LINUX_BLKDEV_H
 
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 
 #ifdef CONFIG_BLOCK
 
include/linux/ftrace.h +1 -1
index e5ca8ef..625c2c2 100644
@@ -12,7 +12,7 @@
 #include <linux/bitops.h>
 #include <linux/ptrace.h>
 #include <linux/ktime.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/fs.h>
include/linux/sched.h +0 -61

73 lines not on this page · raw message

init/do_mounts.c +1 -1
index 1d1b634..e50ec77 100644
@@ -9,7 +9,7 @@
 #endif
 
 #include <linux/module.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/ctype.h>
 #include <linux/fd.h>
 #include <linux/tty.h>
init/do_mounts_initrd.c +1 -1
index f9acf71..5e081f2 100644
@@ -14,7 +14,7 @@
 #include <linux/minix_fs.h>
 #include <linux/romfs_fs.h>
 #include <linux/initrd.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/freezer.h>
 #include <linux/kmod.h>
 
init/main.c +1 -1
index cee4b5c..a3129b1 100644
@@ -57,7 +57,7 @@
 #include <linux/pid_namespace.h>
 #include <linux/device.h>
 #include <linux/kthread.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/signal.h>
 #include <linux/idr.h>
 #include <linux/kgdb.h>
kernel/events/core.c +1 -0
index 5c75791..0b2ef1c 100644
@@ -37,6 +37,7 @@
 #include <linux/ftrace_event.h>
 #include <linux/hw_breakpoint.h>
 #include <linux/mm_types.h>
+#include <linux/sched/clock.h>
 
 #include "internal.h"
 
kernel/lockdep.c +1 -1
index 8a0efac..9e939ba 100644
@@ -27,7 +27,7 @@
  */
 #define DISABLE_BRANCH_PROFILING
 #include <linux/mutex.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
kernel/printk.c +1 -0
index 2c1ccb5..2929bfc 100644
@@ -43,6 +43,7 @@
 #include <linux/rculist.h>
 #include <linux/poll.h>
 #include <linux/irq_work.h>
+#include <linux/sched/clock.h>
 
 #include <asm/uaccess.h>
 
kernel/rcutorture.c +1 -1
index e1f3a8c..424796d 100644
@@ -32,7 +32,7 @@
 #include <linux/smp.h>
 #include <linux/rcupdate.h>
 #include <linux/interrupt.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/atomic.h>
 #include <linux/bitops.h>
 #include <linux/completion.h>
kernel/sched/sched.h +1 -0
index cc03cfd..855ea5d 100644
@@ -2,6 +2,7 @@
 #include <linux/sched.h>
 #include <linux/sched/sysctl.h>
 #include <linux/sched/rt.h>
+#include <linux/sched/clock.h>
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
 #include <linux/stop_machine.h>
kernel/time/tick-sched.c +1 -1
index 314b9ee..fc52f04 100644
@@ -18,7 +18,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/percpu.h>
 #include <linux/profile.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/module.h>
 #include <linux/irq_work.h>
 
kernel/trace/ring_buffer.c +1 -0
index 7244acd..03f006c 100644
@@ -21,6 +21,7 @@
 #include <linux/list.h>
 #include <linux/cpu.h>
 #include <linux/fs.h>
+#include <linux/sched/clock.h>
 
 #include <asm/local.h>
 
kernel/trace/trace_clock.c +1 -1
index aa8f5f4..ac7b6a6 100644
@@ -17,7 +17,7 @@
 #include <linux/hardirq.h>
 #include <linux/module.h>
 #include <linux/percpu.h>
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/ktime.h>
 #include <linux/trace_clock.h>
 
kernel/watchdog.c +1 -0
index 4a94467..997cc573 100644
@@ -24,6 +24,7 @@
 #include <linux/sysctl.h>
 #include <linux/smpboot.h>
 #include <linux/sched/rt.h>
+#include <linux/sched/clock.h>
 
 #include <asm/irq_regs.h>
 #include <linux/kvm_para.h>
lib/plist.c +1 -1
index 1ebc95f..619910c 100644
@@ -135,7 +135,7 @@ void plist_del(struct plist_node *node, struct plist_head *head)
 }
 
 #ifdef CONFIG_DEBUG_PI_LIST
-#include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
Signature · 1 line
1.8.1.2