From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385081; b=VZ1aSgyOxdN9VOWh/phWedMp/VsZGPaKbW/1JEuM8urUIZUAsaWoQ1Yp3CWjQXxPMaFQ 5IadnBk72gezgksIKwUKF04P/0Ymk9WEi/E29c9YvHAaPTXz+Ozh9gZINaL7BM4kkIIHQ kJ1xOGIPeDJw9mbL6/fDDPao2CPP+pNjSySVRHruSpBcPZb15ty/S3m3Q7YCCHUlMcc9t UsfO5kpm++brZBPXKogZ+WXbuJ3UpFRzCwpeorEVlSOUEjOjOmXirt6dcgGfiLsnFwGnF nfMBe8co/nVFaWTYXXhPufiuBG80R/PiHzIKSS2K6q0Nwxyp4L/4mZhaToKw1NyXxjw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385081; 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=fzi3W1QG29xwoicRqlho2V1KF2anH/E+2/cMojGG1qo=; b=l2v296S6vBKScIFp8MiDaaipGqKTiHo1dCY8h0gYcwhzNxxAMVxdzAstBi1UaviWJpLO 5lJbGPxeNzvADm7iHFIXwVXg5YMab/LD2koipBvv3t+7huBsSvITVJm23JVaVqpn6PF0w kpjEoHhR7laXM4coVts13H7fIPoJ6MlT0tguogyj3/yRCGthJvdHp6Xy4hnDCGodJ2k7Z axqmYPrBrs+0CxodGTXOKhDcmUtzxGIKI3SPm2pap7KJDQduOkXdI0cY+GOLgQq1/xdT6 qZrO/jKtkgc+q6yz8IzYFpSyztVuEvGwILT6MoIu5FB6HzkNzFzSdKTW9Y0a5vg68mg== 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=ReufuurL; arc=none smtp.remote-ip=209.85.221.42 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 D3264606A33C for ; Fri, 4 Dec 2026 11:51:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D3264606A33C 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=ReufuurL Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-48e20ed3b9dso806210f8f.2 for ; Fri, 04 Dec 2026 03:51:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796385079; x=1796989879; 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=fzi3W1QG29xwoicRqlho2V1KF2anH/E+2/cMojGG1qo=; b=ReufuurLJy424kC23ACOjmBc0keZYMv24ehOKAooStNeySPcHrwY0mDiEq7brKb7UW 67sMOvRcNr2d7/woUXt6u8806QBGmNptVFG3t0k29HDjmuN/+cUzTt/SdhCsenBBohjb cj0iet71ZH+vauRLf828XSdULHK6VscihzxE74I63N3rcX79lJonfKartGe2I45S36j9 uuZPY7cV+yH9cRxCvycEtQfDoUwXUh7ngc9H7ucLjDdma3fNIt5FXg2zQ28t/2YJAqWg bksYvcPTxYkOxn9E+HsB7tRi3NzQuw+vriMl7OieHn/wIh+ClE90SrJsYAK7z/2AhOM1 8TGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796385079; x=1796989879; 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=fzi3W1QG29xwoicRqlho2V1KF2anH/E+2/cMojGG1qo=; b=0yWMvggvgsfsl7O5xVLu5/tW6YHhUiVoa71id3FbduWUka5df1+ls1/LS0pNLIE7r9 gjuYf9fV8L1e9lR8zfo9zz9dv3QCijxWgKu4u57fVceuL5pLxS3Jx5IPExJ3lsfIgkuL 9INfQyms0ndNmbhSJmN0sVrTB1MbA4bHvUWoN4S/p+6AadY0j0LCyzBRlzuX/z+WLl48 1v/6OjmiCraqagp+m7PT5H2PdkuW2755TRWyoq/leU/hELSFfxmDkHum8l3IvugAYRlb Tvy/zC10QmgpNly84VVKIRizS0N6CoD4ho6mzGE13muH4E732hAIh/T88dGEoamFrYgc a5/g== X-Forwarded-Encrypted: i=1; AL+hErHcSAP1qW5xZlYTHx9ahckJeoZRwFu4F5+kl0BSIZDfm1xEvLiOnIo2bhbgzK3j91l0dPYJyGcodLsHx50=@vger.kernel.org X-Gm-Message-State: APuU4Z9cfDlkUQ1Zx5c3Bj865IDRTU181prGMbWWbzJjykKBOeu4OVMN ZzHuHG45ie62CY28z72P423eVZ9MTw3YO9J7ZJgT7l9RnDviuQ+2ISZV X-Gm-Gg: AZFdTZfToKLY81e4++fyV1Mr6h25dzFofjEfQhS8Vq8gfR/dqNMrayJ4+7viS7Ixh+B i0565AMqvpPpuSs9Sa5TIjup9vlX1BhCLP/cDuAtG7BgDiADl6lGs8tQrQyoNCZzCgrTseaEPMX gh2QGRx6nKqG8/J6iXNZOcURksXEjZ+632diyL87FLJfRqiKiy5cePILN/yMAPh94Xa+GQt1e8W InWU1JTmz6Fvt/pEiwad7hO93+9Hu8wbAuxenLfyoetVfBmN1+Km11s0gTrhx2k5p9piuy2J6gH Td40FfvNg3GeLO61Z7XFar+DD+tSFdCAINlX0fhc20j7LgMb3oYMz09kZcj9JmcGuSWiG+rI6NO C8aAcrEgm5dL+SfXQdRt9hfQtRGvlwHybknVLx56TewOYJ38o2OoDhSeevNPupVAr8CNNtClvip LGwku18Y1B/684ev0hoy3bi8ZNbzgv5w9EPrFWbdYDLI1Qpr9Iv/md+LZfOXDDaVnUugvTAQwW/ jHeOYBTzNGErBXurIHZdw0+eazmawkgoMtA7F5YPuF43hdmoByP1tRbgg58WfOgZWlNEHcnc4RG YV5EcoK+LpT5HX9nJOI67hna7rS1YHQJYuY9L62ljyyLa+eSYyHw934= X-Received: by 2002:adf:e010:0:10b0:48c:58d5:30fb with SMTP id ffacd0b85a97d-4d1e2a13060mr2590800f8f.5.1796385079112; Fri, 04 Dec 2026 03:51:19 -0800 (PST) Received: from [192.168.1.22] ([83.231.69.9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d1723b8b54sm4331826f8f.17.2026.12.04.03.51.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 03:51:18 -0800 (PST) Message-ID: Date: Fri, 4 Dec 2026 12:51:15 +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 32/35] mm/hugetlb: stop accounting HugetlbPages once PMD tables were shared 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-32-9bbeabb555d2@kernel.org> Content-Language: en-US From: "Jose A. Perez de Azpillaga" In-Reply-To: <20261203-hugetlb_fixes_2-v2-32-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: > Sharing hugetlb PMD tables can leave HugetlbPages in /proc//status > too low or too high, or make it underflow: when (un)mapping a folio in a > shared PMD table, we only adjust mm->hugetlb_usage of the MM we process, > not of the other sharers. > > Accounting this precisely is not worth it for a statistic, so let's just > give up: once an MM shares a PMD table, set mm->hugetlb_usage of both > MMs to LONG_MIN / 2, and report negative values as 0. Later updates > cannot realistically make it positive again, as PMD table sharing is > 64-bit only. > > Document that HugetlbPages is 0 once a process shared hugetlb PMD page > tables. > > This has low urgency, as it only affects a statistic. 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