From patchwork Wed Oct 4 19:45:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nhat Pham X-Patchwork-Id: 13409420 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 DF236E7C4F0 for ; Wed, 4 Oct 2023 19:45:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5977A6B01A9; Wed, 4 Oct 2023 15:45:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 547606B01F2; Wed, 4 Oct 2023 15:45:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40EFD6B0282; Wed, 4 Oct 2023 15:45:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 30DE06B01A9 for ; Wed, 4 Oct 2023 15:45:11 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 03BEBA040D for ; Wed, 4 Oct 2023 19:45:10 +0000 (UTC) X-FDA: 81308807622.20.3FCB8CA Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf01.hostedemail.com (Postfix) with ESMTP id 3FA9740015 for ; Wed, 4 Oct 2023 19:45:09 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lbKP7XSQ; spf=pass (imf01.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=nphamcs@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696448709; 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=dyUM37CKgXrMLT04cPOBLc8ziCR9vdEGhysDHWiFSLc=; b=I4W7jB0iVF3pDMVUW/aKgHgLT0Y6xRz3pILfO49QwcAD9lwlMaTEefoIU0uKQeADZIQSQ0 uSHbjI5JGvHmQRoJLvGKLUpRmUQlcpanWWnPWJrYvZkvJBVP6JbEmBrPIj5GGiYh4yCdfl xUJrgx9gr0xEytLhlYHvIvQCWNXm95I= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lbKP7XSQ; spf=pass (imf01.hostedemail.com: domain of nphamcs@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=nphamcs@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696448709; a=rsa-sha256; cv=none; b=Nkar9mYhl9ZMvFV7AvbkHTIXKTNVSrzP/tnrrJ1fa1UUEd50fJx6troptKdZkegZJEP/JH qj32wyZ428wuSMjFloFu3RgrBWW5H6BlaTlIgm0hOBplZBFKuAlc3P+jH0FcpoB7RoayXe sYNgS1mzVgm8gXFqMLF1kogF63TB5nw= Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1c877f27e8fso1149975ad.1 for ; Wed, 04 Oct 2023 12:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696448708; x=1697053508; 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=dyUM37CKgXrMLT04cPOBLc8ziCR9vdEGhysDHWiFSLc=; b=lbKP7XSQF1eXbUzVbC2a8URk4bqsKi/o+o2U1q+F2LpQ8scPKCpeeEM5X/A2npb//q o8E6lTHuc/kzgnjIS4Lvc9P0mg1BXsTLf01BqfXzCEFiycMRHkc52n5BdE2yDHzVCqgl z5EOt8ls2kIakGXAMazlAnl8RPp0JrBSLA8K6Z2sB06ikQXsBOyuxmPar6R9iu3AHmuA U8lShGyQ0mpTwGLdVVEUGgibfmoCNCQ3mkpogJUEal/HS9zpG3rbbIm5zq3bLKxIE+qm aqcpIdZGeVP/MA7ce5RlyxYx1UoyvFDZ25aK5Ly/+qFIfAnDTxmVzEXS6xiZMN/BaSDq fpFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696448708; x=1697053508; 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=dyUM37CKgXrMLT04cPOBLc8ziCR9vdEGhysDHWiFSLc=; b=MFfF8GJWu+Lm6oXBmXTjbZOmwW5GOexR/oVU+5RHZFQIH5ueDrVhGG04ZUQiXLMc3H lZhyJWpB6gDvRn2l6GtoMlfj1/UTI0kijGFznFh156JcaXD+kRU2oKS7zsc5Gpy3Dr4l KzFqH5hPjTJXPZf+3rZDmqei2wLUXqQxcCngUq5tI4MLbiggK+4Fy9jA6JQqcxIW2T7w VGRZiFE1dLI4fSyRMDZujgKLXGrSyrArDtQ0br3mbygBk8F+3CLgNzlyZmDKrhLswy4x wZfxoGQKxZbjHNO5cc2+cUk0y4jY1zSdaOUdaxoo8UJdsNqSqJ/R7MHllzxolebs46zM OcoQ== X-Gm-Message-State: AOJu0YydCjVrGdNp2L6UL/QgolV3ayt/Cd+HMlWILph8/Gv3kxm7pMky D2ymOQK4ygJB8/qSJ34o95c= X-Google-Smtp-Source: AGHT+IEDXow3A1fp9kd0BwC4Z4+/Sc9FxJhrMtWKD/ySWkG+I+nY8g90SQBAt1MveEvPzTZEsXyCiQ== X-Received: by 2002:a17:902:db0d:b0:1bf:8779:e045 with SMTP id m13-20020a170902db0d00b001bf8779e045mr3805106plx.50.1696448707904; Wed, 04 Oct 2023 12:45:07 -0700 (PDT) Received: from localhost (fwdproxy-prn-014.fbsv.net. [2a03:2880:ff:e::face:b00c]) by smtp.gmail.com with ESMTPSA id ij25-20020a170902ab5900b001c73eace0fesm4188137plb.157.2023.10.04.12.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:45:07 -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 v3 2/3] hugetlb: memcg: account hugetlb-backed memory in memory controller (fix) Date: Wed, 4 Oct 2023 12:45:06 -0700 Message-Id: <20231004194506.946908-1-nphamcs@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231003001828.2554080-3-nphamcs@gmail.com> References: <20231003001828.2554080-3-nphamcs@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 3FA9740015 X-Rspam-User: X-Stat-Signature: ymadrwx498aa4t593k41t68jwx1dzwe6 X-Rspamd-Server: rspam01 X-HE-Tag: 1696448709-563923 X-HE-Meta: U2FsdGVkX18BVCI5ZZKmUlgoz90hnGc7wzkpXnLo/99r6JrGoazTQw72VZI29PthtXH8ovnusjDasVGghb3ZGabUzt9xJbc7ZNRfx08YJgDBgObYcOtmYyYOKQLH5ZxbAcwDC7CCA25qumDAA//Dt/QjX7BhK3UxjbdT6xGu+AnqMYun++NsESZwHhPYzFoU8UeigYb7JWfonoqQ68aT6LTmFvP/1wo5+IoQBVw5M6Ec5zGsztzLOPluZRT1whqx92DGbqU54zNgl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qtM7RBgkaNaWrCtuPez+BtCs638Ru54mjUHiklWsknazOestzXfz5OQhevm6NN7/kMhaOiK9ljmwewPWyEi7C83DrbkVRwFyqxTTiWkozC2KChVWXp2MqN2FGhTKptOImLoLfcE0Aed0J5ioDCZ3gDLCUsaqqt84gkYNekY9ar8gbSVXooV+mIAzRdz/Lf1lwR2dobdc2z9IF3p/j5n/nxlNqg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Ensure hugetlb folio migration also transfers the memcg metadata. This fixlet should be squashed to the following patch: https://lore.kernel.org/lkml/20231003001828.2554080-3-nphamcs@gmail.com/ hugetlb: memcg: account hugetlb-backed memory in memory controller Suggested-by: Johannes Weiner Signed-off-by: Nhat Pham --- mm/migrate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 7d1804c4a5d9..6034c7ed1d65 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -633,8 +633,7 @@ void folio_migrate_flags(struct folio *newfolio, struct folio *folio) folio_copy_owner(newfolio, folio); - if (!folio_test_hugetlb(folio)) - mem_cgroup_migrate(folio, newfolio); + mem_cgroup_migrate(folio, newfolio); } EXPORT_SYMBOL(folio_migrate_flags);