From patchwork Fri Sep 29 18:17:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nhat Pham X-Patchwork-Id: 13404752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5C1CE728D6 for ; Fri, 29 Sep 2023 18:17:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21BA18D00EB; Fri, 29 Sep 2023 14:17:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C8EE8D002B; Fri, 29 Sep 2023 14:17:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06AF98D00EB; Fri, 29 Sep 2023 14:17:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EAE388D002B for ; Fri, 29 Sep 2023 14:17:16 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id BD2B31CA633 for ; Fri, 29 Sep 2023 18:17:16 +0000 (UTC) X-FDA: 81290442072.26.1484C07 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by imf17.hostedemail.com (Postfix) with ESMTP id ECE854001F for ; Fri, 29 Sep 2023 18:17:14 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=NJp2Qd9C; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.210.173 as permitted sender) smtp.mailfrom=nphamcs@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696011435; a=rsa-sha256; cv=none; b=MYLxWXo+/AbDowXV+BJSGilZcwrlcSEQnUcSdjTWsFKiXIyOQwav50tLk8DbMh4Rm7BQWl gjGCyJy6RFgR4CEFQ/mY2X5WvvbvLTDqautQ1nvRtme7jSCUGJ78qteAExJuC/kbtxkWqY iAwHqRxGmflTZlwYpaJqqQFqGMCO9hk= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=NJp2Qd9C; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.210.173 as permitted sender) smtp.mailfrom=nphamcs@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696011435; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=S4L3CyM2KD+Bhc4bJOeMsRzzCpxEuAkcHebE0BFIhjE=; b=snofm6aYnGXL7YyzcIq4P3C0YIeKqLy66iPctXrAd9Tf4YDZzItmBahJ7ZRvUrVg/+fnS3 J38lVW02+6mqLDqPqjwpT9QZv+kjljF/TF+p1JXjOHjfOGY83+wJNz3Oal9XZ7GL1V8fxm MpN/ySj2eP1bqQrZDu9Jr611MD/5z/w= Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-690d8fb3b7eso13000313b3a.1 for ; Fri, 29 Sep 2023 11:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696011434; x=1696616234; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S4L3CyM2KD+Bhc4bJOeMsRzzCpxEuAkcHebE0BFIhjE=; b=NJp2Qd9CcshsxEvRrGuEFaBPlfSJwssi9k26RkK7Q60ZdMlqXgup81/UR7951q3PE7 PC3xhQzP6Qslhdwa2Gmw/pB9ubwX6sqxKw4J/ekKuanebhzk3IMry1U7PcOobF2eRZoF m8jgp2UUeMw7DXyya7Gj7eqTl2AQclDlJok54KOVhYWyjxNsErU4Tnd6uSOGkUeHsRY3 CXnWiNxL3r2VHjeYE3d9xULWAx6GUvjE4hy8jvlEC/dZQmJV+J7yK9GOBBhVVlCTiIe4 qlcW+Ps8B/YtAjQRJYl9DqbPGSS93ql281ituNPLs+JeefPF2hRWZAs+mHDuHCPLTRGd ff7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696011434; x=1696616234; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S4L3CyM2KD+Bhc4bJOeMsRzzCpxEuAkcHebE0BFIhjE=; b=MDi6YrWj8hzsv4TCC0EJzNITV4dTGEN/ZYa7dvSfmMqzJfPMn8Ae8J/iBSWU/z9cAs v3qlxCvlagE+YL8Y1chUEJYRDQNHMGsIG/TkkLco5aSotL57FqeB7qhMORZOGAtEfa0g 14wV2s9wSaj/lLo7l3DU3csoUpaIpWflNLbwBB5DaisetafA5hvxgHvLbWb38eLAirEr qzSYMNg5pW126oHJkanPj/QvILnNzt5lAFwKQoVNDrbVg3xyqGSJvvlxv6VuyZBpSfZP HismttQD/7AD8FwC4O/y/6xjxSeYBamGbBmQzKoKMTAr3sUk9PX3LIofaJ0nMWVw81qt 5N8g== X-Gm-Message-State: AOJu0YxOHOToC5ZAvI6icnHpUYl2KUJjAUNQzOwEFSSTsCk32exyKY96 v0U8VwsVMm2uTE8dRkDkl+w= X-Google-Smtp-Source: AGHT+IHRn9NtuT89nl3ZXIHaQZ4qLfOhCqEnsf7Txzjq31uEbwhnFHCeEyskUB/5E4VwIq1/0vHdrg== X-Received: by 2002:a05:6a00:852:b0:691:da6:47a with SMTP id q18-20020a056a00085200b006910da6047amr5678328pfk.31.1696011433596; Fri, 29 Sep 2023 11:17:13 -0700 (PDT) Received: from localhost (fwdproxy-prn-006.fbsv.net. [2a03:2880:ff:6::face:b00c]) by smtp.gmail.com with ESMTPSA id i14-20020aa787ce000000b006900cb919b8sm15326753pfo.53.2023.09.29.11.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 11:17:13 -0700 (PDT) From: Nhat Pham To: akpm@linux-foundation.org Cc: riel@surriel.com, hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, muchun.song@linux.dev, tj@kernel.org, lizefan.x@bytedance.com, shuah@kernel.org, mike.kravetz@oracle.com, yosryahmed@google.com, fvdl@google.com, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: [PATCH v2 1/2] hugetlb: memcg: account hugetlb-backed memory in memory controller (fix) Date: Fri, 29 Sep 2023 11:17:12 -0700 Message-Id: <20230929181712.3723495-1-nphamcs@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928005723.1709119-2-nphamcs@gmail.com> References: <20230928005723.1709119-2-nphamcs@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: ECE854001F X-Stat-Signature: 7cg67sx6847stuxtk88d55ijharhqauz X-HE-Tag: 1696011434-84710 X-HE-Meta: U2FsdGVkX18wpMEZeOnA8L3EJc97DQM6rzlwPhmAhyYgYU1OQmpQqeuI+VdM0rt17ZUspv8L7SFdVnOqW8NWycccLko90jNWIYAXfZDWgesBBKLWoJ0mu8gTOsFXrIFve7M/sg//IIQhB4PrfDOQfhFFG/G3fqNL2nUYXox9xOE8vNNQCaZPzi1BmmVaTgZYAbpdrGVI9K4prrXRqgdLofdhi6BLHM73MaEojzSNFLqYpckn5z3fhCecnzbhc7eLFkEChxzsAlyLkOeXN9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rwb/EVSiEBNKbeEoY2c+w8ZpfJX0F8DmoMFJmjXSEpgNvx7Yqql/+58fgYUG1U7qcDSrkuQKSts9ucFQ5U= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This fixlet disables the hugetlb memcg accounting behavior in cgroup v1. Signed-off-by: Nhat Pham --- mm/memcontrol.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d5dfc9b36acb..de6bd8ca87f5 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -7081,6 +7081,7 @@ int mem_cgroup_hugetlb_charge_folio(struct folio *folio, gfp_t gfp) int ret; if (mem_cgroup_disabled() || + !cgroup_subsys_on_dfl(memory_cgrp_subsys) || !(cgrp_dfl_root.flags & CGRP_ROOT_MEMORY_HUGETLB_ACCOUNTING)) return 0;