From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91805C433ED for ; Thu, 13 May 2021 19:39:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DA5A61406 for ; Thu, 13 May 2021 19:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231555AbhEMTlF (ORCPT ); Thu, 13 May 2021 15:41:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:34298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbhEMTlF (ORCPT ); Thu, 13 May 2021 15:41:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1DD0D613CA; Thu, 13 May 2021 19:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1620934794; bh=oMwrHEm1KRKI2viYiUlVVWPmg4RsASrJREIBEXbFBr8=; h=Date:From:To:Subject:From; b=BxFnlD/SJcCwWSJMxQaYvcUrxq7h0qLI5RRALdrQq6rOJwaBUCzp2nOB2Ip8NodQC FnG7LVj0bdoD5HKu3hZFCss5RzxAgsndXHC8MljktFq9V/LhOuuh+3IAwUsTPkPk4F 9pXVR/ktq+0hG5cpjyEf1mhpTC+ScA4cMEDjZv/Y= Date: Thu, 13 May 2021 12:39:53 -0700 From: akpm@linux-foundation.org To: akpm@linux-foundation.org, cl@linux.com, guro@fb.com, hannes@cmpxchg.org, iamjoonsoo.kim@lge.com, longman@redhat.com, mhocko@kernel.org, mm-commits@vger.kernel.org, penberg@kernel.org, rientjes@google.com, sfr@canb.auug.org.au, shakeelb@google.com, vbabka@suse.cz, vdavydov.dev@gmail.com Subject: + mm-memcg-slab-create-a-new-set-of-kmalloc-cg-n-caches-v5-fix.patch added to -mm tree Message-ID: <20210513193953.PR1b2M9rt%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: mm-memcg-slab-create-a-new-set-of-kmalloc-cg-n-caches-v5-fix has been added to the -mm tree. Its filename is mm-memcg-slab-create-a-new-set-of-kmalloc-cg-n-caches-v5-fix.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-memcg-slab-create-a-new-set-of-kmalloc-cg-n-caches-v5-fix.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-memcg-slab-create-a-new-set-of-kmalloc-cg-n-caches-v5-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Andrew Morton Subject: mm-memcg-slab-create-a-new-set-of-kmalloc-cg-n-caches-v5-fix un-fat-finger v5 delta creation Cc: Christoph Lameter Cc: David Rientjes Cc: Johannes Weiner Cc: Joonsoo Kim Cc: Michal Hocko Cc: Pekka Enberg Cc: Roman Gushchin Cc: Shakeel Butt Cc: Stephen Rothwell Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Waiman Long Signed-off-by: Andrew Morton --- mm/internal.h | 5 +++++ mm/memcontrol.c | 2 +- mm/slab_common.c | 9 +++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) --- a/mm/internal.h~mm-memcg-slab-create-a-new-set-of-kmalloc-cg-n-caches-v5-fix +++ a/mm/internal.h @@ -116,6 +116,11 @@ extern void putback_lru_page(struct page extern pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long address); /* + * in mm/memcontrol.c: + */ +extern bool cgroup_memory_nokmem; + +/* * in mm/page_alloc.c */ --- a/mm/memcontrol.c~mm-memcg-slab-create-a-new-set-of-kmalloc-cg-n-caches-v5-fix +++ a/mm/memcontrol.c @@ -83,7 +83,7 @@ DEFINE_PER_CPU(struct mem_cgroup *, int_ static bool cgroup_memory_nosocket; /* Kernel memory accounting disabled? */ -static bool cgroup_memory_nokmem; +bool cgroup_memory_nokmem; /* Whether the swap controller is active */ #ifdef CONFIG_MEMCG_SWAP --- a/mm/slab_common.c~mm-memcg-slab-create-a-new-set-of-kmalloc-cg-n-caches-v5-fix +++ a/mm/slab_common.c @@ -842,10 +842,15 @@ void __init setup_kmalloc_cache_index_ta static void __init new_kmalloc_cache(int idx, enum kmalloc_cache_type type, slab_flags_t flags) { - if (type == KMALLOC_RECLAIM) + if (type == KMALLOC_RECLAIM) { flags |= SLAB_RECLAIM_ACCOUNT; - else if (IS_ENABLED(CONFIG_MEMCG_KMEM) && (type == KMALLOC_CGROUP)) + } else if (IS_ENABLED(CONFIG_MEMCG_KMEM) && (type == KMALLOC_CGROUP)) { + if (cgroup_memory_nokmem) { + kmalloc_caches[type][idx] = kmalloc_caches[KMALLOC_NORMAL][idx]; + return; + } flags |= SLAB_ACCOUNT; + } kmalloc_caches[type][idx] = create_kmalloc_cache( kmalloc_info[idx].name[type], _ Patches currently in -mm which might be from akpm@linux-foundation.org are mm.patch mm-slub-kunit-add-a-kunit-test-for-slub-debugging-functionality-fix-2.patch mm-gup-pack-has_pinned-in-mmf_has_pinned-checkpatch-fixes.patch mm-memcg-optimize-user-context-object-stock-access-checkpatch-fixes.patch mm-memcg-slab-create-a-new-set-of-kmalloc-cg-n-caches-v5-fix.patch mm-improve-mprotectrw-efficiency-on-pages-referenced-once-fix.patch binfmt-remove-in-tree-usage-of-map_executable-fix.patch mm-mmap-introduce-unlock_range-for-code-cleanup-fix.patch mm-memory_hotplug-disable-memmap_on_memory-when-hugetlb_free_vmemmap-enabled-fix.patch nommu-remove-__gfp_highmem-in-vmalloc-vzalloc-checkpatch-fixes.patch mm-madvise-introduce-madv_populate_readwrite-to-prefault-page-tables-checkpatch-fixes.patch kernelh-split-out-panic-and-oops-helpers-fix.patch module-add-printk-formats-to-add-module-build-id-to-stacktraces-fix.patch kernel-forkc-export-kernel_thread-to-modules.patch