From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.63 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796365882; b=ZK5T+hV9KIjx/UbK3YWhLHfi92VVUI3XYD74odJcyTlbJRw186nmYnz5dolfbS5Ne8/1 rsnIucOiJfi2pC+kRDu4/02g4wPRVK7lD2TGd80KKJ58cgay+WfTMWcZveo4ZQq7d9wWD 3PDi6U4MBvIvVNhSL5CUDLqQClOx0SDfuC5ktQa7Hp6DzPLQW8BvF9GEhxSW60LXRJZKV PL2VKym4M9WvpuUnafe3EYVzHOl/OvIsSx9UObCVhBIoaWOL3UUCxtpByT7+etLPvbfPV 4RzJi4vfZsKKlIaNH0abpq32erRIiZAPBeMYpajmUQlHOPDIH6oCA8wlGee2eEvFLJw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796365882; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Content-Type:Mime-Version:Subject:From: In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References: To:X-Mailer; bh=QtkIaUH1PEVHMCHE8+MVOXk85k6Fky9YmPA1QH8CokA=; b=cHlMmiQIj6ZNol8st+o3l13wd+2ezNtUtJz+fg0YnrplNNOP1cThpK/dnZVGXJNnJoTe 46eiWe6k1kI4QcGKUelkfuTkcgW8OIyZfAz4nnml5jRTM0di2do1N1oA6/Q9c86bupvOz Pvn6FtaMneSDYLLuYcmofYGsdPFv9osBTF2qpBEM3I7lVgf+8taEDZ9+koBAtxGMoLkwk 6Lozdvjl3xLxskGUA0VSaxIAvcgz5vbtAl0oC+76jzsDcbWbHFAZ7Hz0Au2KxeM2B2ZLy SNJVJNq5li8yn/fM+nTzj1yMSYOHrU6lQ2e6LxIAyYccowMkBHhYtKWPYRsRQ7c/dGw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=G4h1PCVV; arc=none smtp.remote-ip=91.218.175.63 Received: from mta0.migadu.com (out-63.mta0.migadu.com [91.218.175.63]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D36FF606A32D for ; Fri, 4 Dec 2026 06:31:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D36FF606A32D 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, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=G4h1PCVV X-Envelope-To: linux-doc@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=vyK6OsINFQZkVXC8MII905Z9fjG+qs/TNcbT2hDweH8=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796365879; v=1; x=1796970679; b=G4h1PCVVHIjVmlu3i7j3Pz4sqg9fL+a5/zSQ5DWlV4f8z9WP2XgM0ZDjrne4iEWkegOF3gon vRGYbDvLFgWgrF+9sfL3C5AZ4cNGTubE3fXXxVAq55rFjX0DxnFDx7jL13RP2WKBroG5jg6dxZX PvSLAHhtbhEmlF8r8O5dh5nA= X-Envelope-To: linux-doc@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id ef0d66ff424df810; Fri, 04 Dec 2026 06:31:19 +0000 X-Mizu-Trace-ID: ef0d66ff424df810 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset=us-ascii X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3901.200.71.1.16\)) Subject: Re: [PATCH v2 26/35] mm/rmap: don't fail unmapping hugetlb folios from private VMAs From: Muchun Song In-Reply-To: <20261203-hugetlb_fixes_2-v2-26-9bbeabb555d2@kernel.org> Date: Fri, 4 Dec 2026 14:30:55 +0800 Cc: Muchun Song , Oscar Salvador , Andrew Morton , Hongfu Li , Jinmeng Zhou , Mina Almasry , Davidlohr Bueso , Naoya Horiguchi , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Michal Hocko , Jonathan Corbet , Shuah Khan , Randy Dunlap , Vivek Kasireddy , Mel Gorman , Hugh Dickins , Baolin Wang , Dave Airlie , Jason Gunthorpe , Andy Whitcroft , Roman Gushchin , Barry Song , Andrea Arcangeli , Lorenzo Stoakes , Suren Baghdasaryan , Shakeel Butt , Pedro Falcato , Jann Horn , Guillaume Morin , Yang Shi , James Houghton , Rik van Riel , Harry Yoo , Lance Yang , Axel Rasmussen , Peter Xu , Sasha Levin , Kiryl Shutsemau , Christian Brauner , "Steven Rostedt (Google)" , Hongbo Li , Gregory Price , Zi Yan , Joshua Hahn , Rakie Kim , Ying Huang , Matthew Brost , Byungchul Park , Alistair Popple , Andi Kleen , David Rientjes , Joern Engel , "Aneesh Kumar K.V" , linux-mm@kvack.org, linux-doc@vger.kernel.org, Gerd Hoffmann , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Johannes Weiner , Chris Mason , Jiaqi Yan , stable@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: References: <20261203-hugetlb_fixes_2-v2-0-9bbeabb555d2@kernel.org> <20261203-hugetlb_fixes_2-v2-26-9bbeabb555d2@kernel.org> To: "David Hildenbrand (Arm)" X-Mailer: Apple Mail (2.3901.200.71.1.16) > On Dec 3, 2026, at 19:37, David Hildenbrand (Arm) wrote: > > Before unmapping a hugetlb page cache folio, try_to_migrate_one() and > try_to_unmap_poisoned_hugetlb_one() try to unshare the PMD table, which > requires the hugetlb VMA lock in write mode. > > As we already hold the i_mmap_rwsem, we can only trylock it, and give up > if that fails. > > Since private hugetlb VMAs have a VMA lock as well, the trylock can also > fail on private VMAs, for example while another thread is faulting in > that VMA. PMD table sharing does not apply in private VMAs, so there is > nothing to unshare and we fail for no reason: migration fails more > often, and memory failure might leave a poisoned folio mapped. > > Let's fix it by only taking the VMA lock and trying to unshare if PMD > tables can be shared. > > Fortunately, we can drop the anon folio checks now. > > This has low urgency, as it requires racing with, for example, a page > fault in the private VMA, and migration is usually retried. > > Fixes: bf4916922c60 ("hugetlbfs: extend hugetlb_vma_lock to private VMAs") > Cc: stable@vger.kernel.org > Signed-off-by: David Hildenbrand (Arm) Acked-by: Muchun Song (ByteDance) Thanks.