public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Mike Galbraith <efault@gmx.de>, Oleg Nesterov <oleg@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 35/35] sched/headers: Remove the <linux/topology.h> include from <linux/sched.h>
Date: Wed,  8 Feb 2017 19:51:27 +0100	[thread overview]
Message-ID: <1486579887-18499-36-git-send-email-mingo@kernel.org> (raw)
In-Reply-To: <1486579887-18499-1-git-send-email-mingo@kernel.org>

It's used only by a single (rarely used) inline function (task_node(p)),
which we can move to <linux/sched/topology.h>.

( Add <linux/nodemask.h>, because we rely on that. )

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/sched.h          | 7 +------
 include/linux/sched/topology.h | 7 +++++++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 7aabf53cd697..4ba491501ddd 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -4,6 +4,7 @@
 #include <uapi/linux/sched.h>
 
 #include <linux/sched/prio.h>
+#include <linux/nodemask.h>
 
 #include <linux/mutex.h>
 #include <linux/plist.h>
@@ -21,7 +22,6 @@
 #include <linux/kcov.h>
 #include <linux/task_io_accounting.h>
 #include <linux/latencytop.h>
-#include <linux/topology.h>
 
 #include <asm/current.h>
 
@@ -1450,11 +1450,6 @@ static inline unsigned int task_cpu(const struct task_struct *p)
 #endif
 }
 
-static inline int task_node(const struct task_struct *p)
-{
-	return cpu_to_node(task_cpu(p));
-}
-
 extern void set_task_cpu(struct task_struct *p, unsigned int cpu);
 
 #else
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
index 0d6fceff37bb..7d065abc7a47 100644
--- a/include/linux/sched/topology.h
+++ b/include/linux/sched/topology.h
@@ -1,6 +1,8 @@
 #ifndef _LINUX_SCHED_TOPOLOGY_H
 #define _LINUX_SCHED_TOPOLOGY_H
 
+#include <linux/topology.h>
+
 #include <linux/sched/idle.h>
 
 /*
@@ -216,4 +218,9 @@ static inline bool cpus_share_cache(int this_cpu, int that_cpu)
 
 #endif	/* !CONFIG_SMP */
 
+static inline int task_node(const struct task_struct *p)
+{
+	return cpu_to_node(task_cpu(p));
+}
+
 #endif /* _LINUX_SCHED_TOPOLOGY_H */
-- 
2.7.4

      parent reply	other threads:[~2017-02-08 19:00 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 18:50 [PATCH 00/35] sched.h modernization -v2, phase #4: "Remove header dependencies" Ingo Molnar
2017-02-08 18:50 ` [PATCH 01/35] sched/headers: Remove <linux/sched.h> from <linux/sched/topology.h> Ingo Molnar
2017-02-08 18:50 ` [PATCH 02/35] sched/headers: Remove tsk_is_polling() Ingo Molnar
2017-02-08 18:50 ` [PATCH 03/35] sched/headers: Remove <linux/sched.h> from <linux/sched/wake_q.h> Ingo Molnar
2017-02-08 18:50 ` [PATCH 04/35] sched/headers: Remove <linux/sched.h> from <linux/sched/clock.h> Ingo Molnar
2017-02-08 18:50 ` [PATCH 05/35] sched/headers: Remove <linux/sched.h> and <linux/slab.h> from <linux/delayacct.h> Ingo Molnar
2017-02-08 18:50 ` [PATCH 06/35] sched/headers: Remove <linux/sched.h> from <linux/sched/loadavg.h> Ingo Molnar
2017-02-08 18:50 ` [PATCH 07/35] sched/headers: Remove <linux/sched.h> from <linux/sched/autogroup.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 08/35] sched/headers: Remove <linux/sched.h> from <linux/sched/mm.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 09/35] sched/headers: Remove <linux/sched.h> from <linux/sched/coredump.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 10/35] sched/headers: Remove unused 'task_can_switch_user()' prototype Ingo Molnar
2017-02-08 18:51 ` [PATCH 11/35] sched/headers: Remove <linux/sched.h> from <linux/sched/user.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 12/35] sched/headers: Remove #include <linux/capability.h> from <linux/sched.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 13/35] sched/headers: Remove <linux/cgroup-defs.h> " Ingo Molnar
2017-02-08 18:51 ` [PATCH 14/35] sched/headers: Remove <linux/sched.h> from <linux/sched/cpufreq.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 15/35] kasan, sched/headers: Remove <linux/sched.h> from <linux/kasan.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 16/35] sched/headers: Remove <linux/cred.h> inclusion from <linux/sched.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 17/35] sched/headers: Remove <asm/ptrace.h> " Ingo Molnar
2017-02-08 18:51 ` [PATCH 18/35] sched/headers: Remove <linux/rtmutex.h> " Ingo Molnar
2017-02-08 18:51 ` [PATCH 19/35] sched/headers: Remove the <linux/gfp.h> include " Ingo Molnar
2017-02-08 18:51 ` [PATCH 20/35] sched/headers: Remove <linux/sched.h> from <linux/sched/stat.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 21/35] sched/headers: Remove <linux/sched.h> from <linux/sched/nohz.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 22/35] sched/headers: Remove <linux/sched.h> from <linux/sched/debug.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 23/35] sched/headers: Remove <linux/sched.h> from <linux/sched/hotplug.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 24/35] sched/headers: Remove the runqueue_is_locked() prototype Ingo Molnar
2017-02-08 18:51 ` [PATCH 25/35] sched/headers: Remove <linux/rwsem.h> from <linux/sched.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 26/35] sched/headers: Remove <linux/signal.h> " Ingo Molnar
2017-02-08 18:51 ` [PATCH 27/35] sched/headers: Remove the 'init_pid_ns' prototype " Ingo Molnar
2017-02-08 18:51 ` [PATCH 28/35] sched/headers: Remove <linux/rculist.h> " Ingo Molnar
2017-02-08 18:51 ` [PATCH 29/35] sched/core: Remove unused prefetch_stack() Ingo Molnar
2017-02-08 18:51 ` [PATCH 30/35] sched/headers: Remove <linux/sched.h> from <linux/sched/init.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 31/35] sched/headers: Remove <linux/magic.h> from <linux/sched/task_stack.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 32/35] sched/headers, timers: Remove the <linux/sysctl.h> include from <linux/timer.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 33/35] sched/headers, x86/apic: Remove the <linux/pm.h> header inclusion from <asm/apic.h> Ingo Molnar
2017-02-08 18:51 ` [PATCH 34/35] sched/headers, hrtimer: Remove the <linux/wait.h> include from <linux/hrtimer.h> Ingo Molnar
2017-02-08 18:51 ` Ingo Molnar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486579887-18499-36-git-send-email-mingo@kernel.org \
    --to=mingo@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox