From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 7C257329E55 for ; Mon, 6 Jul 2026 19:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783366571; cv=none; b=RhAC4d+QRDDDajOYOCB6v92bwIhrUsySddIipxgOhDrqQstbPbTY1hR7pKWdm1f31JXaxOk2bDsbMq9rQb2OK64zQRWHUrnmoHtrMld1TjolC8NwHhJ5Jk8Taoa+oBNoeWrjgTjbpcC1RlNyiskDNz1yJNDOsK9B8Y3bh7kYBIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783366571; c=relaxed/simple; bh=v/AKNkQz/8HhPJ27UHq6JwvQlC57RSINy1p5uSdIZJo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XoLs0MmtBOcb2SelihIGZCWJDmCGRZOxXpwNJH0T2nu6J6sKQJixx1pbROIocaMwgraL2MM+kwAis9B56Eovr3H1UbhO84l3yryWcVIDEmL1cAgVr+8qjgTmoKT9vtzWFsq3dwpFXE1k66vdVU60qTc0AG/NJJ9GvcwQlXUCcYk= 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=qGlCqtSe; arc=none smtp.client-ip=95.215.58.178 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="qGlCqtSe" 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=1783366567; 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=fKOOB8091REAB20/dFjGniXL7whpPkyQEvMp5z3q8ug=; b=qGlCqtSeE5ojWLjY+aTSybLJw0mxSITB3DJVnpmTfBQREA1VJLO6hMgd1zZH4szY5bDLUB KFeYELcFDIVt4og1yBQzL0nktIuf7HOLEvoG6OHFtqTgCipiqffKHgEkuDcKyy8D7UvTXQ 1Ljn7pxC/4i4JdbPY/7AA3XhlxmSIX0= From: Usama Arif To: Nico Pache Cc: Usama Arif , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Lorenzo Stoakes , Zi Yan , Baolin Wang , "Liam R. Howlett" , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jonathan Corbet , Shuah Khan Subject: Re: [PATCH 7/8] mm/khugepaged: clarify a comment regarding max_ptes_none check Date: Mon, 6 Jul 2026 12:35:55 -0700 Message-ID: <20260706193556.876676-1-usama.arif@linux.dev> In-Reply-To: <20260706154500.39178-8-npache@redhat.com> References: 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-Migadu-Flow: FLOW_OUT On Mon, 6 Jul 2026 09:44:54 -0600 Nico Pache wrote: > 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. Could be combined with patch 4? */ > if (enabled_orders != BIT(HPAGE_PMD_ORDER)) > ctx.max_ptes_none = KHUGEPAGED_MAX_PTES_LIMIT; > -- > 2.54.0 > >