From: tip-bot for Li Zefan <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
peterz@infradead.org, tj@kernel.org, tglx@linutronix.de,
lizefan@huawei.com
Subject: [tip:sched/core] sched/cpuacct: Initialize root cpuacct earlier
Date: Wed, 10 Apr 2013 06:46:08 -0700 [thread overview]
Message-ID: <tip-14c6d3c8a47ced185b6375c4940b5b393f1a294e@git.kernel.org> (raw)
In-Reply-To: <51553834.9090701@huawei.com>
Commit-ID: 14c6d3c8a47ced185b6375c4940b5b393f1a294e
Gitweb: http://git.kernel.org/tip/14c6d3c8a47ced185b6375c4940b5b393f1a294e
Author: Li Zefan <lizefan@huawei.com>
AuthorDate: Fri, 29 Mar 2013 14:44:04 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 10 Apr 2013 13:54:20 +0200
sched/cpuacct: Initialize root cpuacct earlier
Now we don't need cpuacct_init(), and instead we just initialize
root_cpuacct when it's defined.
Signed-off-by: Li Zefan <lizefan@huawei.com>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/51553834.9090701@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/core.c | 2 --
kernel/sched/cpuacct.c | 11 ++++-------
kernel/sched/cpuacct.h | 5 -----
3 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 92930a8..ee8c1bd 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6936,8 +6936,6 @@ void __init sched_init(void)
#endif /* CONFIG_CGROUP_SCHED */
- cpuacct_init();
-
for_each_possible_cpu(i) {
struct rq *rq;
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index a691c4d..0425581 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -59,7 +59,10 @@ static inline struct cpuacct *parent_ca(struct cpuacct *ca)
}
static DEFINE_PER_CPU(u64, root_cpuacct_cpuusage);
-static struct cpuacct root_cpuacct;
+static struct cpuacct root_cpuacct = {
+ .cpustat = &kernel_cpustat,
+ .cpuusage = &root_cpuacct_cpuusage,
+};
/* create a new cpu accounting group */
static struct cgroup_subsys_state *cpuacct_css_alloc(struct cgroup *cgrp)
@@ -288,12 +291,6 @@ void cpuacct_account_field(struct task_struct *p, int index, u64 val)
rcu_read_unlock();
}
-void __init cpuacct_init(void)
-{
- root_cpuacct.cpustat = &kernel_cpustat;
- root_cpuacct.cpuusage = &root_cpuacct_cpuusage;
-}
-
struct cgroup_subsys cpuacct_subsys = {
.name = "cpuacct",
.css_alloc = cpuacct_css_alloc,
diff --git a/kernel/sched/cpuacct.h b/kernel/sched/cpuacct.h
index 51cd76e..ed60562 100644
--- a/kernel/sched/cpuacct.h
+++ b/kernel/sched/cpuacct.h
@@ -1,15 +1,10 @@
#ifdef CONFIG_CGROUP_CPUACCT
-extern void cpuacct_init(void);
extern void cpuacct_charge(struct task_struct *tsk, u64 cputime);
extern void cpuacct_account_field(struct task_struct *p, int index, u64 val);
#else
-static inline void cpuacct_init(void)
-{
-}
-
static inline void cpuacct_charge(struct task_struct *tsk, u64 cputime)
{
}
next prev parent reply other threads:[~2013-04-10 13:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-29 6:43 [PATCH v2 0/5] cpuacct, cgroup: Kill cgroup_subsys.active Li Zefan
2013-03-29 6:43 ` [PATCH v2 1/5] cpuacct: allocate per_cpu cpuusage for root cpuacct statically Li Zefan
2013-04-10 13:44 ` [tip:sched/core] sched/cpuacct: Allocate " tip-bot for Li Zefan
2013-03-29 6:44 ` [PATCH v2 2/5] cpuacct: Initialize root cpuacct earlier Li Zefan
2013-04-10 13:46 ` tip-bot for Li Zefan [this message]
2013-03-29 6:44 ` [PATCH v2 3/5] cpuacct: Initialize cpuacct subsystem earlier Li Zefan
2013-04-10 13:47 ` [tip:sched/core] sched/cpuacct: " tip-bot for Li Zefan
2013-03-29 6:44 ` [PATCH v2 4/5] cpuacct: No need to check subsys active state Li Zefan
2013-04-10 13:48 ` [tip:sched/core] sched/cpuacct: " tip-bot for Li Zefan
2013-03-29 6:44 ` [PATCH v2 5/5] cgroup: Kill subsys.active flag Li Zefan
2013-04-10 13:49 ` [tip:sched/core] " tip-bot for Li Zefan
2013-03-29 10:36 ` [PATCH v2 0/5] cpuacct, cgroup: Kill cgroup_subsys.active Peter Zijlstra
2013-04-09 1:29 ` Li Zefan
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=tip-14c6d3c8a47ced185b6375c4940b5b393f1a294e@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.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