On 08/10/23 09:34, David Hildenbrand wrote: > 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: > > > > 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. > I am not sure if this was the 'design'. The commit to add the sysfs interfaces is a3437870160c from 2008. There is no mention of changing the meaning of nr_hugepages when read/displayed. It matters not if this was by design. It has been this way for 15 years and has become the expected behavior. > > > > 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. Now, I tend to agree that not modifying /proc/sys/vm/nr_hugepages may be the right thing to do. I 'know' of a DB that makes extensive use of this and the corresponding sysctl interface. A pr_warn_once() may help, but I still see the warning "Using mlock ulimits for SHM_HUGETLB is obsolete" in system logs. :( > Your call. :) I REALLY would like it if all these interfaces were consistent and showed the same information. However, this inconsistency has been there for 15+ years. And, I know of users making extensive use of /proc/sys/vm/nr_hugepages. Hu, did you get a report of this inconsistency from a customer/end user? Or, is this something you and other developers noticed? -- Mike Kravetz