From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.migadu.com (out-112.mta1.migadu.com [95.215.58.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 663C338E8A7 for ; Sat, 10 Oct 2026 02:28:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.112 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791599306; cv=none; b=n7G9D4EjZszbNMETl0WYiDKco7GaUpgyNx4lXbMzaPk2zeu6dAaaSyWGDYDg1f/m7kf8kIkkY6v0s/Ub4avK8BOUgKd/zlQOgUuejfiKkgdwQ19oUUZGio2Z7JPy7k7+GIyotmrXm/pxXZUW0FJX9iBu5LUPD+NXy1qP/nl99sA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791599306; c=relaxed/simple; bh=urJSlmWLmOnQ+/BmKriYgMubc8WR+Lejmxapcnw2+94=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JK4k70SPJ4Cz7jciGSoE0X+EVOjEMbUm1TjwZy3AKY6j9HzQptLQdiZWxqZio17mIghgjXCX3pvViWSGCpTz1t0AMlhFvWB/Bdtlg+eV/WhUAW7hSph9ov8oOwU/Jddynd/clzfJ1OIbk2nAHxC+0tYa7tqdhdzmhxdJJSSUaBI= 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=fPbWBnnQ; arc=none smtp.client-ip=95.215.58.112 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="fPbWBnnQ" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=urJSlmWLmOnQ+/BmKriYgMubc8WR+Lejmxapcnw2+94=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1791599300; v=1; x=1792204100; b=fPbWBnnQ710zooEx0/svji4LHYB+mkJGNFse8qfYYRKmZd9q5bxQ0PvRs+uMefLk4/UkGoLj cE34obSleHuy3RDSWJZcm25Q5B/H1YEuxJ0t4ABlnFn7+Y4ibsKY2MYx/VEDGlA7mHqkERqjH2x Bm0Z4q5Ubz+EItE51nfYH8QY= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 9ec6e0e12739ee80; Sat, 10 Oct 2026 02:28:19 +0000 X-Mizu-Trace-ID: 9ec6e0e12739ee80 X-Migadu-Flow: FLOW_OUT Message-ID: <0d2f9386-fe3f-4714-8204-9d6c710ac09d@linux.dev> Date: Sat, 10 Oct 2026 10:28:11 +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] mm/rmap: don't discard lazyfree THPs at PMD level Content-Language: en-US To: Zi Yan Cc: stable@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Harry Yoo , Kyle Zeng , Rik van Riel , Vlastimil Babka , Jann Horn , Lorenzo Stoakes , David Hildenbrand , "Liam R. Howlett" , Andrew Morton References: <20261009-lazyfree-stable-fix-v1-1-70997958ef8d@nvidia.com> From: Lance Yang In-Reply-To: <20261009-lazyfree-stable-fix-v1-1-70997958ef8d@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2026/10/10 10:08, Zi Yan wrote: > __discard_anon_folio_pmd_locked() clears a lazyfree THP PMD before it knows > whether the folio can be discarded, and restores it if the folio was > redirtied or has extra references. A concurrent munmap() or > MREMAP_DONTUNMAP skips the temporary none PMD and unlinks the VMA from its > anon_vma, so the folio stays mapped after the anon_vma is freed and a later > rmap walk uses the freed anon_vma. > > Using an invalidated PMD instead of a cleared one requires additional arch > code fixes. Instead, disable the PMD level discard of lazyfree THPs, as > before commit 735ecdfaf4e8 ("mm/vmscan: avoid split lazyfree THP during > shrink_folio_list()"). > > Fixes: 735ecdfaf4e8 ("mm/vmscan: avoid split lazyfree THP during shrink_folio_list()") > Reported-by: Kyle Zeng > Closes: https://lore.kernel.org/r/20261009165214.40212-2-kylebot@openai.com > Cc: stable@vger.kernel.org > Assisted-by: LLM > Signed-off-by: Zi Yan > --- LGTM! Reviewed-by: Lance Yang