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=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 C3843C433DF for ; Sun, 11 Oct 2020 18:39:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70757207FB for ; Sun, 11 Oct 2020 18:39:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="omOg9nng" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727319AbgJKSjP (ORCPT ); Sun, 11 Oct 2020 14:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbgJKSjO (ORCPT ); Sun, 11 Oct 2020 14:39:14 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8EF5C0613CE; Sun, 11 Oct 2020 11:39:14 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id n6so15408703ioc.12; Sun, 11 Oct 2020 11:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ihDBvmS0ut4DSKeE1V92ZLXhV60yzQeKm7MqEH3UbkE=; b=omOg9nngjeH2F9Dbb/TM0VIWCX3UYpHtX8QXXKU6Wi49Z7HBxoh8JJj0LrEs6V21k+ IDFr+Xql22OeBgc7PX013oOTHyG9DTA2sG9CSgHvHnB9jsA58+YS0h7p91sSzydfrlN9 1RZg0onwhTMveQ1nYGOEpbpcfcowZoubULaRr9Q2fJ4t7bFGKDA9nAFjNnsyvFl151K9 q9wsmMGQoFNeUcKJ37tVf5HEUTY1JmYRc29u+gu6eT7BvYCiSBC12GxBgiIvtnSF8sOr JxSb58k1ZrKUUBSJmZDLdEWidS8VzAeUftUUbacInWRnlXcz3yxhcwzbam9z9Ks1E/rG M+rQ== 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=ihDBvmS0ut4DSKeE1V92ZLXhV60yzQeKm7MqEH3UbkE=; b=D+EAFSUk3J51UIdkkq3UkZPSDDTjY2/IblHALbwE+PiISRa6LtRA6TKuQcnYmqN3TB 05zhewBOJwNwjhem1D+aRIXNdsr2grfkRKC5Yi7/QsOB3PUg/oZE2B6y35zP1uj2Sh+s F//Vrp92fQNh/zmfusPsyuUF9cshQDfD/n+mgSiT0Pi0gJgheIiqIRIATWqU8MvrXi5i cNABOR9Ze5leObSH9HyR7+lj1uUKFJnSlWlEnhh3meVOCdKdjPVhZQ4eu3PplH9hLdmZ cQwCiHNrUB/AzADULoZy+2JVdp5ELKG/6tx43k7jrNdU/3YotoE1AOR4f+Se3ZyOggW6 mFJA== X-Gm-Message-State: AOAM531Pal6LIqdUgYuKzZYOfmNFagpifflmi284He1d1RxHTQJW+Ruu VT+OcdW8cAEEa44EcVDxd6M7lIiBvXGszslyzg8= X-Google-Smtp-Source: ABdhPJxTF0j2v/9fJi8BunRtQlxMSiClZGK5c3sE9XRmWV7VBvPIX40VOP59eN5kOLWvuAg4icWlgLsDpVCM1/QHaos= X-Received: by 2002:a02:94cd:: with SMTP id x71mr16450243jah.124.1602441553813; Sun, 11 Oct 2020 11:39:13 -0700 (PDT) MIME-Version: 1.0 References: <20201010103854.66746-1-songmuchun@bytedance.com> In-Reply-To: <20201010103854.66746-1-songmuchun@bytedance.com> From: Cong Wang Date: Sun, 11 Oct 2020 11:39:02 -0700 Message-ID: Subject: Re: [PATCH] mm: proc: add Sock to /proc/meminfo To: Muchun Song Cc: Greg KH , rafael@kernel.org, "Michael S. Tsirkin" , Jason Wang , David Miller , Jakub Kicinski , Alexey Dobriyan , Andrew Morton , Eric Dumazet , Alexey Kuznetsov , Hideaki YOSHIFUJI , Steffen Klassert , Herbert Xu , shakeelb@google.com, will@kernel.org, Michal Hocko , Roman Gushchin , Neil Brown , rppt@kernel.org, samitolvanen@google.com, "Kirill A. Shutemov" , Feng Tang , Paolo Abeni , Willem de Bruijn , Randy Dunlap , Florian Westphal , gustavoars@kernel.org, Pablo Neira Ayuso , decui@microsoft.com, Jakub Sitnicki , Peter Zijlstra , Christian Brauner , "Eric W. Biederman" , Thomas Gleixner , dave@stgolabs.net, walken@google.com, Jann Horn , chenqiwu@xiaomi.com, christophe.leroy@c-s.fr, Minchan Kim , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 10, 2020 at 3:39 AM Muchun Song wrote: > > The amount of memory allocated to sockets buffer can become significant. > However, we do not display the amount of memory consumed by sockets > buffer. In this case, knowing where the memory is consumed by the kernel We do it via `ss -m`. Is it not sufficient? And if not, why not adding it there rather than /proc/meminfo? > static inline void __skb_frag_unref(skb_frag_t *frag) > { > - put_page(skb_frag_page(frag)); > + struct page *page = skb_frag_page(frag); > + > + if (put_page_testzero(page)) { > + dec_sock_node_page_state(page); > + __put_page(page); > + } > } You mix socket page frag with skb frag at least, not sure this is exactly what you want, because clearly skb page frags are frequently used by network drivers rather than sockets. Also, which one matches this dec_sock_node_page_state()? Clearly not skb_fill_page_desc() or __skb_frag_ref(). Thanks. 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=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 7556EC433E7 for ; Sun, 11 Oct 2020 18:39:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E2637207FB for ; Sun, 11 Oct 2020 18:39:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="omOg9nng" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2637207FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 18672940007; Sun, 11 Oct 2020 14:39:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1371B900002; Sun, 11 Oct 2020 14:39:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F19FF940007; Sun, 11 Oct 2020 14:39:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id C52DA900002 for ; Sun, 11 Oct 2020 14:39:15 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5C77A181AE865 for ; Sun, 11 Oct 2020 18:39:15 +0000 (UTC) X-FDA: 77360507070.25.nerve99_3f10919271f4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 2E27A1804E3A0 for ; Sun, 11 Oct 2020 18:39:15 +0000 (UTC) X-HE-Tag: nerve99_3f10919271f4 X-Filterd-Recvd-Size: 5332 Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Sun, 11 Oct 2020 18:39:14 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id g7so15351453iov.13 for ; Sun, 11 Oct 2020 11:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ihDBvmS0ut4DSKeE1V92ZLXhV60yzQeKm7MqEH3UbkE=; b=omOg9nngjeH2F9Dbb/TM0VIWCX3UYpHtX8QXXKU6Wi49Z7HBxoh8JJj0LrEs6V21k+ IDFr+Xql22OeBgc7PX013oOTHyG9DTA2sG9CSgHvHnB9jsA58+YS0h7p91sSzydfrlN9 1RZg0onwhTMveQ1nYGOEpbpcfcowZoubULaRr9Q2fJ4t7bFGKDA9nAFjNnsyvFl151K9 q9wsmMGQoFNeUcKJ37tVf5HEUTY1JmYRc29u+gu6eT7BvYCiSBC12GxBgiIvtnSF8sOr JxSb58k1ZrKUUBSJmZDLdEWidS8VzAeUftUUbacInWRnlXcz3yxhcwzbam9z9Ks1E/rG M+rQ== 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=ihDBvmS0ut4DSKeE1V92ZLXhV60yzQeKm7MqEH3UbkE=; b=E0TBRBMTnhdXuHkZNeX4uJPttRJKe4ELVi56+ZJCkMjaYuyTcP8Xu1x9YmOA0WAlA6 LkvLcCPAr3x1i9jnEyU57afyhQiYPxdT7lwPn5JuvRJ94QchTpi7Uaj3sjFIRoJrupog SKb2B99JS9cFyAANtc5WL3IV3odQkGy409tdV9wepYIF43Aiy6+0J+UeryLoyYSmPHmP YyXUtfPz/hQp6VfhiaHIyyUj2LbaLVtYZXVAs3i5958JIE0eCDYTsN48VoflYdb9EoiX 8Yka+a1yAmbCi9zhEjoboLv1k+oli58zHNWdnVmfmO+jP79B3LFrcANpC5r/lqt1AAF7 MZIw== X-Gm-Message-State: AOAM533hobOyXfqzc8Y3k5lT+lCKJTgFHs+Zz1hkTpcYv+tXqHisF6vj 7l+CF5/qcXUyayCsOdZuo/ovMOK9XbezXd//xsE= X-Google-Smtp-Source: ABdhPJxTF0j2v/9fJi8BunRtQlxMSiClZGK5c3sE9XRmWV7VBvPIX40VOP59eN5kOLWvuAg4icWlgLsDpVCM1/QHaos= X-Received: by 2002:a02:94cd:: with SMTP id x71mr16450243jah.124.1602441553813; Sun, 11 Oct 2020 11:39:13 -0700 (PDT) MIME-Version: 1.0 References: <20201010103854.66746-1-songmuchun@bytedance.com> In-Reply-To: <20201010103854.66746-1-songmuchun@bytedance.com> From: Cong Wang Date: Sun, 11 Oct 2020 11:39:02 -0700 Message-ID: Subject: Re: [PATCH] mm: proc: add Sock to /proc/meminfo To: Muchun Song Cc: Greg KH , rafael@kernel.org, "Michael S. Tsirkin" , Jason Wang , David Miller , Jakub Kicinski , Alexey Dobriyan , Andrew Morton , Eric Dumazet , Alexey Kuznetsov , Hideaki YOSHIFUJI , Steffen Klassert , Herbert Xu , shakeelb@google.com, will@kernel.org, Michal Hocko , Roman Gushchin , Neil Brown , rppt@kernel.org, samitolvanen@google.com, "Kirill A. Shutemov" , Feng Tang , Paolo Abeni , Willem de Bruijn , Randy Dunlap , Florian Westphal , gustavoars@kernel.org, Pablo Neira Ayuso , decui@microsoft.com, Jakub Sitnicki , Peter Zijlstra , Christian Brauner , "Eric W. Biederman" , Thomas Gleixner , dave@stgolabs.net, walken@google.com, Jann Horn , chenqiwu@xiaomi.com, christophe.leroy@c-s.fr, Minchan Kim , 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 Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Oct 10, 2020 at 3:39 AM Muchun Song wrote: > > The amount of memory allocated to sockets buffer can become significant. > However, we do not display the amount of memory consumed by sockets > buffer. In this case, knowing where the memory is consumed by the kernel We do it via `ss -m`. Is it not sufficient? And if not, why not adding it there rather than /proc/meminfo? > static inline void __skb_frag_unref(skb_frag_t *frag) > { > - put_page(skb_frag_page(frag)); > + struct page *page = skb_frag_page(frag); > + > + if (put_page_testzero(page)) { > + dec_sock_node_page_state(page); > + __put_page(page); > + } > } You mix socket page frag with skb frag at least, not sure this is exactly what you want, because clearly skb page frags are frequently used by network drivers rather than sockets. Also, which one matches this dec_sock_node_page_state()? Clearly not skb_fill_page_desc() or __skb_frag_ref(). Thanks. 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=-3.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 DEF6BC43467 for ; Sun, 11 Oct 2020 18:39:18 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7987A207FB for ; Sun, 11 Oct 2020 18:39:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="omOg9nng" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7987A207FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 09ACC87280; Sun, 11 Oct 2020 18:39:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SckHv0rkpaXB; Sun, 11 Oct 2020 18:39:17 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 7866E87150; Sun, 11 Oct 2020 18:39:17 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 56C3BC0052; Sun, 11 Oct 2020 18:39:17 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 50ED8C0051 for ; Sun, 11 Oct 2020 18:39:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3785B84CEB for ; Sun, 11 Oct 2020 18:39:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VgrK_780l7Fc for ; Sun, 11 Oct 2020 18:39:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id AD0BD84C4E for ; Sun, 11 Oct 2020 18:39:14 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id q9so15408979iow.6 for ; Sun, 11 Oct 2020 11:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ihDBvmS0ut4DSKeE1V92ZLXhV60yzQeKm7MqEH3UbkE=; b=omOg9nngjeH2F9Dbb/TM0VIWCX3UYpHtX8QXXKU6Wi49Z7HBxoh8JJj0LrEs6V21k+ IDFr+Xql22OeBgc7PX013oOTHyG9DTA2sG9CSgHvHnB9jsA58+YS0h7p91sSzydfrlN9 1RZg0onwhTMveQ1nYGOEpbpcfcowZoubULaRr9Q2fJ4t7bFGKDA9nAFjNnsyvFl151K9 q9wsmMGQoFNeUcKJ37tVf5HEUTY1JmYRc29u+gu6eT7BvYCiSBC12GxBgiIvtnSF8sOr JxSb58k1ZrKUUBSJmZDLdEWidS8VzAeUftUUbacInWRnlXcz3yxhcwzbam9z9Ks1E/rG M+rQ== 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=ihDBvmS0ut4DSKeE1V92ZLXhV60yzQeKm7MqEH3UbkE=; b=JDH6X+edd8r2ogQLiicHiLTdn3jOZ2DZjk6Xsdqak5LNTpU4iFqA9BtwHH688lh/Fy MwAAjY7o/zMmyXiZ+YVulQdbsYsKE598cGerSCIFB8yAVzFs3Z5T1cJzk/3gS29vXAdj j+NRf14l5kC31t8nBHB+HoUeXIalxXWJIAzpqhOY5g+7427H6PhIkWDuV9vqSNetOX12 MwNkdT5Z05pmfidDZbZcMO3G74nWNucCyAfaULwKUwm5Y33uKPct9ohbEDYrfoL82yxH cvQc+uOwZCS/VASbiuw73jARBLhttcLX3Na8ROCCdIIcTGiuzSskc7XR92BV2kAZD9Ze NPXQ== X-Gm-Message-State: AOAM530150Y9WhzxtcnAqNXLf/RIQtmWTSLFHsxakgAKpAig13DUdB12 Ry/neKPEpoUj0IvBJYqURM2JEu6tXxk1lUIbY5I= X-Google-Smtp-Source: ABdhPJxTF0j2v/9fJi8BunRtQlxMSiClZGK5c3sE9XRmWV7VBvPIX40VOP59eN5kOLWvuAg4icWlgLsDpVCM1/QHaos= X-Received: by 2002:a02:94cd:: with SMTP id x71mr16450243jah.124.1602441553813; Sun, 11 Oct 2020 11:39:13 -0700 (PDT) MIME-Version: 1.0 References: <20201010103854.66746-1-songmuchun@bytedance.com> In-Reply-To: <20201010103854.66746-1-songmuchun@bytedance.com> From: Cong Wang Date: Sun, 11 Oct 2020 11:39:02 -0700 Message-ID: Subject: Re: [PATCH] mm: proc: add Sock to /proc/meminfo To: Muchun Song Cc: Miaohe Lin , Feng Tang , Michal Hocko , "Michael S. Tsirkin" , Neil Brown , Alexei Starovoitov , LKML , linux-mm , Eric Dumazet , Christian Brauner , walken@google.com, will@kernel.org, Steffen Klassert , dave@stgolabs.net, Herbert Xu , Daniel Borkmann , rafael@kernel.org, decui@microsoft.com, Peter Zijlstra , samitolvanen@google.com, Alexey Kuznetsov , Paolo Abeni , Alexey Dobriyan , Pablo Neira Ayuso , "Eric W. Biederman" , Kees Cook , Jann Horn , shakeelb@google.com, Jakub Kicinski , Thomas Gleixner , virtualization@lists.linux-foundation.org, chenqiwu@xiaomi.com, Martin KaFai Lau , Jakub Sitnicki , christophe.leroy@c-s.fr, Willem de Bruijn , Hideaki YOSHIFUJI , Greg KH , Randy Dunlap , Florian Westphal , gustavoars@kernel.org, Roman Gushchin , Minchan Kim , rppt@kernel.org, Linux Kernel Network Developers , linux-fsdevel , Andrew Morton , David Miller , "Kirill A. Shutemov" X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Sat, Oct 10, 2020 at 3:39 AM Muchun Song wrote: > > The amount of memory allocated to sockets buffer can become significant. > However, we do not display the amount of memory consumed by sockets > buffer. In this case, knowing where the memory is consumed by the kernel We do it via `ss -m`. Is it not sufficient? And if not, why not adding it there rather than /proc/meminfo? > static inline void __skb_frag_unref(skb_frag_t *frag) > { > - put_page(skb_frag_page(frag)); > + struct page *page = skb_frag_page(frag); > + > + if (put_page_testzero(page)) { > + dec_sock_node_page_state(page); > + __put_page(page); > + } > } You mix socket page frag with skb frag at least, not sure this is exactly what you want, because clearly skb page frags are frequently used by network drivers rather than sockets. Also, which one matches this dec_sock_node_page_state()? Clearly not skb_fill_page_desc() or __skb_frag_ref(). Thanks. _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization