WSL2-Linux-Kernel/mm
Tejun Heo 733a572e66 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>
2015-06-02 08:38:12 -06:00
..
kasan mm/mempool.c: kasan: poison mempool elements 2015-04-15 16:35:20 -07:00
Kconfig mm: cma: debugfs interface 2015-04-14 16:49:00 -07:00
Kconfig.debug
Makefile mm: move memtest under mm 2015-04-14 16:49:06 -07:00
backing-dev.c writeback: implement bdi_wait_for_completion() 2015-06-02 08:33:36 -06:00
balloon_compaction.c
bootmem.c
cleancache.c cleancache: remove limit on the number of cleancache enabled filesystems 2015-04-14 16:49:03 -07:00
cma.c mm: cma: add trace events for CMA allocations and freeings 2015-04-15 16:35:19 -07:00
cma.h mm: cma: allocation trigger 2015-04-14 16:49:00 -07:00
cma_debug.c mm/cma_debug.c: remove blank lines before DEFINE_SIMPLE_ATTRIBUTE() 2015-04-15 16:35:20 -07:00
compaction.c mm/compaction.c: fix "suitable_migration_target() unused" warning 2015-04-15 16:35:20 -07:00
debug-pagealloc.c
debug.c
dmapool.c
early_ioremap.c
fadvise.c writeback: implement and use inode_congested() 2015-06-02 08:33:35 -06:00
failslab.c
filemap.c memcg: add per cgroup dirty page accounting 2015-06-02 08:33:33 -06:00
frontswap.c
gup.c mm: use READ_ONCE() for non-scalar types 2015-04-15 16:35:18 -07:00
highmem.c
huge_memory.c thp: cleanup khugepaged startup 2015-04-15 16:35:19 -07:00
hugetlb.c mm: hugetlb: cleanup using paeg_huge_active() 2015-04-15 16:35:19 -07:00
hugetlb_cgroup.c
hwpoison-inject.c
init-mm.c
internal.h mm: remove rest of ACCESS_ONCE() usages 2015-04-15 16:35:18 -07:00
interval_tree.c
kmemcheck.c
kmemleak-test.c
kmemleak.c
ksm.c mm: remove rest of ACCESS_ONCE() usages 2015-04-15 16:35:18 -07:00
list_lru.c
maccess.c
madvise.c writeback: separate out include/linux/backing-dev-defs.h 2015-06-02 08:33:34 -06:00
memblock.c mm/memblock.c: add debug output for memblock_add() 2015-04-15 16:35:19 -07:00
memcontrol.c memcg: make mem_cgroup_read_{stat|event}() iterate possible cpus instead of online 2015-06-02 08:38:12 -06:00
memory-failure.c mm: hugetlb: introduce page_huge_active 2015-04-15 16:35:19 -07:00
memory.c mm: new pfn_mkwrite same as page_mkwrite for VM_PFNMAP 2015-04-15 16:35:20 -07:00
memory_hotplug.c mm: hugetlb: cleanup using paeg_huge_active() 2015-04-15 16:35:19 -07:00
mempolicy.c mm, thp: really limit transparent hugepage allocation to local node 2015-04-14 16:49:03 -07:00
mempool.c mm/mempool.c: kasan: poison mempool elements 2015-04-15 16:35:20 -07:00
memtest.c memtest: use phys_addr_t for physical addresses 2015-04-14 16:49:06 -07:00
migrate.c mm/migrate: check-before-clear PageSwapCache 2015-04-15 16:35:17 -07:00
mincore.c
mlock.c mm: move mm_populate()-related code to mm/gup.c 2015-04-14 16:49:00 -07:00
mm_init.c
mmap.c mm/mmap.c: use while instead of if+goto 2015-04-15 16:35:19 -07:00
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c
mremap.c mm/mremap.c: clean up goto just return ERR_PTR 2015-04-15 16:35:18 -07:00
msync.c
nobootmem.c
nommu.c
oom_kill.c mm/oom_kill.c: fix typo in comment 2015-04-15 16:35:16 -07:00
page-writeback.c writeback: make bdi_start_background_writeback() take bdi_writeback instead of backing_dev_info 2015-06-02 08:33:36 -06:00
page_alloc.c mm: remove rest of ACCESS_ONCE() usages 2015-04-15 16:35:18 -07:00
page_counter.c
page_ext.c
page_io.c suspend: simplify block I/O handling 2015-05-19 09:19:59 -06:00
page_isolation.c
page_owner.c
pagewalk.c
percpu-km.c
percpu-vm.c
percpu.c
pgtable-generic.c
process_vm_access.c
quicklist.c
readahead.c writeback: implement and use inode_congested() 2015-06-02 08:33:35 -06:00
rmap.c memcg: add per cgroup dirty page accounting 2015-06-02 08:33:33 -06:00
shmem.c VFS: assorted weird filesystems: d_inode() annotations 2015-04-15 15:06:58 -04:00
slab.c mm: remove GFP_THISNODE 2015-04-14 16:49:03 -07:00
slab.h
slab_common.c
slob.c slob: make slob_alloc_node() static and remove EXPORT_SYMBOL() 2015-04-14 16:48:59 -07:00
slub.c mm: remove rest of ACCESS_ONCE() usages 2015-04-15 16:35:18 -07:00
sparse-vmemmap.c
sparse.c
swap.c mm: don't call __page_cache_release for hugetlb 2015-04-15 16:35:19 -07:00
swap_cgroup.c
swap_state.c mm: remove rest of ACCESS_ONCE() usages 2015-04-15 16:35:18 -07:00
swapfile.c mm: remove rest of ACCESS_ONCE() usages 2015-04-15 16:35:18 -07:00
truncate.c memcg: add per cgroup dirty page accounting 2015-06-02 08:33:33 -06:00
util.c mm: uninline and cleanup page-mapping related helpers 2015-04-15 16:35:19 -07:00
vmacache.c
vmalloc.c mm/vmalloc: get rid of dirty bitmap inside vmap_block structure 2015-04-15 16:35:18 -07:00
vmpressure.c
vmscan.c writeback: implement and use inode_congested() 2015-06-02 08:33:35 -06:00
vmstat.c
workingset.c
zbud.c
zpool.c
zsmalloc.c zsmalloc: remove extra cond_resched() in __zs_compact 2015-04-15 16:35:22 -07:00
zswap.c