From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753255AbcHOQZa (ORCPT ); Mon, 15 Aug 2016 12:25:30 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:50808 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753105AbcHOQZ0 (ORCPT ); Mon, 15 Aug 2016 12:25:26 -0400 Subject: Re: [PACTH v2 0/3] Implement /proc//totmaps To: Michal Hocko References: <1471039462-16771-1-git-send-email-robert.foss@collabora.com> <20160814090430.GB9248@dhcp22.suse.cz> <20160815134227.GE3360@dhcp22.suse.cz> Cc: corbet@lwn.net, akpm@linux-foundation.org, vbabka@suse.cz, koct9i@gmail.com, hughd@google.com, n-horiguchi@ah.jp.nec.com, minchan@kernel.org, john.stultz@linaro.org, ross.zwisler@linux.intel.com, jmarchan@redhat.com, hannes@cmpxchg.org, keescook@chromium.org, viro@zeniv.linux.org.uk, gorcunov@openvz.org, plaguedbypenguins@gmail.com, rientjes@google.com, eric.engestrom@imgtec.com, jdanis@google.com, calvinowens@fb.com, adobriyan@gmail.com, jann@thejh.net, sonnyrao@chromium.org, kirill.shutemov@linux.intel.com, ldufour@linux.vnet.ibm.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Ben Zhang , Bryan Freed , Filipe Brandenburger , Mateusz Guzik From: Robert Foss Message-ID: Date: Mon, 15 Aug 2016 12:25:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160815134227.GE3360@dhcp22.suse.cz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016-08-15 09:42 AM, Michal Hocko wrote: > On Mon 15-08-16 09:00:04, Robert Foss wrote: >> >> >> On 2016-08-14 05:04 AM, Michal Hocko wrote: >>> On Fri 12-08-16 18:04:19, robert.foss@collabora.com wrote: >>>> From: Robert Foss >>>> >>>> This series implements /proc/PID/totmaps, a tool for retrieving summarized >>>> information about the mappings of a process. >>> >>> The changelog is absolutely missing the usecase. Why do we need this? >>> Why existing interfaces are not sufficient? >> >> You are absolutely right, more info information is in 1/3. > > Patch 1 is silent about the use case as well. It is usually recommended > to describe the motivation for the change in the cover letter. I'll change it for v3. > >> But the gist of it is that it provides a faster and more convenient way of >> accessing the information in /proc/PID/smaps. > > I am sorry to insist but this is far from a description I was hoping > for. Why do we need a more convenient API? Please note that this is a > userspace API which we will have to maintain for ever. We have made many > mistakes in the past where exporting some information made sense at the > time while it turned out being a mistake only later on. So let's make > sure we will not fall into the same trap again. > > So please make sure you describe the use case, why the current API is > insufficient and why it cannot be tweaked to provide the information you > are looking for. > I'll add a more elaborate description to the v3 cover letter. In v1, there was a discussion which I think presented the practical applications rather well: https://lkml.org/lkml/2016/8/9/628 or the qoute from Sonny Rao pasted below: > The use case is to speed up monitoring of > memory consumption in environments where RSS isn't precise. > > For example Chrome tends to many processes which have hundreds of VMAs > with a substantial amount of shared memory, and the error of using > RSS rather than PSS tends to be very large when looking at overall > memory consumption. PSS isn't kept as a single number that's exported > like RSS, so to calculate PSS means having to parse a very large smaps > file. > > This process is slow and has to be repeated for many processes, and we > found that the just act of doing the parsing was taking up a > significant amount of CPU time, so this patch is an attempt to make > that process cheaper. If a reformatted version of this still isn't adequate or desirable for the cover-letter, please give me another heads up. Thanks!