summaryrefslogtreecommitdiffstats
path: root/mm/backing-dev.c
diff options
context:
space:
mode:
authorTejun Heo2015-05-23 00:23:18 +0200
committerJens Axboe2015-06-02 16:38:12 +0200
commit733a572e66d2a23c852fdce34dba5bbd40667817 (patch)
tree6c248783b36581b36ee3f37a3ebd6a48428f2123 /mm/backing-dev.c
parentext2: enable cgroup writeback support (diff)
downloadkernel-qcow2-linux-733a572e66d2a23c852fdce34dba5bbd40667817.tar.gz
kernel-qcow2-linux-733a572e66d2a23c852fdce34dba5bbd40667817.tar.xz
kernel-qcow2-linux-733a572e66d2a23c852fdce34dba5bbd40667817.zip
memcg: make mem_cgroup_read_{stat|event}() iterate possible cpus instead of online
cpu_possible_mask represents the CPUs which are actually possible during that boot instance. For systems which don't support CPU hotplug, this will match cpu_online_mask exactly in most cases. Even for systems which support CPU hotplug, the number of possible CPU slots is highly unlikely to diverge greatly from the number of online CPUs. The only cases where the difference between possible and online caused problems were when the boot code failed to initialize the possible mask and left it fully set at NR_CPUS - 1. As such, most per-cpu constructs allocate for all possible CPUs and often iterate over the possibles, which also has the benefit of avoiding the blocking CPU hotplug synchronization. memcg open codes per-cpu stat counting for mem_cgroup_read_stat() and mem_cgroup_read_events(), which iterates over online CPUs and handles CPU hotplug operations explicitly. This complexity doesn't actually buy anything. Switch to iterating over the possibles and drop the explicit CPU hotplug handling. Eventually, we want to convert memcg to use percpu_counter instead of its own custom implementation which also benefits from quick access w/o summing for cases where larger error margin is acceptable. This will allow mem_cgroup_read_stat() to be called from non-sleepable contexts which will be used by cgroup writeback. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Michal Hocko <mhocko@suse.cz> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'mm/backing-dev.c')
0 files changed, 0 insertions, 0 deletions