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=-13.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 7E7B6C433DB for ; Wed, 13 Jan 2021 19:55:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0DEFF20771 for ; Wed, 13 Jan 2021 19:55:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DEFF20771 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 45B158D0090; Wed, 13 Jan 2021 14:55:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 40BCD8D008E; Wed, 13 Jan 2021 14:55:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FA1A8D0090; Wed, 13 Jan 2021 14:55:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0148.hostedemail.com [216.40.44.148]) by kanga.kvack.org (Postfix) with ESMTP id 164258D008E for ; Wed, 13 Jan 2021 14:55:25 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C65F1180AD81A for ; Wed, 13 Jan 2021 19:55:24 +0000 (UTC) X-FDA: 77701806168.15.voice09_481643427520 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 8E35C1814B0C7 for ; Wed, 13 Jan 2021 19:55:24 +0000 (UTC) X-HE-Tag: voice09_481643427520 X-Filterd-Recvd-Size: 5374 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 Jan 2021 19:55:24 +0000 (UTC) Received: by mail-lj1-f171.google.com with SMTP id y22so3901470ljn.9 for ; Wed, 13 Jan 2021 11:55:23 -0800 (PST) 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=V0bs1fi/eE8isvmmJjMQkUZIf1rb+BYIcBHJLO1oqcE=; b=fU8xQWv0qAos49JfkFhq/SvSl9DKk4R3hCOQ4ZYyfA3JjIvM9fSyygUqQVtmaCvUzT O02v3DcrsaONKGxXgfUbBgPNgmFjvw9UrWHP+BT4AjzOrGrt/vGx+rxIEnYp/JjOFSsf 8cCMDfNLPbBE4L6R+FHyQBO4n/+akvzeZSp1rYbjjaAfNWmetJ+OPJz40voyNp+rxEKM YNd5erKC9LZ3UfjpbuWOFRFIy1I4p9ki2KTunusZzgU6DEAyjCNvmyMOi3ZKUyHVswc0 rSPFYJd779xIcQOtVoL5Cp0NZZZK9bK59dRQ9lBsm0masjFs4u3FVlh2SUw7SCXNb3Ox 0jcA== 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=V0bs1fi/eE8isvmmJjMQkUZIf1rb+BYIcBHJLO1oqcE=; b=HP76MYF9SHJJgZsi9rbRugjFU332KedKGsOSZ/HaNQ7pob8FpwpK5hupH+2mUS/A6E JQ5Ba8v2EcWGb8H5wRpRStP52nDrk0rv/5lA9CmdAQLfY7eNvWMfThBLhV0QdjRQ7ufV C8Vrj9VfyWR2yeKTAM1Vxu0qplW6Yk57nTlLLOwyjZQnrPZh4+tvqHYC22NgqsfMhUOT 8FhP3wDGIwHfa/UbFp4Fl0k8i2xx4MOsJRgthXi6Aive2ZXtEkgQyatRkIhlXey+3E6S M1eCDUJ3x0vOTIv6oOjB6667+AU3u5vQMg3cObQD5odjgduDCQdEF9+tbEUo9iKipnuc yfsw== X-Gm-Message-State: AOAM532bS9QWhrGmEPf3dW6HCfFp+uS0oTSy7l512/ZXbcmjPDncF/yx EO4dO2Z+uvFitH1n0Ek3+lQInk5qI2riTO6QZemK0A== X-Google-Smtp-Source: ABdhPJzpKHbnFV0lFf5tfz8ktI8u8IjUm7QAokZ+THXeZEzaW2cWimQTsgN22rWUbtrNTtMpaJrNsDZ2I7PV4RQ3cA0= X-Received: by 2002:a2e:9a84:: with SMTP id p4mr1506293lji.160.1610567722324; Wed, 13 Jan 2021 11:55:22 -0800 (PST) MIME-Version: 1.0 References: <20210112214105.1440932-1-shakeelb@google.com> <20210112233108.GD99586@carbon.dhcp.thefacebook.com> <20210112234822.GA134064@carbon.dhcp.thefacebook.com> <20210113184302.GA355124@carbon.dhcp.thefacebook.com> In-Reply-To: From: Shakeel Butt Date: Wed, 13 Jan 2021 11:55:11 -0800 Message-ID: Subject: Re: [PATCH] mm: net: memcg accounting for TCP rx zerocopy To: Yang Shi Cc: Roman Gushchin , Arjun Roy , Johannes Weiner , Michal Hocko , Eric Dumazet , Andrew Morton , "David S . Miller" , Jakub Kicinski , Linux MM , Cgroups , netdev , Linux Kernel Mailing List 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 Wed, Jan 13, 2021 at 11:49 AM Yang Shi wrote: > > On Wed, Jan 13, 2021 at 11:13 AM Shakeel Butt wrote: > > > > On Wed, Jan 13, 2021 at 10:43 AM Roman Gushchin wrote: > > > > > > On Tue, Jan 12, 2021 at 04:18:44PM -0800, Shakeel Butt wrote: > > > > On Tue, Jan 12, 2021 at 4:12 PM Arjun Roy wrote: > > > > > > > > > > On Tue, Jan 12, 2021 at 3:48 PM Roman Gushchin wrote: > > > > > > > > > > [snip] > > > > > > Historically we have a corresponding vmstat counter to each charged page. > > > > > > It helps with finding accounting/stastistics issues: we can check that > > > > > > memory.current ~= anon + file + sock + slab + percpu + stack. > > > > > > It would be nice to preserve such ability. > > > > > > > > > > > > > > > > Perhaps one option would be to have it count as a file page, or have a > > > > > new category. > > > > > > > > > > > > > Oh these are actually already accounted for in NR_FILE_MAPPED. > > > > > > Well, it's confusing. Can't we fix this by looking at the new page memcg flag? > > > > Yes we can. I am inclined more towards just using NR_FILE_PAGES (as > > Arjun suggested) instead of adding a new metric. > > IMHO I tend to agree with Roman, it sounds confusing. I'm not sure how > people relies on the counter to have ballpark estimation about the > amount of reclaimable memory for specific memcg, but they are > unreclaimable. And, I don't think they are accounted to > NR_ACTIVE_FILE/NR_INACTIVE_FILE, right? So, the disparity between > NR_FILE_PAGES and NR_{IN}ACTIVE_FILE may be confusing either. > Please note that due to shmem/tmpfs there is already disparity between NR_FILE_PAGES and NR_{IN}ACTIVE_FILE. BTW I don't have a strong opinion against adding a new metric. If there is consensus we can add one.