summaryrefslogtreecommitdiffstats
path: root/patches/boot_time_opt_guest/0107-cgroup.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/boot_time_opt_guest/0107-cgroup.patch')
-rw-r--r--patches/boot_time_opt_guest/0107-cgroup.patch107
1 files changed, 107 insertions, 0 deletions
diff --git a/patches/boot_time_opt_guest/0107-cgroup.patch b/patches/boot_time_opt_guest/0107-cgroup.patch
new file mode 100644
index 0000000..d68c686
--- /dev/null
+++ b/patches/boot_time_opt_guest/0107-cgroup.patch
@@ -0,0 +1,107 @@
1From 0adc5bfd84939d11d3c172eab0a00bfab4aadb46 Mon Sep 17 00:00:00 2001
2From: Arjan van de Ven <arjan@linux.intel.com>
3Date: Fri, 28 Aug 2015 11:00:36 -0500
4Subject: [PATCH 107/114] cgroup
5
6Author: Arjan van de Ven <arjan@linux.intel.com>
7
8Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
9Signed-off-by: Jose Carlos Venegas Munoz <jos.c.venegas.munoz@intel.com>
10---
11 include/linux/cgroup-defs.h | 2 +-
12 kernel/cgroup.c | 24 ++++++++++++++----------
13 2 files changed, 15 insertions(+), 11 deletions(-)
14
15diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
16index 861b4677fc5b..5d3c345ee60c 100644
17--- a/include/linux/cgroup-defs.h
18+++ b/include/linux/cgroup-defs.h
19@@ -137,7 +137,7 @@ struct cgroup_subsys_state {
20
21 /* percpu_ref killing and RCU release */
22 struct rcu_head rcu_head;
23- struct work_struct destroy_work;
24+ struct delayed_work destroy_work;
25 };
26
27 /*
28diff --git a/kernel/cgroup.c b/kernel/cgroup.c
29index 53bbca7c4859..6de39d8213ed 100644
30--- a/kernel/cgroup.c
31+++ b/kernel/cgroup.c
32@@ -73,7 +73,7 @@
33 * Expiring in the middle is a performance problem not a correctness one.
34 * 1 sec should be enough.
35 */
36-#define CGROUP_PIDLIST_DESTROY_DELAY HZ
37+#define CGROUP_PIDLIST_DESTROY_DELAY round_jiffies_relative(HZ)
38
39 #define CGROUP_FILE_NAME_MAX (MAX_CGROUP_TYPE_NAMELEN + \
40 MAX_CFTYPE_NAME + 2)
41@@ -4986,8 +4986,9 @@ static struct cftype cgroup_legacy_base_files[] = {
42 */
43 static void css_free_work_fn(struct work_struct *work)
44 {
45+ struct delayed_work *dwork = to_delayed_work(work);
46 struct cgroup_subsys_state *css =
47- container_of(work, struct cgroup_subsys_state, destroy_work);
48+ container_of(dwork, struct cgroup_subsys_state, destroy_work);
49 struct cgroup_subsys *ss = css->ss;
50 struct cgroup *cgrp = css->cgroup;
51
52@@ -5036,14 +5037,15 @@ static void css_free_rcu_fn(struct rcu_head *rcu_head)
53 struct cgroup_subsys_state *css =
54 container_of(rcu_head, struct cgroup_subsys_state, rcu_head);
55
56- INIT_WORK(&css->destroy_work, css_free_work_fn);
57- queue_work(cgroup_destroy_wq, &css->destroy_work);
58+ INIT_DELAYED_WORK(&css->destroy_work, css_free_work_fn);
59+ queue_delayed_work(cgroup_destroy_wq, &css->destroy_work, CGROUP_PIDLIST_DESTROY_DELAY);
60 }
61
62 static void css_release_work_fn(struct work_struct *work)
63 {
64+ struct delayed_work *dwork = to_delayed_work(work);
65 struct cgroup_subsys_state *css =
66- container_of(work, struct cgroup_subsys_state, destroy_work);
67+ container_of(dwork, struct cgroup_subsys_state, destroy_work);
68 struct cgroup_subsys *ss = css->ss;
69 struct cgroup *cgrp = css->cgroup;
70
71@@ -5088,8 +5090,9 @@ static void css_release(struct percpu_ref *ref)
72 struct cgroup_subsys_state *css =
73 container_of(ref, struct cgroup_subsys_state, refcnt);
74
75- INIT_WORK(&css->destroy_work, css_release_work_fn);
76- queue_work(cgroup_destroy_wq, &css->destroy_work);
77+ INIT_DELAYED_WORK(&css->destroy_work, css_release_work_fn);
78+ queue_delayed_work(cgroup_destroy_wq, &css->destroy_work, CGROUP_PIDLIST_DESTROY_DELAY);
79+
80 }
81
82 static void init_and_link_css(struct cgroup_subsys_state *css,
83@@ -5371,8 +5374,9 @@ static int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name,
84 */
85 static void css_killed_work_fn(struct work_struct *work)
86 {
87+ struct delayed_work *dwork = to_delayed_work(work);
88 struct cgroup_subsys_state *css =
89- container_of(work, struct cgroup_subsys_state, destroy_work);
90+ container_of(dwork, struct cgroup_subsys_state, destroy_work);
91
92 mutex_lock(&cgroup_mutex);
93
94@@ -5393,8 +5397,8 @@ static void css_killed_ref_fn(struct percpu_ref *ref)
95 container_of(ref, struct cgroup_subsys_state, refcnt);
96
97 if (atomic_dec_and_test(&css->online_cnt)) {
98- INIT_WORK(&css->destroy_work, css_killed_work_fn);
99- queue_work(cgroup_destroy_wq, &css->destroy_work);
100+ INIT_DELAYED_WORK(&css->destroy_work, css_killed_work_fn);
101+ queue_delayed_work(cgroup_destroy_wq, &css->destroy_work, CGROUP_PIDLIST_DESTROY_DELAY);
102 }
103 }
104
105--
1062.11.1
107