From mboxrd@z Thu Jan 1 00:00:00 1970 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 A2AA3C5B552 for ; Mon, 9 Jun 2025 05:57:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BA206B0089; Mon, 9 Jun 2025 01:57:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 36A5A6B008C; Mon, 9 Jun 2025 01:57:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A98B6B0092; Mon, 9 Jun 2025 01:57:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0A97A6B0089 for ; Mon, 9 Jun 2025 01:57:41 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B96165ED82 for ; Mon, 9 Jun 2025 05:57:40 +0000 (UTC) X-FDA: 83534805480.23.F35B919 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by imf24.hostedemail.com (Postfix) with ESMTP id 9ADF918000E for ; Mon, 9 Jun 2025 05:57:35 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=qfaV1Tpz; spf=pass (imf24.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.99 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749448657; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=iOsOoK/tKgO9MrtR3hVJKvOyBQ0iS76GyRd+qTkk8tY=; b=cewW8IFbTYMsnirSca0fWaOs7QNnzBDKJKs5kUg3FuBTpU1oz7ZjJtqo7KzLc6wNzgNubS M1LE+C2OhUBUzIx7xaV9uztW6P64IQhUAYRGN9z6A68WBd7lX+4FUZyMy2gDJ/G3ldiqqD gSFCb2p5btrfXJ9KF5/T/Mh0pov+VOw= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=qfaV1Tpz; spf=pass (imf24.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.99 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749448657; a=rsa-sha256; cv=none; b=HoICbPcesLfv1lhB7v2VauLYp8SXmTQoN6tRwY6yXPNmvUfXbZ2g2mVeDZJ3mpZGckvRQp YIpQxwF+KJYwaDqr4O8J8i6lNmYkyzlzG/fJOkdiQlfsO5iLjUSUMcrRx9u5gg0UciwWiA 3XI77jBJ9UYuF9phVK5zJtGNjM4xMBY= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1749448651; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=iOsOoK/tKgO9MrtR3hVJKvOyBQ0iS76GyRd+qTkk8tY=; b=qfaV1Tpz9KiBR80sRU9WuI13oKlg9arPCepCYoAmX1NUQLJe/6WWGHznAgRBWYq+k+eodihTTtyqxTY/g3LFWsotpevRHAyMoUiZIiGYbXVp4YH3ctpiCV+rn8kveBzN9P3uxq2gkpcB/DscTQIaDUp/CoC2zMZPu6i+aG/BVyA= Received: from 30.74.144.144(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WdL8LD-_1749448649 cluster:ay36) by smtp.aliyun-inc.com; Mon, 09 Jun 2025 13:57:30 +0800 Message-ID: Date: Mon, 9 Jun 2025 13:57:29 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] mm: huge_memory: disallow hugepages if the system-wide THP sysfs settings are disabled To: Dev Jain , akpm@linux-foundation.org, hughd@google.com, david@redhat.com Cc: lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, npache@redhat.com, ryan.roberts@arm.com, ziy@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <8eefb0809c598fadaa4a022634fba5689a4f3257.1749109709.git.baolin.wang@linux.alibaba.com> From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9ADF918000E X-Stat-Signature: 14hpputxt3tb1bm5tb45waa78cba8bk8 X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1749448655-458240 X-HE-Meta: U2FsdGVkX18qk+6EGyYg/RZ5fpCD87L+qXdCem2U6Z/I157hRkLjZpnUb0gDh5epA23FJtHZ+zS2ji4a9Om0nHFAn7Pmoe97z8ry0iRxrsfijFKhW7tICUsS2CJ0HiqMh4btgkOmRCNhdan5Q6SqjvlWYRHIcq+QusqILf/aTXtGXV9jnK2ZNT8IFy5ANxFsp9Rdb9zul+dlXjB2jsj89enQTXmiBXKVZC6bO9Ls81741yJAVAn57IJ+2toXRG1USse60a5RMQcV5/AX8Y7WuRE2oMgi/5Wva6B/LMNYZ+6KeDcjeafyBMburOXpyJf6gBvHEZL/PNC7s6mqUAz9EF/6CoJ0Dh41skesdk1c+nEvQiSDwEGq4uxt10eqWqr5Ofx+9MswuhiE/968TshH61/5AG2c3My/2aAYc9MW4WKFX1x9j+02bJa6xwpAL5DJEwV6H7Pi5O6fkZ73p5bgRkOIE0qs+t/sxsv+3CaKtKYb2lH1Al3jCqFQWUIXv2SWAMW1BGIR//cHufjDRGRrCLsWHaNpCy5kN6iMukn53MWH+hqhVHJAu7Vgha3HgxnIGtvls2I/6qs3vbnIuq5lh7uKHxU2YAKKMY6Vhtu2PQZmMqz2l3zAqss1dAHp45EXZGsnZi4yJeQeNHzmvAZkOCzvW/OwjO+OyfYiYYnzzs16BoZj41Yjz1M8nPQVk+rIA3uw7FSSHElc0ppey7j1l9YDzkOs+FoE2vsQPXpDyIkS5JaEOmzlysyf/d1u3Mzj7Xd7DVTPOHu1LjH7pL6MjkeOt9P6iJZEIXP/Pgme/OopBn+d1sC1SSCokpF0fjdaIJ8Dw4aQ+WHKZiyRnUv/jIeRsQVR+9HoT3DOlRiI3KJOHOB7tnwEuk6UKd0Iryw1CzONOsmR4c58yZnmcpKSUbTzZMnOZBESVgyUwyxkbMsM8Tu6hmze/jHASY7KT51u9bbHnpcKe3P2GQDS7uf 09a2Y1Ne IkVS1CEnQlahr7IhIcqmI9SnSggzRtPAy9KowlM44V/iEQ+SCY+BhqOkSd4SckUtUcKR3SUKvX7pQYsdM3w4YNaRxWsF1pXIGtvoraWbv51zgmza4cvlvQizvLDmfaaruJYSUssQh3JlTYK5QnxfUhy6vuY1ozfkDrKTeO1QU/sUP42pxbj35PAYP68zbOnM7Fm8Nf9e6Hcaty2xc0Uk9niUqKrTsxYU+bVuRTRga6pXfd4tDEjQ9Gls+t3kqczPOVMPMCL22pAhQ09iC2dxkYrOd/QaxVtk74z8saC1F+O8//d0etZMl6Ob7cyWf6xI84h8vRjvU2N73RnNvHnGc8V+N50OpY6ATmJbtRA3A1zuNqOPUPPsGQAbO6RhFQ9ebsjOa7HGUnP1QH0n3Br8cHq0yUxhWgctMT4p6xpUwC3foBIYjroEWV9leTjXdLpHE7Xc56V37SqEZq8s= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2025/6/7 02:47, Dev Jain wrote: > > On 06/06/25 10:19 pm, Dev Jain wrote: >> >> On 05/06/25 1:30 pm, Baolin Wang wrote: >>> The MADV_COLLAPSE will ignore the system-wide Anon THP sysfs >>> settings, which >>> means that even though we have disabled the Anon THP configuration, >>> MADV_COLLAPSE >>> will still attempt to collapse into a Anon THP. This violates the >>> rule we have >>> agreed upon: never means never. >>> >>> Another rule for madvise, referring to David's suggestion: “allowing >>> for collapsing >>> in a VM without VM_HUGEPAGE in the "madvise" mode would be fine". >>> >>> To address this issue, should check whether the Anon THP >>> configuration is disabled >>> in thp_vma_allowable_orders(), even when the TVA_ENFORCE_SYSFS flag >>> is set. >> >> Did you mean to say "even when the TVA_ENFORCE_SYSFS flag is *not* >> set"? Because if >> is set, then we have to check the anon THP sysfs config. Sorry for the confusion. What I mean is that we should also check whether the Anon THP is disabled when the TVA_ENFORCE_SYSFS flag is set. Will update the commit message. > Otherwise the patch itself looks good to me, so: > > Reviewed-by: Dev Jain Thanks for reviewing.