Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp779552ybh; Wed, 11 Mar 2020 10:37:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvOak2/+6WBxcKUwDYboGk8AvvZTEQwpeP8jOEYjVpIuBtW9re9tMbtBdj1UQdJSkwnIfRp X-Received: by 2002:a05:6830:4a6:: with SMTP id l6mr3370862otd.61.1583948243258; Wed, 11 Mar 2020 10:37:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583948243; cv=none; d=google.com; s=arc-20160816; b=Wx1rfLkqH1Au1f3RgW6uamjRLCzS5xOoKndQMDOOMeOjdMzMx6kL0e+1kfVL6xalho Wj1+Tv90TMcTpWpkW8eBInQlFxB/UTTQRCECswvx9QVqsYkg0mAzXNRvBt211RdZ8tU7 PPfTdnU4+VZoYeSdFPzsRCYlSYILcysmjYHCBYoW0fJld2px9JCOQtx/F38XjKWL/bqm rfkpw4cmb0/h9bXz3/cdMPowSVgmKQVj0fwOj0fcxxC7O8IunilBi7gVnqLXTxWxPb6a PlzX8xaZquLzBoh+FsMXC1h9+xSB8KmbjdtyquNkCx/UyYuzEg8UKLe+NQhhKYVabZE9 GM2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ul3aKF3mgmNSrCiKZR1xszeDpKLTrhtBGKS0nAOe96I=; b=QE+jI6YrFDhm+aEousGqufIotT2Vig0OdlE8UgSSZi1Oprr2tNc4c90ijpurgbuzkS XWBgIijEzibvbrGxhQxJt0LZiJczCPqUbqxZPJlnNs+jcGPAlJdvzcwQHbohfGgLRE2B lD32csGo+bqUbpV6PH1ilp3bkxx+IhQrWqU+oC2DYh6jP3JGIIXCenkt+/itLlIUbuuj lLpJShj3rr8aA76Iuy8lMiB5hXWVPR28PZsecMDiWc0E/aOGBxXJecI6Wu9fzG5E2Z1W dK8GZpLcLhePUwfgiBPKD5QJ852+WAS8xSl+5x2IEXZruC119CXD/B3ZQ+OwgJeHs9ii wQgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Qxv1kSHh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 94si1369513otb.114.2020.03.11.10.37.11; Wed, 11 Mar 2020 10:37:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Qxv1kSHh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730634AbgCKRf4 (ORCPT + 99 others); Wed, 11 Mar 2020 13:35:56 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37852 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbgCKRfz (ORCPT ); Wed, 11 Mar 2020 13:35:55 -0400 Received: by mail-wr1-f66.google.com with SMTP id 6so3744984wre.4 for ; Wed, 11 Mar 2020 10:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ul3aKF3mgmNSrCiKZR1xszeDpKLTrhtBGKS0nAOe96I=; b=Qxv1kSHhmiyl18Lg2mWDZPGmXfwOrbANLmtvAgLq2LDLT4t5EMSGVFbTQ0T7HnVUVC /El7DtDiEORVt9HKOrXAvI53eA3ZjgKAh3xoy5kjaVBE2OwCQPnczmJXs2UCRN58QwEY nrOpJ/cQR0ULP4WPL/gjVtx2SnEEjvJp610a6X85Ou8I0za0dBWskFn4m+JdxiaEEc8i IFgGTtV7w7h/D7nm4FAlQn0lvzYNfHdCon//XQInYH1YHgMmu6IqVsBKjL0wl4YLoVq4 2+DCA5uZrFKQoWq5nY5ISU1UlfRZCd32gjj6Da0JK1KvIBa8ky1OTK6lh2qDENVtMezh UFsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ul3aKF3mgmNSrCiKZR1xszeDpKLTrhtBGKS0nAOe96I=; b=U4FEctP9Z++dazJmQSnSObPUZQjq+gFLP/RmBAi+XKHesDqsJA+0d3B6YaK7p6HnQV O0XHelTQQ3qSl1x5Gued922N10jWFKpgc6iHbX82sWqKWAwMvYlJctbj9ZSZsEIePQy6 C93r0pULHsSaM8ez3Cw/Fc56+ZrxXz26z+IbIVY/zpXjY+54paYk7DO/auUaXdxANhBs xGf4q2aSaSLIvC1ayU3pM/pXtJ5fHUb/WROMZszN3WDMfbvgYYuPW92zFFxRe9srb27s Kn4LhuMB9xu0CqXSnDjicGU6zGDn7pCiBIyjqYgvbXUe99UCAVpqJKdNcoMck60IOQG/ BpzQ== X-Gm-Message-State: ANhLgQ1guU9S24l/7odh/gFDncnAa9W81vKFZpp5GUsiZqD2Ljn78WJU WQW9YgD4TCCPGJWYTB0DCw== X-Received: by 2002:adf:e447:: with SMTP id t7mr5687572wrm.374.1583948154005; Wed, 11 Mar 2020 10:35:54 -0700 (PDT) Received: from avx2 ([46.53.249.42]) by smtp.gmail.com with ESMTPSA id y69sm9437327wmd.46.2020.03.11.10.35.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 10:35:53 -0700 (PDT) Date: Wed, 11 Mar 2020 20:35:50 +0300 From: Alexey Dobriyan To: Jaewon Kim Cc: akpm@linux-foundation.org, labbott@redhat.com, sumit.semwal@linaro.org, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com Subject: Re: [RFC PATCH 1/3] proc/meminfo: introduce extra meminfo Message-ID: <20200311173550.GA2170@avx2> References: <20200311034441.23243-1-jaewon31.kim@samsung.com> <20200311034441.23243-2-jaewon31.kim@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200311034441.23243-2-jaewon31.kim@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 11, 2020 at 12:44:39PM +0900, Jaewon Kim wrote: > Provide APIs to drivers so that they can show its memory usage on > /proc/meminfo. > > int register_extra_meminfo(atomic_long_t *val, int shift, > const char *name); > int unregister_extra_meminfo(atomic_long_t *val); > + show_val_kb(m, memtemp->name_pad, nr_page); I have 3 issues. Can this be printed without "KB" piece and without useless whitespace, like /proc/vmstat does? I don't know how do you parse /proc/meminfo. Do you search for specific string or do you use some kind of map[k] = v interface? 2) zsmalloc can create top-level symlink and resolve it to necessary value. It will be only 1 readlink(2) system call to fetch it. 3) android can do the same For simple values there is no need to register stuff and create mini subsystems. /proc/alexey