[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170206133536.GA22208@gmail.com>
Date: Mon, 6 Feb 2017 14:35:36 +0100
From: Ingo Molnar <mingo@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Mike Galbraith <efault@....de>,
Oleg Nesterov <oleg@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: [PATCH 88/89] sched/headers: Remove #ifdefs from <linux/sched.h>
We can remove two pairs of #ifdefs by defining structures in a smarter way.
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Mike Galbraith <efault@....de>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
include/linux/sched.h | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index e2e4c7b85e1a..e59686ce0bfd 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -224,8 +224,8 @@ struct task_cputime {
#define prof_exp stime
#define sched_exp sum_exec_runtime
-#ifdef CONFIG_SCHED_INFO
struct sched_info {
+#ifdef CONFIG_SCHED_INFO
/* cumulative counters */
unsigned long pcount; /* # of times run on this cpu */
unsigned long long run_delay; /* time spent waiting on a runqueue */
@@ -233,8 +233,8 @@ struct sched_info {
/* timestamps */
unsigned long long last_arrival,/* when we last ran on a cpu */
last_queued; /* when we were last queued to run */
-};
#endif /* CONFIG_SCHED_INFO */
+};
/*
* Integer metrics need fixed point arithmetic, e.g., sched/fair
@@ -309,8 +309,8 @@ struct sched_avg {
unsigned long load_avg, util_avg;
};
-#ifdef CONFIG_SCHEDSTATS
struct sched_statistics {
+#ifdef CONFIG_SCHEDSTATS
u64 wait_start;
u64 wait_max;
u64 wait_count;
@@ -342,8 +342,8 @@ struct sched_statistics {
u64 nr_wakeups_affine_attempts;
u64 nr_wakeups_passive;
u64 nr_wakeups_idle;
-};
#endif
+};
struct sched_entity {
struct load_weight load; /* for load-balancing */
@@ -358,9 +358,7 @@ struct sched_entity {
u64 nr_migrations;
-#ifdef CONFIG_SCHEDSTATS
struct sched_statistics statistics;
-#endif
#ifdef CONFIG_FAIR_GROUP_SCHED
int depth;
@@ -526,9 +524,7 @@ struct task_struct {
int rcu_tasks_idle_cpu;
#endif /* #ifdef CONFIG_TASKS_RCU */
-#ifdef CONFIG_SCHED_INFO
struct sched_info sched_info;
-#endif
struct list_head tasks;
#ifdef CONFIG_SMP
--
2.7.4
Powered by blists - more mailing lists