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 9C1CFC433E0 for ; Wed, 20 Jan 2021 03:32:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 001AB2310D for ; Wed, 20 Jan 2021 03:32:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 001AB2310D 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 D9C696B0005; Tue, 19 Jan 2021 22:32:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D4D976B0006; Tue, 19 Jan 2021 22:32:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C3CCD6B0007; Tue, 19 Jan 2021 22:32:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id AED2C6B0005 for ; Tue, 19 Jan 2021 22:32:04 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 7CBD8364B for ; Wed, 20 Jan 2021 03:32:04 +0000 (UTC) X-FDA: 77724729768.03.actor20_6303ac527557 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 4B38528A4E9 for ; Wed, 20 Jan 2021 03:32:04 +0000 (UTC) X-HE-Tag: actor20_6303ac527557 X-Filterd-Recvd-Size: 5860 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Wed, 20 Jan 2021 03:32:03 +0000 (UTC) Received: by mail-pj1-f50.google.com with SMTP id md11so1284947pjb.0 for ; Tue, 19 Jan 2021 19:32:03 -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=Fdl7GPtsxeMh7s7EVrXO7P1C9iXb8ZW1ZclmtoYnKZY=; b=XRj0OR0yGsv+epSl7d7M4vSTDzOw8TE2P27nx2xkX1druNKB/zY1MLIhPX5bW6xzLD 9gt4WvlLpPI2Z1J2sD18aHWuVfycYVSh/xRV0qIJClEPF/Fs1mNtP15zXbVLKzFC1e9K 45o705TxRDXsjPcu12SPKb+4/0hp56TX2USuvEdw6bnS1dAbR2HhTGsf8elVBFPFKkJ0 sWZ9SbFx/0guJ+yAHlvOGObJoBhPFVMMmZhIDFKy7zgegHpmlReufMXCd9ULz/FaelBU yO1xZKXX2wwPO5S9NaDeEUWiMMAycQ4BL2I3G6GpPwiK+S23Q4F4d8MZFA2YOlUFpGO4 C6mw== 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=Fdl7GPtsxeMh7s7EVrXO7P1C9iXb8ZW1ZclmtoYnKZY=; b=YaxYyhpiMK94aURSidWmIdrT6GIeqMFhftruJXv7GlGheg67cvSgZ0TsWaQcXE4BaB iW6DF0KiCllNtkBM6XV5ogpyux9Z7ATz+Pxv4w8PuGgML1ldS9bGQxilmdN988/B+P+X xGpWuL/tilpr9PD2v6ohlwJkFhZdkbJHLTsP+UI58IRQTflKqNZgLbwNTdpElNcvq7BA Q6kGp0cJwwA1PLskEkJkSmD8Jj9nOJu3ZOwCrETD6uOZbrXDpfm2N7CIlwXe+q3w75u/ zl+Avk0CCJ9qkSbis42WjU2+DcF/Wxxh+5TdHamGUzRueLQYNmxmYNGqBNhPGBWWy3tv 1NVQ== X-Gm-Message-State: AOAM532yUCcYSEq79uxUxrC70BSomdMhXAtH/xY+YWocxtAzGv9ALtB1 F3uql/cMKx69WwjqpT6jieqtqeRBntlKyw9x5vUWUw== X-Google-Smtp-Source: ABdhPJyH7oIaEQKW71m8AcdSV/0MkHA8p+HIJbkVuXa4DFarZGJjRUnv3DcyKqny6axTQffACbeml2kgR+geUdLomYE= X-Received: by 2002:a17:90b:e8f:: with SMTP id fv15mr3298625pjb.178.1611113522609; Tue, 19 Jan 2021 19:32:02 -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: Arjun Roy Date: Tue, 19 Jan 2021 19:31:51 -0800 Message-ID: Subject: Re: [PATCH] mm: net: memcg accounting for TCP rx zerocopy To: Shakeel Butt Cc: Yang Shi , Roman Gushchin , 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:55 AM Shakeel Butt wrote: > > 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. Just wanted to see if there were any thoughts/consensus on what the best way to proceed is - should there be a v2 patch with specific changes? Or is NR_FILE_PAGES alright? And similar query, for pre-charging vs. post charging. Thanks, -Arjun