From nobody Thu Dec 18 05:20:36 2025 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FA1428B400; Mon, 10 Nov 2025 08:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762762749; cv=none; b=KqAaoPrEybi/rjVmoOcQKfd9NTl2UuRE37TkcBL//CG4IOXkSVj2EDKWt5P0dLvmneyZ/nlStDjjwU/BrVyFm26/ZdSdoqTEKX9B78kdPDAeZxC/Q8fDV6Sifu6i1CJgYEqH1soOcV5Xg9QojbhcwAi9RyDMHZL40vWU4Uit4DE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762762749; c=relaxed/simple; bh=zPOpVBcsJot3PcHUK0NXliVC/S9DUM0/805L9S/t9+s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UyAp5/zuXfToK//TBxNDFt0sf24+42G+cWgse0x6U4F9ak3B9Ec9/bLfjLyH6O3V0k9/MClX9CfMsZMbm4kga2RgmND7Jpf/1YVqaHrOnTx6d4tZrWiPyIeMFIBZnBYAtiiSQ54A6A3zLq//IXnvsMbWwGxqljKR1YDCJ+NEM54= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=B0dyRP4z; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="B0dyRP4z" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1762762745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ORWbg/QZ7k/YwOw+EM9hdfo/jfLOQNj4xWZcq69g5Tk=; b=B0dyRP4z53AScVJIQQmak2yHxuvAoCqppuID0nCCzRLNQ3fqvFkNRprnpcyaTpTQduw/+/ FOm4LjRTjuekPdcyqEW4mleUB+0Hht2sTsI2i+NABPoC7Vka/dPageeuilVHLSSJ5YORUA g3v99icWRon3eRLlxefji7Ua3uW17fk= From: Qi Zheng To: hannes@cmpxchg.org, hughd@google.com, mhocko@suse.com, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, david@redhat.com, lorenzo.stoakes@oracle.com, ziy@nvidia.com, harry.yoo@oracle.com, baolin.wang@linux.alibaba.com, Liam.Howlett@oracle.com, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, akpm@linux-foundation.org, richard.weiyang@gmail.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Muchun Song , Qi Zheng Subject: [PATCH v6 1/4] mm: thp: replace folio_memcg() with folio_memcg_charged() Date: Mon, 10 Nov 2025 16:17:55 +0800 Message-ID: <56624d537520e33e5a6b3755238b3dfb959a52ee.1762762324.git.zhengqi.arch@bytedance.com> In-Reply-To: References: 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Muchun Song folio_memcg_charged() is intended for use when the user is unconcerned about the returned memcg pointer. It is more efficient than folio_memcg(). Therefore, replace folio_memcg() with folio_memcg_charged(). Signed-off-by: Muchun Song Signed-off-by: Qi Zheng Acked-by: Johannes Weiner Acked-by: Shakeel Butt Acked-by: David Hildenbrand Reviewed-by: Roman Gushchin Reviewed-by: Harry Yoo --- mm/huge_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 949250932bb41..84ef014b2c11f 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -4140,7 +4140,7 @@ bool __folio_unqueue_deferred_split(struct folio *fol= io) bool unqueued =3D false; =20 WARN_ON_ONCE(folio_ref_count(folio)); - WARN_ON_ONCE(!mem_cgroup_disabled() && !folio_memcg(folio)); + WARN_ON_ONCE(!mem_cgroup_disabled() && !folio_memcg_charged(folio)); =20 ds_queue =3D get_deferred_split_queue(folio); spin_lock_irqsave(&ds_queue->split_queue_lock, flags); --=20 2.20.1