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 X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AAA8C43457 for ; Mon, 19 Oct 2020 17:23:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21688223AE for ; Mon, 19 Oct 2020 17:23:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="o9jkQBUp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730916AbgJSRXk (ORCPT ); Mon, 19 Oct 2020 13:23:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730336AbgJSRXk (ORCPT ); Mon, 19 Oct 2020 13:23:40 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA027C0613D0 for ; Mon, 19 Oct 2020 10:23:39 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id l28so392480lfp.10 for ; Mon, 19 Oct 2020 10:23:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iyXXWfOQa+1d+k4Kfi8s1b5PhoxBW70UL1MRANY5iTA=; b=o9jkQBUpkBGEwOPcru1DIzTI4hADMkSZb2pfw2EQWRKUHSYKt6lOgBGbe0/PbjBsyj gkCeKyOJfMcHu8JQBuIGXYq2bMyUO23p7qpUH07+K7VJuHC15dj9M6Jixv+0kGJ3I484 bibfM3wj1lSg02RVEGxrX4Vn06BnYQ9Fkpzq6GOiAp/P6ZC5OVnYSRqS0zxc14K0j6WJ cCjXupRPGQ3TQDsCBLaS0PxaOBRob35h4AyY0tvNebkGYNGxcnr2o07kc5d9g5o6COFY ILq2uDK4Y0klCUbaiEoIjmZxvz8kx/FNpsGUPC+D11xVFrfoxaJk055Yiql09wfYplO5 TC/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iyXXWfOQa+1d+k4Kfi8s1b5PhoxBW70UL1MRANY5iTA=; b=g84pTZlLTFA4yY58vipCSBe87ev1IQ+Q313C8H5qAc8fNEYF/tskSHPVinpbOiqfvK RcDFAeOCiQsN5DJ1+9OXXV9gbEemcirn7+G/RuH5Lweoo1X0922SYn14C5tqMuWl9h/1 vebq9oNTmyudjnTokR4nuZot3LyTAzUz//kK55P9hWTjI/CMdZ1FouFbTQqqJ9dx5lPu 6xCmG3H2gI1g1tpOpaKKJlGKKlCcTj1+v97/wuXzrbG/beUigHjsy0U1ZUVk081DNSvv KQE+dbZGbrgxawnfv3sQHsNfi1fp9JEaMVslvhu/JzdE+ud6BS3njc3EPggMntCN7mVg OOpg== X-Gm-Message-State: AOAM532d3hI+SQifwxxmM+sH7mEEy0p0lzfrMYCDWAHOuNqUY9Gm8qmD KS2KhO3NzGlr74QvLH6nGLkou1Rp3suI6/n/RYxQmQ== X-Google-Smtp-Source: ABdhPJwSXb1dY6AgaVzNQLt+reDscKrvoARfXRBXfeo2h9MZNArk1CXUTqLg5bs0YhI3mYrfPTwBL8qmTMYBnfbcX4E= X-Received: by 2002:a19:d10:: with SMTP id 16mr216317lfn.385.1603128217818; Mon, 19 Oct 2020 10:23:37 -0700 (PDT) MIME-Version: 1.0 References: <20201010103854.66746-1-songmuchun@bytedance.com> <9262ea44-fc3a-0b30-54dd-526e16df85d1@gmail.com> <20201013080906.GD4251@kernel.org> <8d1558e7-cd09-1f9e-edab-5f22c5bfc342@suse.cz> <20201016205336.GE1976566@google.com> In-Reply-To: <20201016205336.GE1976566@google.com> From: Shakeel Butt Date: Mon, 19 Oct 2020 10:23:26 -0700 Message-ID: Subject: Re: [External] Re: [PATCH] mm: proc: add Sock to /proc/meminfo To: Minchan Kim , Paolo Bonzini Cc: Vlastimil Babka , Mike Rapoport , Muchun Song , Eric Dumazet , Eric Dumazet , Cong Wang , Greg KH , rafael@kernel.org, "Michael S. Tsirkin" , Jason Wang , David Miller , Jakub Kicinski , Alexey Dobriyan , Andrew Morton , Alexey Kuznetsov , Hideaki YOSHIFUJI , Steffen Klassert , Herbert Xu , Will Deacon , Michal Hocko , Roman Gushchin , Neil Brown , Sami Tolvanen , "Kirill A. Shutemov" , Feng Tang , Paolo Abeni , Willem de Bruijn , Randy Dunlap , Florian Westphal , gustavoars@kernel.org, Pablo Neira Ayuso , Dexuan Cui , Jakub Sitnicki , Peter Zijlstra , Christian Brauner , "Eric W. Biederman" , Thomas Gleixner , Davidlohr Bueso , Michel Lespinasse , Jann Horn , chenqiwu@xiaomi.com, Christophe Leroy , Martin KaFai Lau , Alexei Starovoitov , Daniel Borkmann , Miaohe Lin , Kees Cook , LKML , virtualization@lists.linux-foundation.org, Linux Kernel Network Developers , linux-fsdevel , linux-mm , Michael Kerrisk Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org CCed: Paolo Bonzini On Fri, Oct 16, 2020 at 1:53 PM Minchan Kim wrote: [snip] > > And there might be others, and adding everything to /proc/meminfo is not > > feasible. I have once proposed adding a counter called "Unaccounted:" which > > would at least tell the user easily if a significant portion is occupied by > > memory not explained by the other meminfo counters, and look for trends > > (increase = potential memory leak?). For specific prominent consumers not > > covered by meminfo but that have some kind of internal counters, we could > > document where to look, such as /proc/net/sockstat or maybe create some > > /proc/ or /sys directory with file per consumer so that it's still easy to > > check, but without the overhead of global counters and bloated > > /proc/meminfo? > > What have in my mind is to support simple general sysfs infra from MM for > driver/subysstems rather than creating each own memory stat. The API > could support flexible accounting like just global memory consumption and/or > consmption by key(e.g,. pid or each own special) for the detail. > > So, they are all shown under /sys/kernel/mm/misc/ with detail as well as > /proc/meminfo with simple line for global. This reminds me of statsfs [1]. I am wondering if this can be another useful use-case for statsfs. [1] https://lkml.org/lkml/2020/5/26/332