Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1574763 > unrolled thread

[PATCH 40/89] sched/headers: Move CONFIG_TASK_XACCT bits out of <linux/sched.h> into <linux/sched/xacct.h>

Started byIngo Molnar <mingo@kernel.org>
First post2017-02-06 14:50 +0100
Last post2017-02-06 14:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 40/89] sched/headers: Move CONFIG_TASK_XACCT bits out of <linux/sched.h> into <linux/sched/xacct.h> Ingo Molnar <mingo@kernel.org> - 2017-02-06 14:50 +0100

#1574763 — [PATCH 40/89] sched/headers: Move CONFIG_TASK_XACCT bits out of <linux/sched.h> into <linux/sched/xacct.h>

FromIngo Molnar <mingo@kernel.org>
Date2017-02-06 14:50 +0100
Subject[PATCH 40/89] sched/headers: Move CONFIG_TASK_XACCT bits out of <linux/sched.h> into <linux/sched/xacct.h>
Message-ID<t7RQ8-5AW-85@gated-at.bofh.it>
The CONFIG_TASK_XACCT accounting inline functions are only used by
fs/read_write.c, so move them into a separate header.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 fs/read_write.c             |  3 ++-
 include/linux/sched.h       | 38 --------------------------------------
 include/linux/sched/xacct.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 39 deletions(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 5816d4c4cab0..dc60075653a8 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -4,8 +4,9 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#include <linux/slab.h> 
+#include <linux/slab.h>
 #include <linux/stat.h>
+#include <linux/sched/xacct.h>
 #include <linux/fcntl.h>
 #include <linux/file.h>
 #include <linux/uio.h>
diff --git a/include/linux/sched.h b/include/linux/sched.h
index e3de6ad359fc..0f5cf0760341 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2110,44 +2110,6 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
 extern struct task_group root_task_group;
 #endif /* CONFIG_CGROUP_SCHED */
 
-#ifdef CONFIG_TASK_XACCT
-static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
-{
-	tsk->ioac.rchar += amt;
-}
-
-static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
-{
-	tsk->ioac.wchar += amt;
-}
-
-static inline void inc_syscr(struct task_struct *tsk)
-{
-	tsk->ioac.syscr++;
-}
-
-static inline void inc_syscw(struct task_struct *tsk)
-{
-	tsk->ioac.syscw++;
-}
-#else
-static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
-{
-}
-
-static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
-{
-}
-
-static inline void inc_syscr(struct task_struct *tsk)
-{
-}
-
-static inline void inc_syscw(struct task_struct *tsk)
-{
-}
-#endif
-
 #ifndef TASK_SIZE_OF
 #define TASK_SIZE_OF(tsk)	TASK_SIZE
 #endif
diff --git a/include/linux/sched/xacct.h b/include/linux/sched/xacct.h
new file mode 100644
index 000000000000..a28156a0d34a
--- /dev/null
+++ b/include/linux/sched/xacct.h
@@ -0,0 +1,48 @@
+#ifndef _LINUX_SCHED_XACCT_H
+#define _LINUX_SCHED_XACCT_H
+
+/*
+ * Extended task accounting methods:
+ */
+
+#include <linux/sched.h>
+
+#ifdef CONFIG_TASK_XACCT
+static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
+{
+	tsk->ioac.rchar += amt;
+}
+
+static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
+{
+	tsk->ioac.wchar += amt;
+}
+
+static inline void inc_syscr(struct task_struct *tsk)
+{
+	tsk->ioac.syscr++;
+}
+
+static inline void inc_syscw(struct task_struct *tsk)
+{
+	tsk->ioac.syscw++;
+}
+#else
+static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
+{
+}
+
+static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
+{
+}
+
+static inline void inc_syscr(struct task_struct *tsk)
+{
+}
+
+static inline void inc_syscw(struct task_struct *tsk)
+{
+}
+#endif
+
+#endif /* _LINUX_SCHED_XACCT_H */
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web