From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383012; b=0bERvfVqjSgto5OTaK7egs1XsQxLa1Cax18I4k+2yVOOSDyMzrmGXELRFkjYuV+Ren3b cWzZtyNut0zbomS298+BjaxE/59NPdG09WrvsrYRZD1g3zJ68aVRTIWtcr+XiS/yQwj3U Pc0ZdrZcyB2jYfjFojkJMW65ppPcqQRSHd4YNeEVKgORnaRFAwAF4P0d4lhDGt7KzTEaD Emj1Tudc7xy96HLgKkX7UdZyMb5jWqAlk1ZVTwnNMCIlDzn8p/UN8c/xX7uS2X/pGICKS GKe5V/CZGkm9EP9a/TO3CRa0KfdAEqVucFoJrSmAEW1MS5oFtezzOh9ASjemb75Sf2Q== 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=e0e2u+sPIOcSJ4oimyzUWH4NJl8WCPSGBMvqu/rxFRDivbVStOB0h9FsdDhnxwQEqACJ mJ00mFsiPCtt3tcwbWweKWIOQ6WSGK6v538xNgqdH/ddvDQ879yvQB7q+q2T2JiNkgPyM J8jgsTbq2VhSRjbkbidQuz+UNj5Q+nkYZwbCMvlLInDwOrivI4SSFa8y7YYe1Q+z6Y7fr m901cBlHq+QQHjJhFTCsvtJpWXdVSPjWmyIjopY8i43diygJe1a1XkC1crUp1CvfpDuc7 M1pNPF2FaO1s8PDPc98kjQzsfFv2sFa4KhjTtL+1qi6MM2Pc260dJFwLIpqAFZlh2xw== 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.47 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 AF8C1606A330 for ; Fri, 4 Dec 2026 11:16:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AF8C1606A330 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-f47.google.com with SMTP id ffacd0b85a97d-49412eb1474so326037f8f.3 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=LHhaC49lAIAPmfuLfQ3DubfoVX1nJHzusWG4vhBgbNzEtDvM2R3Na6HBEjXC6rAIM8 3bC6ckjPkRkAYncOXLOUCHn5NLFvR1RIdZz3wuhpnrL2bFZXUm2jP15xDR+AEFEDaHbK EwcRiTLzdya2m61rN521DKMX+JI8q+o6SOS4HzvePvNRAVDk09k4dCv8nu+PVkiFsP73 5oHlTfzy+InuEaT2Qz1oAxeIc8Sg5Oqf40lAeCxT2NA5Lx14rIlqHC1IySlFgRPegAmc /dHyGVB9+nv0Y+mgALsPlgodous9zoK4o98lK9zBL0etJOkz1cmxMAkXbz/or67IzCz4 LL1Q== X-Forwarded-Encrypted: i=1; AL+hErHFg7TDFvw1EOGc1NkqWxrmST3v7ufSI8rwyyAN5zQbXqqkeAyNs/ipAPEHPjKHtVGGF0INjL1lk9+gVhg=@vger.kernel.org X-Gm-Message-State: APuU4Z+IhOdEd6x0NUCml/lYBUAVGVQWPPUQmxMQ4mYYgrdsZO5Twt0R jEUicSR3DJmTN/3OZiTF6Ol4nI2TGcVQ7yYv7XEb+wTn/IR3atEDsHHZ X-Gm-Gg: AZFdTZfygR5+DLSmokHSnCjkj/IMmyNFJ/aiarjPX8+pzm3Vgs3TbSesEew0XHtRjn1 Wb6j0ysBcDCPIHS/SqrQ9LG99MeY1UUsS4HNF+NWxh6D080JXR3x4QkJ/SNj0IUt9wluCG9LaTO g24joJ6YA8WQwI2l8PwcU8wQ79GDiiMREg0jJcigrEywkoQrAUKin0tX1aqFl2NscxKt3m0mZfb uBRqTLFEn5ipRta2Drn6pdjG4PPpN5jhLr6m/RxlGbr7PbMdv416Ncv8s02VYMTQoP8Up5XOZoK +rr5Hl6Jngsv0GxiT76tq+I8tjKm5NVq2ptAJ3vtLw5JBniwoKcxXv2xy2tIydHULuXNMG6N1cr ZLOU0xl5K+I6QZCwYPBNeC/FzOo/BFK+uJoa9hDAJThHejSWZyaV4o1tf5KU3ENccoddQw3eLv8 PWlezX+u6DAr1vFobGFKXNFZgwv7goNMhem9zHs+cjAJr3BBVsUzEnNo6ALOqW3UevvAiW0SSjR 08lLJVdhlX5nFgj9zJfpmYnxXWRzaJQugsi+/703wzTbW7h84FkT9ysMzPQ1m9LvCt3ae+xKgBr abn5XUbrMqsOrVt3wwdgBJmZxRio8xFlrtQbaGMufP8MXeA6YgBv/OdO 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-kernel@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