From nobody Thu Dec 18 09:59:08 2025 Received: from mail-sh.amlogic.com (unknown [58.32.228.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16F433D3B8 for ; Wed, 12 Feb 2025 02:21:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=58.32.228.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739326903; cv=none; b=aM/wvxVrujF/8fR13ZUZotQMnbvRUti3k/z/o+kmTIyJ2h82GzLXsEnxMUC/mA0zuXOsIV2PDn8wTiEAHfwfzmTbfWcHZGzpFDKHqrYw0S1M76o4pQ2xN77nUD2T7D/+Ld/vZCxRRmnS23BoOo1JQyxx9fCe+bEfoww6pM3voc4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739326903; c=relaxed/simple; bh=UgwC4QNIm2wYd98Mrn0myQ1ps/3mn0ecSPsnhG0Dywk=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Nsp9lZg1/X1HmUpWjFNFmdJex8Uvi4cNh2qrbnpM1pR9+ISf3frR5p6K+6JYcf2v70QgbsVfSXwGIA8qJmiuBFOi/tjJ2Hz8NbgnoLgb2dIbgY4GDmF+45HoyXOWnHrq5hdct2QwrjNVn8fZhV2wGGa4huH1v8MvoziKhtw0KHU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; arc=none smtp.client-ip=58.32.228.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com Received: from walle01-sz.amlogic.com (10.28.11.73) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.39; Wed, 12 Feb 2025 10:06:32 +0800 From: Shengken Lin To: CC: , , Shengken Lin Subject: [PATCH] mm: Remove redundant PageMemcgKmem(page) call Date: Wed, 12 Feb 2025 10:06:27 +0800 Message-ID: <20250212020627.3461237-1-shengken.lin@amlogic.com> X-Mailer: git-send-email 2.41.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The function of PageMemcgKmem(page) is the same as that of folio_memcg_kmem(folio). Since __memcg_kmem_uncharge_page already uses folio_memcg_kmem to check if a folio has been uncharged, calling PageMemcgKmem(page) before __memcg_kmem_uncharge_page is redundant. Signed-off-by: Shengken Lin --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 579789600a3c..5a76760de495 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1055,7 +1055,7 @@ __always_inline bool free_pages_prepare(struct page *= page, trace_mm_page_free(page, order); kmsan_free_page(page, order); - if (memcg_kmem_online() && PageMemcgKmem(page)) + if (memcg_kmem_online()) __memcg_kmem_uncharge_page(page, order); /* -- 2.34.1