diff options
author | Vladimir Davydov <vdavydov@parallels.com> | 2014-12-12 19:55:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 15:42:47 -0500 |
commit | 6f185c290edec576a2cccd6670e5b8e02e6f04db (patch) | |
tree | 433e23f2887bfb8889314dd8a690b52abda771f3 /include/linux/sched.h | |
parent | 4e701d7b37789d1aeb0015210b373912e5d30733 (diff) |
memcg: turn memcg_kmem_skip_account into a bit field
It isn't supposed to stack, so turn it into a bit-field to save 4 bytes on
the task_struct.
Also, remove the memcg_stop/resume_kmem_account helpers - it is clearer to
set/clear the flag inline. Regarding the overwhelming comment to the
helpers, which is removed by this patch too, we already have a compact yet
accurate explanation in memcg_schedule_cache_create, no need in yet
another one.
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 55f5ee7cc3d3..4cfdbcf8cf56 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1364,6 +1364,10 @@ struct task_struct { | |||
1364 | unsigned sched_reset_on_fork:1; | 1364 | unsigned sched_reset_on_fork:1; |
1365 | unsigned sched_contributes_to_load:1; | 1365 | unsigned sched_contributes_to_load:1; |
1366 | 1366 | ||
1367 | #ifdef CONFIG_MEMCG_KMEM | ||
1368 | unsigned memcg_kmem_skip_account:1; | ||
1369 | #endif | ||
1370 | |||
1367 | unsigned long atomic_flags; /* Flags needing atomic access. */ | 1371 | unsigned long atomic_flags; /* Flags needing atomic access. */ |
1368 | 1372 | ||
1369 | pid_t pid; | 1373 | pid_t pid; |
@@ -1679,8 +1683,7 @@ struct task_struct { | |||
1679 | /* bitmask and counter of trace recursion */ | 1683 | /* bitmask and counter of trace recursion */ |
1680 | unsigned long trace_recursion; | 1684 | unsigned long trace_recursion; |
1681 | #endif /* CONFIG_TRACING */ | 1685 | #endif /* CONFIG_TRACING */ |
1682 | #ifdef CONFIG_MEMCG /* memcg uses this to do batch job */ | 1686 | #ifdef CONFIG_MEMCG |
1683 | unsigned int memcg_kmem_skip_account; | ||
1684 | struct memcg_oom_info { | 1687 | struct memcg_oom_info { |
1685 | struct mem_cgroup *memcg; | 1688 | struct mem_cgroup *memcg; |
1686 | gfp_t gfp_mask; | 1689 | gfp_t gfp_mask; |