From: Linus Torvalds Date: Fri, 2 Jul 2021 00:17:24 +0000 (-0700) Subject: Merge branch 'for-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e267992f9ef0bf717d70a9ee18049782f77e4b3a;p=linux.git Merge branch 'for-5.14' of git://git./linux/kernel/git/dennis/percpu Pull percpu updates from Dennis Zhou: - percpu chunk depopulation - depopulate backing pages for chunks with empty pages when we exceed a global threshold without those pages. This lets us reclaim a portion of memory that would previously be lost until the full chunk would be freed (possibly never). - memcg accounting cleanup - previously separate chunks were managed for normal allocations and __GFP_ACCOUNT allocations. These are now consolidated which cleans up the code quite a bit. - a few misc clean ups for clang warnings * 'for-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu: percpu: optimize locking in pcpu_balance_workfn() percpu: initialize best_upa variable percpu: rework memcg accounting mm, memcg: introduce mem_cgroup_kmem_disabled() mm, memcg: mark cgroup_memory_nosocket, nokmem and noswap as __ro_after_init percpu: make symbol 'pcpu_free_slot' static percpu: implement partial chunk depopulation percpu: use pcpu_free_slot instead of pcpu_nr_slots - 1 percpu: factor out pcpu_check_block_hint() percpu: split __pcpu_balance_workfn() percpu: fix a comment about the chunks ordering --- e267992f9ef0bf717d70a9ee18049782f77e4b3a diff --cc mm/memcontrol.c index 4ee243ce61359,1fa9b00ec71d9..b80aae448a49d --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@@ -78,13 -78,12 +78,13 @@@ struct mem_cgroup *root_mem_cgroup __re /* Active memory cgroup to use from an interrupt context */ DEFINE_PER_CPU(struct mem_cgroup *, int_active_memcg); +EXPORT_PER_CPU_SYMBOL_GPL(int_active_memcg); /* Socket memory accounting disabled? */ - static bool cgroup_memory_nosocket; + static bool cgroup_memory_nosocket __ro_after_init; /* Kernel memory accounting disabled? */ - bool cgroup_memory_nokmem; -static bool cgroup_memory_nokmem __ro_after_init; ++bool cgroup_memory_nokmem __ro_after_init; /* Whether the swap controller is active */ #ifdef CONFIG_MEMCG_SWAP @@@ -256,8 -255,15 +256,13 @@@ struct cgroup_subsys_state *vmpressure_ #ifdef CONFIG_MEMCG_KMEM extern spinlock_t css_set_lock; + bool mem_cgroup_kmem_disabled(void) + { + return cgroup_memory_nokmem; + } + -static int __memcg_kmem_charge(struct mem_cgroup *memcg, gfp_t gfp, - unsigned int nr_pages); -static void __memcg_kmem_uncharge(struct mem_cgroup *memcg, - unsigned int nr_pages); +static void obj_cgroup_uncharge_pages(struct obj_cgroup *objcg, + unsigned int nr_pages); static void obj_cgroup_release(struct percpu_ref *ref) {