Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp150862lqr; Wed, 5 Jun 2024 01:38:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6KtyGBvMuxVuJphsg0GxTQ/2JvrzJ5sPbV8k34HSfPeYZrC3oTQyk2Cl93P9QiMAqrEIEUVD+uQ7s4hC+XL2cYdNTHptWJd1+5jj4wA== X-Google-Smtp-Source: AGHT+IFtJH5bBWWxXddhL2CHWIoZmH2iNkumt/npnoEGpeeH71AIs6oeYaXAYZy6ne1hR7y8q8fA X-Received: by 2002:a05:620a:57d1:b0:794:9b38:2312 with SMTP id af79cd13be357-79523fc2b42mr180549085a.62.1717576730606; Wed, 05 Jun 2024 01:38:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717576730; cv=pass; d=google.com; s=arc-20160816; b=iWjz856V6YCj+h29BiMWvSihs8LCae7dZsLtSNS1INmDYzLzsdcql/wXwEZJ9vn578 YxhQZh6M7YjjqzW1lYcvUwtkxYe8oZqvhjqEYBbqVOqgM1c1zoKV/Ra1hix+jIHnsovR 17PLmj3VBmER/Ljf63IRKJZRB1VtZKRB2xzEwkee1e/zAP7WHWRnt9AUl05U23PbHR3X z5E6gfeGCkuh1rjrfBsVHQbV0M4NVQFC9FU6dnIEy3Ng34JwoSJ94J2B++eC1c8QVzT8 ZOrMxF1f7FUwUNRy0/2TQhJhsJbd6ETcwOgklfvNOFef+H5Ln+UWWIJ6Q/HVDnHP1MC5 exGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date; bh=ZSi6OmFydCaddH4tMPUsQFfDFiPxx+cWFrhrITZqiKQ=; fh=k9UFRVeRNSTzoq5bsZWmn5/yi2ESMsQ/cblKHz/WMIY=; b=tgkJd6nfbqlnWTqYBDx1vB2U7Ul/RYCqVu+h9m/1452VfbS1TFT9eK+y2ox9x3/e0V xFc/j6xhMgmTSQfZvI4UsCcqnLe/P9zGKbdzGCUkxeij5llzP/ulHY0ZmTnbbGTYP9Ay Q+I0rZ9ukyJ26Bz/MGlTOcyJeTKm/03t5N6STrcd8EWnOUllIV4D46OJTHvdN224rKdp +baLiDQl9njGo8WuEldjh7h31AVc2cJq8dpxo1uQzxC10xvHrUDuTWtddFDEzR5v37qD 7X2qeXutG5Sm3PeLRFKkovc3lzreymy/SQtIf/8j+sp/esrQDRJNgE/7IXDBC2BYd/Ms PFNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=zte.com.cn dmarc=pass fromdomain=zte.com.cn); spf=pass (google.com: domain of linux-kernel+bounces-202020-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202020-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-7952b54aa1fsi11530885a.321.2024.06.05.01.38.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 01:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202020-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=zte.com.cn dmarc=pass fromdomain=zte.com.cn); spf=pass (google.com: domain of linux-kernel+bounces-202020-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202020-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 67C961C237AA for ; Wed, 5 Jun 2024 08:38:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0D5B846D; Wed, 5 Jun 2024 08:38:19 +0000 (UTC) Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) (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 9C0741946A7 for ; Wed, 5 Jun 2024 08:38:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.216.63.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717576699; cv=none; b=nsmY2UYBJ/OmmQyiW1uUCt+p9vHztlFEeww0NU5cryVl+rGrW9TIQmUFuU2f5Y5M0gljdY9Coo9eTeNvotEzRj9pdro3LqmUBbT1ivh52Jj6jg7ssYTV8OyGbRfni8L6gMWXH9G4lsF7gFzGKqv/4Zwwn3sTp2C1msf+T90XDgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717576699; c=relaxed/simple; bh=bGC3C+2xwWd6OYkZRJW0Xp+S0CBDQum5pqSO3u6vVCw=; h=Date:Message-ID:Mime-Version:From:To:Cc:Subject:Content-Type; b=MlDHBJ85A4aI7YXh6Rc9aad7ZjigDZzN/6JeSj0IKdNK86vOHa917CCmZB2IcrbkmxarLTCtneHrXH0FZOWbs6dW1ZnTA/M8iFYasHmWI5eiSQJMs5jT+Cl6QqyTyXuAfoqhbAGqr6+HUe6W48vl2nviOI/fphfHcmP8OGrIJAk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn; spf=pass smtp.mailfrom=zte.com.cn; arc=none smtp.client-ip=63.216.63.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4VvLSx4NJFz6G3wn; Wed, 5 Jun 2024 16:38:09 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl2.zte.com.cn with SMTP id 4558bS2q014156; Wed, 5 Jun 2024 16:37:28 +0800 (+08) (envelope-from xu.xin16@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid32; Wed, 5 Jun 2024 16:37:31 +0800 (CST) Date: Wed, 5 Jun 2024 16:37:31 +0800 (CST) X-Zmail-TransId: 2af9666023cb0a5-00b6d X-Mailer: Zmail v1.0 Message-ID: <20240605163731027tu4GJzm7fzc00snHCyF_3@zte.com.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 From: To: , , Cc: , , , , , , Subject: =?UTF-8?B?4oCLIFtQQVRDSCBsaW51eC1uZXh0XSBtbTogaHVnZV9tZW1vcnk6IHJlbW92ZSBpc190cmFuc3BhcmVudF9odWdlcGFnZSgp?= Content-Type: text/plain; charset="UTF-8" X-MAIL:mse-fl2.zte.com.cn 4558bS2q014156 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 666023F1.000/4VvLSx4NJFz6G3wn From: Ran Xiaokai is_transparent_hugepage() was first introduced to ensure the page is 2M THP page. After commit de53c05f2ae3 ("mm: add large_rmappable page flag") and commit fc4d182316bd ("mm: huge_memory: enable debugfs to split huge pages to any order"), any large folio of mTHP suitable order can be split, not only 2M THP page. so the check in split_huge_pages_pid() is not needed here, instead a folio_test_large() check is sufficient. To ensure a 2M THP folio, we should use "folio_order(folio) == HPAGE_PMD_ORDER" for now. As split_huge_pages_pid() is the only user of is_transparent_hugepage(), we can remove this helper. Signed-off-by: Ran Xiaokai --- mm/huge_memory.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 317de2afd371..f1a992945007 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -839,15 +839,6 @@ struct deferred_split *get_deferred_split_queue(struct folio *folio) } #endif -static inline bool is_transparent_hugepage(const struct folio *folio) -{ - if (!folio_test_large(folio)) - return false; - - return is_huge_zero_folio(folio) || - folio_test_large_rmappable(folio); -} - static unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, loff_t off, unsigned long flags, unsigned long size, @@ -3439,7 +3430,7 @@ static int split_huge_pages_pid(int pid, unsigned long vaddr_start, continue; folio = page_folio(page); - if (!is_transparent_hugepage(folio)) + if (!folio_test_large(folio)) goto next; if (new_order >= folio_order(folio)) -- 2.15.2