From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.64 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796365882; b=LHpPQzOHfOl9ieFRPxFysKbf9FvCSozAitnVjPE6xfYvh8saqpAL4Jq9G8eK5NFp7b2R AfWK9GUakYCiy/C1ZuIRCyVFP8KGtnU0YSDwiX4V0PJksU4cLR03L/JDgloYhSSYiTLQ7 oKvU8+ACvLQl9PzqmX9Xbq24BI1NIncOhd/do6lc3AXfwBP5NOiKH+ok3TXTG3NWM7JjV eNQhvdZo7XSXYA3FmaxEVJXetLfZohWzpPLp1Fn2ep7FSMWJ+o0Pn+Qi2r6NobDLZM14v UCFWuGOHNvSuWljlgBnRwQehGV9+Nuk17nHCPTdT5/Mc7Mz5UZ3pXgViIVQUXAy31wQ== 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=coZDdVOJvNoBbStZtsH0BEl1tvvfnMv1WMOWf/Eu7Dd9BBiCcg6J51CkoLfUtQf5/dzb j6ks+tbiFYcG3ClocQgYo/xAWqG3zxD0L8phqLTeHN8WyGKr/hb+lmpj83lAHXjndn+JC JB1erCjxxLhH3nX7TNhsq+R3+1W2Ws5ifUsrwjMgHLBYHaR9oKWkSx+r7oN9r8Qs+ZoDq 49f+CrDFmlLGkMK1T3YR+PyezVk5YXZBTUWiR0F/TtXv/rw2dUe5i1EPZ5IlqKfyU6W3+ IKpXb7UsnLHISVY+YI/HK0VlSI/ZHkP9gl8nFr8ZZuyPe1rcinp2dyC/NoWl8LZwEtw== 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=GOXIU97W; arc=none smtp.remote-ip=91.218.175.64 Received: from mta0.migadu.com (out-64.mta0.migadu.com [91.218.175.64]) (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 D94EF606A32F for ; Fri, 4 Dec 2026 06:31:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D94EF606A32F 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=GOXIU97W X-Envelope-To: stable@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=1796365880; v=1; x=1796970680; b=GOXIU97WNH3ACKe6sm19cfA5iE4YAkkO97YGkm3rQks2Rf2O5gT5AQ9Vf1um/w477EgTvMmB hA6w9fG5OricXZkAaYkKGXQSAB31c3/RKfPfn4f8LM1VTY5pY0PcOWg4fgv42bsHDQQzoFuN47p yjeQVperE59rBK3e4FvGs2kw= X-Envelope-To: stable@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: stable@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.