Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752646AbbHaJMl (ORCPT ); Mon, 31 Aug 2015 05:12:41 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:35967 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751514AbbHaJMk (ORCPT ); Mon, 31 Aug 2015 05:12:40 -0400 Date: Mon, 31 Aug 2015 11:12:37 +0200 From: Michal Hocko To: =?iso-8859-1?Q?J=F6rn?= Engel Cc: David Rientjes , Naoya Horiguchi , Andrew Morton , Mike Kravetz , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Naoya Horiguchi Subject: Re: [PATCH v5 2/2] mm: hugetlb: proc: add HugetlbPages field to /proc/PID/status Message-ID: <20150831091236.GC29723@dhcp22.suse.cz> References: <20150820110004.GB4632@dhcp22.suse.cz> <20150820233450.GB10807@hori1.linux.bs1.fc.nec.co.jp> <20150821065321.GD23723@dhcp22.suse.cz> <20150821163033.GA4600@Sligo.logfs.org> <20150824085127.GB17078@dhcp22.suse.cz> <20150826063813.GA25196@dhcp22.suse.cz> <20150827064817.GB14367@dhcp22.suse.cz> <20150827172351.GA29092@Sligo.logfs.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150827172351.GA29092@Sligo.logfs.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2495 Lines: 58 On Thu 27-08-15 10:23:51, J?rn Engel wrote: > On Thu, Aug 27, 2015 at 08:48:18AM +0200, Michal Hocko wrote: > > > > > On x86, HUGE_MAX_HSTATE == 2. I don't consider that to be expensive. > > > > > > If you are concerned about the memory allocation of struct hugetlb_usage, > > > it could easily be embedded directly in struct mm_struct. > > > > Yes I am concerned about that and > > 9 files changed, 112 insertions(+), 1 deletion(-) > > for something that is even not clear to be really required. And I still > > haven't heard any strong usecase to justify it. > > > > Can we go with the single and much simpler cumulative number first and > > only add the break down list if it is _really_ required? We can even > > document that the future version of /proc//status might add an > > additional information to prepare all the parsers to be more careful. > > I don't care much which way we decide. But I find your reasoning a bit > worrying. If someone asks for a by-size breakup of hugepages in a few > years, you might have existing binaries that depend on the _absence_ of > those extra characters on the line. > > Compare: > HugetlbPages: 18432 kB > HugetlbPages: 1069056 kB (1*1048576kB 10*2048kB) > > Once someone has written a script that greps for 'HugetlbPages:.*kB$', > you have lost the option of adding anything else to the line. If you think that an explicit note in the documentation is not sufficient then I believe we can still handle it backward compatible. Like separate entries for each existing hugetlb page: HugetlbPages: 1069056 kB Hugetlb2MPages: 20480 kB Hugetlb1GPages: 1048576 kB or something similar. I would even argue this would be slightly easier to parse. So it is not like we would be locked into anything. > You have > created yet another ABI compatibility headache today in order to save > 112 lines of code. > > That may be a worthwhile tradeoff, I don't know. But at least I realize > there is a cost, while you seem to ignore that component. There is > value in not painting yourself into a corner. My primary point was that we are adding a code for a feature nobody actually asked for just because somebody might ask for it in future. -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/