From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 5DD983C09E6 for ; Mon, 6 Jul 2026 15:45:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783352720; cv=none; b=T+1Ib/DDlnCNg0J+M2kI0ez8fNlGNSi1TTqtR67Jkw5wLqE/fF3rFUKQz8FZB9ZoQh1AHlD8pjrMW2+f1vRQaNKcjQF9uLs8XkhfY58UQj5fHtKkKYIAWfqbwaDqrLnlp5iqYzQ3jJKtQlgtTZeBxzY7FPrl2sIZ4Faqbr2Vd+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783352720; c=relaxed/simple; bh=NQElXtVisEMuw0z8xItQitjo+xHXqsUNjq2Ae/SiiI8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=acEck6Zl319QNiszzZzpZjkjuCBrQqUIZa0j0uklPBwtKYDCygAG2KtalxjSRSviDmkFLhD0qhd3n7RP++SgJvDZ22AElRqSsbNJtsCJH5O5EHQQ08be6kvdOPJ7Cvu1hltUuteiVQtrIZmJGSHE3i9gInYfdmaMTEBe7WKexUU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=O8aZJEyi; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="O8aZJEyi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783352718; 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=84lc5B0NBz+7Y8WKAyou2vvafhNe1K13yiHHAsSIXuM=; b=O8aZJEyiQBr8oSfTtoKYAIkRObdBjI3IA29Ouf5eJ9Rpz4V7zJMZKcI0Aq1mm1OQlF7V80 fyStyvSgqoS1xtMC6jk5ziMMkoTl19+EuhKRl6YH79VB/+Jt+TE0vZod+Lff/p+HCy+7He et1Pmd+rCVjMAdBI6Golh2+CEywYSfQ= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-530-zMc_VIbXM2uh8MIKARxtqQ-1; Mon, 06 Jul 2026 11:45:16 -0400 X-MC-Unique: zMc_VIbXM2uh8MIKARxtqQ-1 X-Mimecast-MFC-AGG-ID: zMc_VIbXM2uh8MIKARxtqQ_1783352714 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E978718052D3; Mon, 6 Jul 2026 15:45:13 +0000 (UTC) Received: from p1.redhat.com (unknown [10.22.58.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 31B6D195604B; Mon, 6 Jul 2026 15:45:06 +0000 (UTC) From: Nico Pache To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Nico Pache , David Hildenbrand , Andrew Morton , Lorenzo Stoakes , Zi Yan , Baolin Wang , "Liam R. Howlett" , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jonathan Corbet , Shuah Khan Subject: [PATCH 7/8] mm/khugepaged: clarify a comment regarding max_ptes_none check Date: Mon, 6 Jul 2026 09:44:54 -0600 Message-ID: <20260706154500.39178-8-npache@redhat.com> In-Reply-To: <20260706154500.39178-1-npache@redhat.com> References: <20260706154500.39178-1-npache@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 While reading collapse_scan_pmd, one may be confused on where the deferred max_ptes_none check is done. Expand on this current comment by explaining which function the max_ptes_none check is now done. Suggested-by: David Hildenbrand Signed-off-by: Nico Pache --- mm/khugepaged.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 3c6f1254deca..388045a524a3 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1728,7 +1728,8 @@ static enum scan_result collapse_scan_pmd(struct mm_struct *mm, /* * If PMD is the only enabled order, enforce max_ptes_none, otherwise - * scan all pages to populate the bitmap for mTHP collapse. + * scan all pages to populate the bitmap for mTHP collapse. The bitmap + * is then checked again in mthp_collapse() for each attempted order. */ if (enabled_orders != BIT(HPAGE_PMD_ORDER)) ctx.max_ptes_none = KHUGEPAGED_MAX_PTES_LIMIT; -- 2.54.0