Commit 8947f9d5b361ce927be6d5c11fed57905b7a4100

Authored by Li Zefan
Committed by Linus Torvalds
1 parent 71cbb949d1

cgroups: annotate two variables with __read_mostly

- need_forkexit_callback will be read only after system boot.
- use_task_css_set_links will be read only after it's set.

And these 2 variables are checked when a new process is forked.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -118,7 +118,7 @@
118 118 * extra work in the fork/exit path if none of the subsystems need to
119 119 * be called.
120 120 */
121   -static int need_forkexit_callback;
  121 +static int need_forkexit_callback __read_mostly;
122 122 static int need_mm_owner_callback __read_mostly;
123 123  
124 124 /* convenient tests for these bits */
... ... @@ -220,7 +220,7 @@
220 220 * task until after the first call to cgroup_iter_start(). This
221 221 * reduces the fork()/exit() overhead for people who have cgroups
222 222 * compiled into their kernel but not actually in use */
223   -static int use_task_css_set_links;
  223 +static int use_task_css_set_links __read_mostly;
224 224  
225 225 /* When we create or destroy a css_set, the operation simply
226 226 * takes/releases a reference count on all the cgroups referenced