From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 373314219E9 for ; Tue, 9 Jun 2026 13:56:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781013395; cv=none; b=hMGv7eN90XgGKa66IOm44yWy6asQg/HOcv3z8UmjFffVAiK8xhLpUw5mWxg8CgTlIIwaHSNmKeTtxEfZhkGF1orp2/ki2Nuj5Pcft11pup8ZCiUkjUgQSFsjXl7x43+0qohBlpSqg3ughimSOz1VdfXNYbD8+zchtAzhi9e1vL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781013395; c=relaxed/simple; bh=mHa+5wcrxxPTSW2qkTaqQVzWZamh5iSGfOx88I+lA2o=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FIhet9rKQGz82lLBWK/S+Owj9N9rKzDPXWd5fke3NemxqoVDRTUM0M5cCqk7MpSSz7k1wnSR9uF4mc7wIisQT5nu6YGY3eBTlglfdoMmOt99tsMvDUfyo0iWMe77UAWZrUl8p6O/yZyfXSU1M8P8d8GJsXDSUkaCPHlhhPMziBM= 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=nMaYrvGu; arc=none smtp.client-ip=95.215.58.188 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="nMaYrvGu" Message-ID: <71507be5-8430-4a3d-af80-6777a421565e@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781013392; h=from:from: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; bh=1v2Zddelxf5PmwGEW+ZgV6CJT0DFyt74H17htCtqM/Q=; b=nMaYrvGuCeqWHmltN1ytkMCfwNtkbJpJ4jzqKPOiAiwD1CT3Ikqp1qtu38bNoRi8P55fhM 3j4PIc6f8XGb1i/FAhZJLCaUWxMJJjXUG7kCJEWvfRhklPvXr8PvzgQof8/3XFkygYlqxB 69BSvaQiOridjvKTAIVdsOEpU9Rkj84= Date: Tue, 9 Jun 2026 21:56:13 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH mm-unstable 1/1] mm/khugepaged: fix PMD collapse swap PTE accounting To: "David Hildenbrand (Arm)" , akpm@linux-foundation.org Cc: ljs@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20260609120443.71864-1-lance.yang@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Lance Yang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2026/6/9 21:20, David Hildenbrand (Arm) wrote: > On 6/9/26 14:04, Lance Yang wrote: >> From: Lance Yang >> >> mthp_collapse() uses mthp_present_ptes to decide whether a range has >> enough occupied PTEs to try collapse. Swap PTEs accepted by >> collapse_scan_pmd() are counted in unmapped, but are not represented in >> mthp_present_ptes. >> >> When lower orders are enabled, collapse_scan_pmd() relaxes max_ptes_none >> so the scan can cover the whole PMD and build the bitmap. mthp_collapse() >> then checks the PMD-order candidate using the bitmap. >> >> With max_ptes_none set to 0, a range with 511 present PTEs and one swap >> PTE no longer reaches collapse_huge_page(), even though PMD collapse can >> handle swap PTEs up to max_ptes_swap. >> >> Account unmapped PTEs only for PMD order. PMD collapse supports swap PTEs >> through max_ptes_swap, while lower-order mTHP collapse does not currently >> support non-present PTEs. Keep non-present PTEs out of the lower-order >> eligibility check. >> >> Signed-off-by: Lance Yang >> --- >> Sent separately, as discussed in [1], to spell out the PMD-order swap PTE >> case. Patch [2] is still only in mm-unstable, so no Fixes: tag. > > Right, probably we just want to add the Fixes: tag once Andrew moves the series > to mm-stable? Yep, hopefully Andrew can add the Fixes: tag when applying this, once the series lands in mm-stable. Should be soon, I guess :P