From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62D84C001DB for ; Thu, 10 Aug 2023 07:34:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C887C900002; Thu, 10 Aug 2023 03:34:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C388C8E0001; Thu, 10 Aug 2023 03:34:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD862900002; Thu, 10 Aug 2023 03:34:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 98E678E0001 for ; Thu, 10 Aug 2023 03:34:43 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 6AFB81A02F3 for ; Thu, 10 Aug 2023 07:34:43 +0000 (UTC) X-FDA: 81107382846.13.C8D910F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 27E901C0009 for ; Thu, 10 Aug 2023 07:34:40 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="B/zd3Prm"; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691652881; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=D0Ry+fkZv8z1/Gy9+eyaIW5JdKvKm7ZZHA1WFlt+VU0=; b=aSGRCTlFrOhowU196YqOkzNG36w6Ede4WZQTCnjTf6R4w0eeGkDbI1ONc6i8eKzz/Yoo60 /PauCnYUUs2CssI0K2b4FakBf17beUkAcPWmNGXzBxlo9rvGAJwpJ4U4WAX/rGUR3t64RZ ufGrECO8AD6JjObVaGEYKgqxTaFdpDE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691652881; a=rsa-sha256; cv=none; b=Y3+MZmbl+bpcUnOgnSwnA9QXPpTIFT/Mk1I6RB1irlZdBvbNEFjCXzv5WDnRVRadtGPgis uQ1XF9t1KAxkgqTEcq6TGsqPdHgFrqmLTVfdgcInhFZCicGWwWYZItKxrB8Yhx/QrU/lpZ FRwVkC7AvyZwA0cri5sz8m75BO9HlyY= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="B/zd3Prm"; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691652880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D0Ry+fkZv8z1/Gy9+eyaIW5JdKvKm7ZZHA1WFlt+VU0=; b=B/zd3PrmWrAtjupXn1DV8ecUUYa69ZZS9X5zPhg9ugB7BWbSNlj5ONtWUXZJ4xrdkmzrsE kVRzd98ATp+f+Q2obqjGdJpqG78cB0PPkUS0Vx459YhROKkLvp/3SZtkyGkdSdDpp+JW1S 2i3VaeKNnYzCfAeGYrbk/aN6uoZPcKQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-133-kxWIpHU6Nmm66tJY5FWBnw-1; Thu, 10 Aug 2023 03:34:37 -0400 X-MC-Unique: kxWIpHU6Nmm66tJY5FWBnw-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3fe661c0323so3943415e9.0 for ; Thu, 10 Aug 2023 00:34:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691652876; x=1692257676; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=D0Ry+fkZv8z1/Gy9+eyaIW5JdKvKm7ZZHA1WFlt+VU0=; b=kWbh9nbMLO1T83cBn+VwTrd3W4qB2iNiPBKNGCreNV1lWas+AApUAytyIRGjM1ydv3 FjKdiGNqL8A+zC/xe4mhwESc4hnVedBr4Mr447pclrNxviBq7yVXMM3O4GNJ0D9KZ4wV V5MwMWIkA657KxMMJP4YLohbcmTr01cNTu3UGnWgIuMgM1zOd58K226g7b3C13UEcrn/ pEstBsoQV1H61sPD4cny3q5Ol/Y4MEk0PjJ7TYv552TvrKFlKbtasMrVE9zryt2Q4zrM 4DRdRwtCYsDfewI0UUexkPwEJqSfLJtl4tcPUYDr6bsP2fSrMhL6fWWBRE5Lq5iT14j0 lPaw== X-Gm-Message-State: AOJu0YwXCtLx+d/W7NwggGjhPA7LJ7QJa3XtOsG9G56NuezeVlCR6UlI GPgbq2ic4KiDQg1oJjOBe0FROvpsJS61UGgGz6wXGk2CgpXV5623BXnA9EeOczOqLsaZdJKsje5 y/hFPbl7aC1aDK1pwCNQ= X-Received: by 2002:a5d:4042:0:b0:314:36f0:2214 with SMTP id w2-20020a5d4042000000b0031436f02214mr1338946wrp.6.1691652876063; Thu, 10 Aug 2023 00:34:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGF/nIFprF1hpTf4xBPCl2QhICVP0fTUC9NCuC3eDUngYbvlx5lIAwRoGyf0lfUDKDbrNDN5Q== X-Received: by 2002:a5d:4042:0:b0:314:36f0:2214 with SMTP id w2-20020a5d4042000000b0031436f02214mr1338930wrp.6.1691652875635; Thu, 10 Aug 2023 00:34:35 -0700 (PDT) Received: from ?IPV6:2a09:80c0:192:0:5dac:bf3d:c41:c3e7? ([2a09:80c0:192:0:5dac:bf3d:c41:c3e7]) by smtp.gmail.com with ESMTPSA id e9-20020a5d5949000000b003143add4396sm1201544wri.22.2023.08.10.00.34.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Aug 2023 00:34:35 -0700 (PDT) Message-ID: <396edcf4-2b43-ef2e-baa3-b732134b8f93@redhat.com> Date: Thu, 10 Aug 2023 09:34:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 1/4] mm/hugetlb: fix the inconsistency of /proc/sys/vm/nr_huge_pages To: Mike Kravetz , Xueshi Hu Cc: muchun.song@linux.dev, corbet@lwn.net, akpm@linux-foundation.org, n-horiguchi@ah.jp.nec.com, osalvador@suse.de, linux-mm@kvack.org References: <20230806074853.317203-1-xueshi.hu@smartx.com> <20230806074853.317203-2-xueshi.hu@smartx.com> <5c9ebf69-cd59-0fb3-bb85-1ab219426530@redhat.com> <79508337-08c1-7926-afd9-af21ee128949@smartx.com> <5b404d86-6b6f-b6c7-6286-f2ce3c4b5424@redhat.com> <42b78b9d-0a2f-c79d-0298-e4a7283a5633@smartx.com> <20230810001755.GC3537@monkey> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230810001755.GC3537@monkey> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Stat-Signature: 51nws78ic1gnomeyz7k4a14sapnacery X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 27E901C0009 X-Rspam-User: X-HE-Tag: 1691652880-557016 X-HE-Meta: U2FsdGVkX19Pj5e8N/YQl/I9PM4XAxHteW/Wfzva2L4ILJ3p/b2KBTs7FJxlX6gFkeqRdDMSWggbCQS7itBtS0DNkKDav9gkzJrMB6q1wlUPFOaRqaAJDuvr3rntjUeXwwl2iOnXNQwsm7Igiod3SEWVCweoOwgE1YEIIIF4Z3Rh0OFilJ3THU6SS+d+Qp93k9Q9V+4zhTtWdCGKlHyPYEp+wl58hqATbROVM7zUUrRpCRVXeFFqeh2EHIe4Bv8dGrAONmNH0OwsxmPgSySHtlNB5vjlvSeaEQhv7cIJkEQu9MdPwoQIpX9SAyy3Et2xumVGsb6yrcvg876b/xcQXP3Q5NDJ+TmMlWMKpZUXFVC39IKj9QhVSO6qIENTYgnMEmzTK3/eTjky0GWshd3DNqDMz49h3wivqzin1lk3n1xJ4rRgfqwS8V3JXeNe/L9ecMjSwJqc792N/ap785INllhqRzZvHImDCfijV1tvocvJsM994lrWZVd47WSx8aj+f2xM2mnNMn8o8oSO+gmgzeweA2m2zCCCVt7A1eFgkoZGtbJVMzw6crluOVD1IBNNCOSprEkPTsNJaN9c8M/UUnCBD0C+H3v4Nq7ZrOYSVrrIYsvcegOlv4lg3u5b3viO3h5Frs+seBOK/UVoMYWxZ6dqbSmIkC3xq3C3382pRPSHByWueaa7CYXCwwdOGOwT4xe1VEUDUTnmM9KaYhnx7AT4AsFB21DkFa3zmobP49EKvRpgH+X6n7feVb+xqDTkT3roPMoVFwNdQpuGZX5CcTdA/up0fO1Gtt474gy+FEJsg/NLIs9uzyIQFjhfmO/R5ZZf6aoLWYPwTMR2ajp+5x/E9QGW0hd3CtF54fnHx+qXStIIkzz/xKQ/t06/zgorFT9lPDeFd+MDQraDC7TgxOE23qDKm+iO4XNPJOIIf4vwMiclHfRMh7ZSMowumK13Jpa5j2vdTLWpeHmsiQV K1eRpdRv uWkpZz/Iau7SbJmBM3F332HugUBkwc6lY1QK3KxJQ9P/qt4+LXh2IN0+y2EEck3h2tt2Jrv9UJciONjrVRutxmsctE3HmIjcUbDR42xLici5FbmyIrzTOEyLmreFHe/bWTc0pffTHzjYglsj7CYkFTk5iBj0GBj2Vh8ODmIGYkvHroHVE56Bu702yakv9uuck2G+Usyp98UqUIgp8MgBU1K7kX1lZXpOJrYf2IJFXm8obe2+dEAHn60DrsoWZfhTEcPEwjzQbAmuJ4C9AKUvcWQ7q71syrxqth9gxyuit68TNgyogGo3XHvSmMezTT6iyihzr+VFhiBF9Wj5SYc3Tbrmu7x7EV83uW/Ee4715f9t3mlC1w0TxoqUo5/WhAGO2iudCI4Fuui+JKIfWfJrf+iB/o47ndYhcifLu9oprd27T3OnqGyOUuc9Ceou52kaXwCFAlxXnOef69LwDHKoliRaP/qp9AnZPQ1arnMk4IJirSjE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 10.08.23 02:17, Mike Kravetz wrote: > On 08/08/23 17:13, Xueshi Hu wrote: >> On 8/8/23 15:58, David Hildenbrand wrote: >>> On 08.08.23 04:28, Xueshi Hu wrote: >>>> On 8/7/23 23:15, David Hildenbrand wrote: >>>>> On 06.08.23 09:48, Xueshi Hu wrote: > > Sorry for jumping in late, I was away for a while. > > Hu and myself discussed this previously in, > https://lore.kernel.org/linux-mm/20230802182031.GA4762@monkey/T/#r1bdc8eeebafa08699fda5b15f247f3f966ddd090 > > The documentation around what is displayed with the hugetlb proc/sys > interfaces is at best confusing and at worst wrong in places. > > One source of confusion is use of term 'persistent hugetlb pages'. The > documentation does not define this term. However, there is this > definition in the code: > #define persistent_huge_pages(h) (h->nr_huge_pages - h->surplus_huge_pages) > > All of the write/update interfaces modify the number of persistent hugetlb > pages as defined by the code (#define). Only one read/show interface > displays the number of persistent hugetlb pages as defined by the code > (#define). That is /proc/sys/vm/nr_hugepages (and sysctl). Yes. > > When thinking about this more, I am 'guessing' that when the documentation was > originally written the term 'persistent hugetlb pages' did not refer to the > #define in the code. Rather, it was just the number of allocated hugetlb pages > that 'persisted' until modified by the admin/user. > > There is little doubt the documentation could/should be updated. Absolutely. > > The question is 'Should we change the /proc/sys/vm/nr_hugepages (and sysctl) > interfaces to be consistent with all the other read/show interfaces? > > The argument for changing is that consistency is good. Why have one interface > that is not like the others? > > The reason for not changing is that this is the oldest interface. The > information/interfaces originally available in /proc were created in /sys. > And, as mentioned in the documentation the /proc interfaces were kept > for backward compatibility. Unfortunately, the meaning of nr_hugepages > was changed the /sys interfaces were created. Sigh!!! Indeed, they were designed to be different and to just leave the /proc interface alone. > > In the thread mentioned above, I was in agreement with Hu about changing > /proc/sys/vm/nr_hugepages to be consistent with other read/show interfaces. > Now, I am not sure. My take would be to just leave /proc/sys/vm/nr_hugepages alone. Maybe pr_warn_once() when the interface is used to guide people away from that legacy interface + clarify the docs. Your call. :) -- Cheers, David / dhildenb