From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) (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 3C5E52C0323 for ; Wed, 6 May 2026 05:46:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778046383; cv=none; b=rFiMgqNtACCM/nVYD/k5cpw3DLQ3rhhlUuWEDtJ9IeSwy+AyhBNlO5z2pis8SxBSEaJPOqEm/fpz+GacYDEoS3yB8rPLsaCu8RjAcyh3gwBqzMhG4fDT2nIHNCQHU3QLfWhKZpdWXlMtcO7dMiNS35iLrXKosivr1k9eC81JWvk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778046383; c=relaxed/simple; bh=O6fWlzOu8jQMIgwShdu+Tka3pBUhR1XC4hWKNHMlRO0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gwAIwvwyrXDAjagsqeIa3wYYPPFa7SVmiceXiZFQI8bzDMnGd29BP2/JXPEgAPKS75VjxM5TAHS3sQxGWpdZe/vEbUR/IULuv7wJzIBRg3pez4U3hIGyCCU6q57j/xzQlhabQtSMoBXDRVpl8Bdk65JYJLh76AFzEL6u7Otku4o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=Mxy/l/3Z; arc=none smtp.client-ip=115.124.30.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="Mxy/l/3Z" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1778046378; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=MIXW9sHd6Di6iTQuVK6219NYZCkGia9n6H+juVQb/AQ=; b=Mxy/l/3ZDnZGX/ydIL8kpmmdV5VKZkPKFbUXwy+oGkJIbqhLSBotpy8/dMDQPDzCdo2j3arOWcYUxmi64FNdC7690aMWiyiBMynxKijgRAtHgne5VkyBl0+Je962h3BCBtdViMrphOfGyVJTtr3x0/uIhtYjWVyqN5/9adg6Aa4= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037033178;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0X2LaIpR_1778046375; Received: from 30.221.149.158(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X2LaIpR_1778046375 cluster:ay36) by smtp.aliyun-inc.com; Wed, 06 May 2026 13:46:16 +0800 Message-ID: <37990f6e-61ae-4b8d-94e5-772bb6f800fe@linux.alibaba.com> Date: Wed, 6 May 2026 13:46:15 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 9/9] mm: thp: always enable mTHP support To: Luiz Capitulino , linux-kernel@vger.kernel.org, linux-mm@kvack.org, david@kernel.org, ziy@nvidia.com, lance.yang@linux.dev Cc: corbet@lwn.net, tsbogend@alpha.franken.de, maddy@linux.ibm.com, mpe@ellerman.id.au, agordeev@linux.ibm.com, gerald.schaefer@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, x86@kernel.org, dave.hansen@linux.intel.com, djbw@kernel.org, vishal.l.verma@intel.com, dave.jiang@intel.com, akpm@linux-foundation.org, lorenzo.stoakes@oracle.com References: From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/2/26 3:18 AM, Luiz Capitulino wrote: > If PMD-sized pages are not supported on an architecture (ie. the > arch implements arch_has_pmd_leaves() and it returns false) then the > current code disables all THP, including mTHP. > > This commit fixes this by allowing mTHP to be always enabled for all > archs. When PMD-sized pages are not supported, its sysfs entry won't be > created and their mapping will be disallowed at page-fault time. > > Similarly, this commit implements the following changes for shmem in > shmem_allowable_huge_orders(): > > - Drop the pgtable_has_pmd_leaves() check so that mTHP sizes are > considered > - Filter out PMD and PUD orders from allowable orders when > PMD-sized pages are not supported by the CPU > > Signed-off-by: Luiz Capitulino > --- Nothing else caught my eye. Thanks. Feel free to add: Reviewed-by: Baolin Wang