From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383012; b=C7VuZhgc5FNWRABzEVSZa5FQE3Fp+KxsXWsfIm6biAdJO0I47UESJ8pV4RA1Ivbj2fat rAvQyGcnW2Aqs2eApyYe8+0YMafSptzCLEnXruLW/1TlwN1ISuPS6IEsv4SppmGomgz96 vy4h0DhCDFoy3ehDy71IhEnYyQrlFI8tn+OHjDoCA+guAl5vRP1h7z6MDKsJxaTNfjJo2 XBtiUNY8ZUFwCfYdhV1nk2PiMcNauvjIo4oJzf5AvLMV8ttC89lT3hkVYd8kggdgHk70G qC+5WKBnJVLmiR1imzbR+oBYUmMXz1aule448qhidkopKL7RWzXiyq6xES9kBjzrO1A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383012; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=HaqNu9B7jyO0DKg3SDp9iLIHTs9Foo10g1HDED8dZCo=; b=BkHASik9lwp2Y8CIFft229OFd0PyYbMAmINPaKMhi+aMmKRQKczT5ZoN6fXMwGJyyOl1 UlzGeAx/cJAjw5Hlf+vvdmcQjlmEKTTs+zjwca83WgzmpNME5pLkhRzC/Sb1iiKBhEPt4 JEqyixcCy8y2QBiiFi340W7J1CNlK5jE32Pm6hizutMKwZy1nH/ZMiBPt/ygjYD50AToO w22JyEsX6v23GPJWeC0ybXmdG0J5/6z/9HwP0WIrk7wJbQE9bIKi1TtjSmo/e5D7sc4wY eD5Vj2FTKafvc1YMtP/Xv9zXTd8kNpsTzDomLLIKwRFEak0ndEk0TqnGaBkOKSBrJaA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jjfZ515n; arc=none smtp.remote-ip=209.85.221.48 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 BD08A606A332 for ; Fri, 4 Dec 2026 11:16:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BD08A606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jjfZ515n Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-4a358881793so370931f8f.0 for ; Fri, 04 Dec 2026 03:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796383010; x=1796987810; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HaqNu9B7jyO0DKg3SDp9iLIHTs9Foo10g1HDED8dZCo=; b=jjfZ515nVajuVX2WCuHcqLkA6XFoxDBGOTpdmL2NgmzOm8EmDkSNP5ta5P+vz5BDqZ aszhuQ2cQ59q2LFfNB3ghqMouvt2mPZfNlPAOrbw6oyZ8ziFhnDnpo27xRMF4IA7xSmb 4Qa3FCwVQWMd6qXhtDgVbhO6okHzVDGBGTw1VpW9wybPW03rsHsmJPgVtdMGzaoLttUt qUfHOzaD031K/HOqoGe7euouJQc41XF6QK4VGC1zykApzCbfh9RNCUAqytAjwyLouBGr sUKatVoL3B9AI75pa63zGpuRNQ/mP313BbNhP80WXz8dJr+UABk7vY5QDB+0DBb8A1lb UKvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796383010; x=1796987810; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=HaqNu9B7jyO0DKg3SDp9iLIHTs9Foo10g1HDED8dZCo=; b=ysX6DlsBwXB8q4WyQoI/EK0hMeznGxj1/G7rksPX2gpcWmG+FeLIuQURBA0NDnq3cR NmuADSPi5XzxsdQisKH9CDtJLWBzq7SCYMZrim5T7BB8u84OBF+Da3JjY/FmhIpppWCX g5u2F/y/QjA7J98JdDEtKS3PYOuNZwv8DPLaXmi0QEHIaGP3HgsuKo3eT0Kx2dnVoK7x cNFHyEbPtEwvGYvEpx1zHkbBPsK8MLVHbvCQNEe2VxgJ6wXPayoCrmXUG3o56MdFtS1s SCHPfTl8ovHfKg5TW55teyOs7bkzDOJ+q71yot6tFImOO7gm6Wwelq1J9/I15mxTY75o zgKw== X-Forwarded-Encrypted: i=1; AL+hErElQiN3Z3ZYvR2a3eETs4VNAZongyy5W/WoJQsNWN3YT9Wq9KrZEoGQoVxfa/3Xp+wonbW20yxc9QCseibz@vger.kernel.org X-Gm-Message-State: APuU4Z/Py2uRo/8S2IR07DwW1bGU67aaL8JfsRcxIHGDTJegb2F1692Y 2GU70CggJDo6dQtYPACK7W3uvUWneBfYsJNn5Nb3798rvUUvjqXtn4In X-Gm-Gg: AZFdTZdh+U0Bofw00cq2w0DRTZNuMYdGQU/o81nG4YORrNaCfdsMftaivHV0J3xmftA kZvTFVIJ5j5VsNkH5OjzKG4cJgVrAHtXtOfu8xjKBXMjHIbaSoDzPFYLKpTzIS3QBo7VeJ2c5yD byixt68Dtsz6DyrqEmL4LWPGQfsPgOXBYgSuA+lfG6RPChEiYfnNcGA+M5Yq2KsUfG407LI6Rze E/4iioQUPPyPNEFW5QKJrn8yN620Sqvs9w+zd5omTW3zmqLlKiYwDT7s85Myblgoofub4vjusBj xJRQNX/SVma0ClbHCRyM1nbBkWOvDdbuGHmuO89s49mK3SDJ+qn7FenMxD2IisGJ20bm5oPT7Ys L75+u6Day6rL3MgCmkcsLR3jZPMGZhNUdDcn3Lsemhd6z8tLvzSm+Xt/++laPFzmDKyFqtaejmt fsqhfLeu7OXJunRMwXTRv5IlSxAh0Sms+VSlBw7IIgOLqK/+DWvcfSg+Od5AdSXjQLC7oFjPcuR 0pPeP0LwqScL5MouxvQk5NyDTCJD1Y1KnwTPbYBH0MrXy3onD+9Vn/aKhffmc46nZ5pHJBaRw1Z eBdMZdWP57iMq5MtvI2jtKnRDq7dKKWUFSaQBCUylvOOrw05NrC8D58j X-Received: by 2002:a05:6000:2907:b0:4aa:8da8:4bbc with SMTP id ffacd0b85a97d-4d1eae45516mr3380890f8f.36.1796383009978; Fri, 04 Dec 2026 03:16:49 -0800 (PST) Received: from [192.168.1.22] ([83.231.69.9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d173ab8e3fsm5032093f8f.42.2026.12.04.03.16.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 03:16:49 -0800 (PST) Message-ID: <85a03a13-83a3-4666-bd1e-193e936044f3@gmail.com> Date: Fri, 4 Dec 2026 12:16:46 +0100 X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 20/35] mm/hugetlb: don't zap non-present entries when unmapping a folio To: "David Hildenbrand (Arm)" , 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" Cc: 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 References: <20261203-hugetlb_fixes_2-v2-0-9bbeabb555d2@kernel.org> <20261203-hugetlb_fixes_2-v2-20-9bbeabb555d2@kernel.org> Content-Language: en-US From: "Jose A. Perez de Azpillaga" In-Reply-To: <20261203-hugetlb_fixes_2-v2-20-9bbeabb555d2@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/3/26 12:37 PM, David Hildenbrand (Arm) wrote: > From: Chris Mason > > When the owner of a private hugetlb mapping fails to allocate a folio > for COW, unmap_ref_private() unmaps the old folio from the forked > children, and marks them with HPAGE_RESV_UNMAPPED, so they get a SIGBUS > on their next access. > > hugetlb_unmap_range() is supposed to only unmap that folio, but it > clears non-present page table entries unconditionally. > > A child can silently lose its COWed folio while it is getting migrated, > or a hwpoison entry or uffd poison marker, without HPAGE_RESV_UNMAPPED > getting set. Consequently, it would not SIGBUS on the next access. > > Let's fix it by ignoring non-present entries when unmapping a folio. As > the folio is locked, migration entries of that folio do not apply. > > This has low urgency, as it requires a failing COW allocation in the > owner racing with migration or memory failure in the child. Let's not CC > stable. > > Fixes: 8c4894c6bc79 ("hwpoison, hugetlbfs: fix "bad pmd" warning in unmapping hwpoisoned hugepage") > Signed-off-by: Chris Mason > [ david: adjust comment and description ] > Reviewed-by: Muchun Song (ByteDance) > Signed-off-by: David Hildenbrand (Arm) LGTM: Reviewed-by: Jose A. Perez de Azpillaga -- cheers, jose a. p-a