From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796384951; b=qk+9g9dorqy8IZpwodbxnLMh2Bth79MMQRgtch0OAldr5+8qjToyeH672bXy8eHcVNUj OMhTcb2ocJEs76w9qwLngdSDLYsYBlIg7ZXr1tZ149h3f5JgalcinDEN6dmeTU7n7vxSs HfVRJKrZd1kKuXKtYLtAtYAv+dxj7Vaz92BjIBBAS3senxc45Usexeco4LcriSrlKgQeK eu8CKGaD1dRk7rKTclSCR8VaibSP9VMp4+TcgsRnjNtrw2znSne3fpr8nKBkTAkfptbGe osaXwDcammSgEkbYZEY5mezY9Z3edYstADTHS4JfHU8BJcRNDMy1VsBWZ1dGJza4yFw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384951; 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=+68bfPZNSBM0lDhOU40By2g0STDvJj8CefcNMk5wE1M=; b=ep5I9gJzHC0KY+8AUzBpYxNQHZf6WXUQPb0r7deF4cjgkty5Dg9tihhvrQFjAiVqiL9m URFNdSdIdi7Gb3yidZozVVRCcEHoAfcGipRfNhW4VEMx9Pr5wSNs6ADL9mlXY2ZmtnydR gY28SZzaTF4x2kM6/0BJRnl0bPOvbfwB5P2W/LtakkHSo6rvfUcgsxL+KHZwbPj5bTDc2 CwExZ99i43SRj57ra4dLGuQeSwYl/Kahak/ft3uD7rtSpZoVxB1pPxeNFPsLne5i/TPua KCcc5GoBSm63zKBbe0N0bbgmePeGlTCkSWFW5kx/TjHeez5rdj6I06AM74AhFKyseuw== 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=OvW7tKGm; arc=none smtp.remote-ip=209.85.221.51 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 5F51F606A322 for ; Fri, 4 Dec 2026 11:49:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5F51F606A322 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=OvW7tKGm Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-4a357b1c649so477520f8f.3 for ; Fri, 04 Dec 2026 03:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796384950; x=1796989750; 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=+68bfPZNSBM0lDhOU40By2g0STDvJj8CefcNMk5wE1M=; b=OvW7tKGm7rfar4IM5Kak8Ldjdxko0sq4dcym4oDYErnxtJe5azySq67qO0K+eEA7yD CHS3SFB/CHTKcEOlvnXPNEYHI524ARq18GwBsRBs5dfR0VkeyTSXMzeQu20fjE0bq9f0 6mPDKdLbu4yaUCehEAI4aqtPEWAW5E/TvPwo/t7PgvX9KZ84YOe6T/7DmnndETebdwsQ UzALO2B63BQ3tFkFAj4JKzG7e7zrqgqx6/444PZxOztPjhrleJDL+qMu4QtuTTWhavMF AQcJnlt+AkJwaO+rf64vNKx01sESR1wEuFl/gooHUhCd6fJRMf3UdzBn7UsoKhMFs9VO Jbwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796384950; x=1796989750; 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=+68bfPZNSBM0lDhOU40By2g0STDvJj8CefcNMk5wE1M=; b=qlY6sIYcGzcWO5yLbwzwPRnulQ//yN542/W38WSgcGyemBBjniQvMwk8pH2wYRQdsI TK10t6z9r00faEYuFHb3RSq7PnxTKM+Ng9CYlL3c0sMI6XnNPmTsoQs5GIX+niMRC1Ds 0xWnuK5yEjvxTiKZ/Q1R8UTWCkv88/PAKYoKs6gLoijwSuCauD23vRbwTPY0jwLOVvCx nWndbH9FZQTpOt9jZnRjRj1ROTtsXYcfgFI4TDze9NjOrbkSMxRmEdwrVMXPye1LI00X oz8R1k3Ly4sN56WrbzHW8M2+vUL7F7NPjojM07hwGjW/RsdELQVzCz2pDuwJfKln5Rz0 kG4g== X-Forwarded-Encrypted: i=1; AL+hErGh+982Q0NGMaUutqKTVrXexwibgnFM957mc5kVWuleREEP6XpZgK4wndyeZvRHYZVifWGdefjz2DzoScM=@vger.kernel.org X-Gm-Message-State: APuU4Z9lln8pdJgeGuFKPViEdbupCqsJk4GqQUyKbOJaAZ2CMW6pPDFy VFDnUCspvs95oNHkD9LwVyzt84auUGdj8HB7P7OrfL9UhTwNK4IBKUWU X-Gm-Gg: AZFdTZdpfHGzLJNVmlWYAxeSd77k/1eKiygyvj2Pho1uqvjzLPAytjWmGcpZHnhqGDw tjKbCVc5ZBeKMKz40eclauV+hgUFXZ3F14bYErYKJNP2s+AweG5PWnrgyE1BYhJL/+Yw6msS49t tozOiyo055qyZI1lhPntLvBJw9js/fqNvOjmS5Htrk38YdlvnjT1R8eTsmWDjA0901zQnGv7gCN uS/nRFbwgVE7wgQvSX6yzuIj5ZjWoO4jgJjzWxfJlWlA/mYlDxvkJc9fQz+s0kCpsmmuY3w2kyn +8Y5KYc9HnoOtu1BDTdxtkeGOK42UyHWyNFVD0HjiI/Fc+nfjto5xPn4ITynsX0Dc4eh7F5KAfR FycYS/W2bhSzcrMjgto+ni0hiJKgocnt+vOoRN3c2Rn8UpHjRdujpDxH9BDEq4JI0TSsDg75Juc 1dJJIIUw7ivMNSiWnyHes+5h/jDVoniTARbiZHpHfFXMNrMMeMzyKpV6NgaQ5puodaMPn+nJXf0 QHuediOr5+HI/U8DLhetECUaaFfDLsYojD7qV74st9+WZJlM3LbCNVXQdfyvRjMgcb0m0sOtPBp hD8Tp0WftotVgD1SClMVcHjgj2QL4V8F2Bj9UswZcoLNugUStMmc0yDD X-Received: by 2002:a05:6000:1884:b0:4a8:647c:f965 with SMTP id ffacd0b85a97d-4d1ea887511mr3941874f8f.41.1796384949666; Fri, 04 Dec 2026 03:49:09 -0800 (PST) Received: from [192.168.1.22] ([83.231.69.9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d16e1a59a3sm4827470f8f.7.2026.12.04.03.49.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 03:49:09 -0800 (PST) Message-ID: <837b6aff-4a85-403e-a271-45f2da9bdeeb@gmail.com> Date: Fri, 4 Dec 2026 12:49:05 +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 31/35] mm/hugetlb: count migration entries at fork and unmap 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-31-9bbeabb555d2@kernel.org> Content-Language: en-US From: "Jose A. Perez de Azpillaga" In-Reply-To: <20261203-hugetlb_fixes_2-v2-31-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: > HugetlbPages in /proc//status can be wrong, and even drop below > zero, if we fork() or unmap while mapped hugetlb folios are being > migrated. > > There is an inconsistency: when installing migration entries we don't > adjust the counter, treating them as if they were present. However, when > copying or unmapping a migration entry, we don't adjust the counter like > we would for a present entry. > > Let's fix it by adjusting the counter also for migration entries in > these cases. Add pte_is_migration_entry() like we did for other softleaf > types already. > > This has low urgency and given that this has been around forever and > likely nobody cares, let's not CC stable. > > Fixes: 5d317b2b6536 ("mm: hugetlb: proc: add HugetlbPages field to /proc/PID/status") > Reported-by: Chris Mason > Signed-off-by: David Hildenbrand (Arm) LGTM: Reviewed-by: Jose A. Perez de Azpillaga -- cheers, jose a. p-a