Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3273599pxb; Tue, 19 Jan 2021 19:34:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLUCM5/wWj2UX2Hj0fIYZkUxHceu4KTE+NHRcJ5DZTqUMxXHSUZ/eqrcSFXcLic0Cfxx1M X-Received: by 2002:aa7:db49:: with SMTP id n9mr5940074edt.73.1611113695895; Tue, 19 Jan 2021 19:34:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611113695; cv=none; d=google.com; s=arc-20160816; b=xZJYN/R3OzJART/GjLJh3P0/XDfNDN6IECZEeRmx34UdiHepJKQ6IU8kjD0Adr9sax p0+qN9WiWPgWddGE+IPDknxBj1n4hTWd18SgEz6Zg4kRRR/URnpymYwktHW+AjnMke/6 dTIbpLYxC7ORp+FWvtc2LgAd8UNqJwBthVcYXUd2q1JTdI9/puloko+JW1XdbqNyDn59 31HhCwpd519XkfZaH1+ajQLK/3O1K6UcIVac+9yfwbmJuzcn8iyl4mmmnkpG9Dwn8cjD BJas5MrfRVyNJRTEEqCFQ3oTfu+B+YQ/YwrKA/EvGNCryJuGLpaSmDP+qVHsEL7mr9un 3faw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Fdl7GPtsxeMh7s7EVrXO7P1C9iXb8ZW1ZclmtoYnKZY=; b=ZR7Pp9R7+hWp4JMDFCGC7YNTEeW82aCM7qsEzvtCIYh6Hc/RjJw7yDlHaEp/sDsJN/ q8oewK6yvHXDdoIl1BBiHLKvJMcdIFbFGTGObdArG7OpVgiFq6f8AvSECH/SlnN29TPD 3FMvsC3droUeyFWyfvGv5B890a1pyrYcXK1X1F15PNf09jBHUTP33FiNn4o1orE1WU6p sPYxJ249gvHFBsWfFuEShDUjKvPo2pryvTIT8w61ZCXuehQBf6sD4iGF7PrHPFTRn1OR RwdENDUMDcBAznylxPiri9HVlCxQ1BYfpcoo1YlwwVjJXT+CORuXxvTM19EBJe5E5Zc5 0f2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XRj0OR0y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gq19si228856ejb.623.2021.01.19.19.34.31; Tue, 19 Jan 2021 19:34:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XRj0OR0y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728736AbhATDdf (ORCPT + 99 others); Tue, 19 Jan 2021 22:33:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730755AbhATDcn (ORCPT ); Tue, 19 Jan 2021 22:32:43 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F147C0613CF for ; Tue, 19 Jan 2021 19:32:03 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id cq1so1270622pjb.4 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=tgVkhgr/qMXVhk0fjAtgVCscrYtBta+RVWModALfn+aITN18Q+abDLVWsXr2kgBeKo 0HIb/9bDA4Wp3a7bUVonZmOGb1IwB940q7tIWpgg4cNMOP0HZGZUrYVDdpL8CS+L9gWl pW/6laJ6zJv0ubHjruezGwUhLIGP1Df4qoKIt6pHGp+h65Lf+eKLZRVfWdtaqoewO489 ohmE/VlOyYwedykoldwr2SPkfMJKOVidXRz5LVBweSp49oJne9KNHXk9Fhz/iKQRpE66 S40slrJbhrDnnXrLbkGNhH7rC/2ntMga7FV/tvjAnbay6YkkHNO+S28FWX0fKm6kcLZL oXPg== X-Gm-Message-State: AOAM531m2sGVwz9YvytXoqjcSapsSBo7cAL0amw0UAeUK8/6rZxwU6GE JhO9NYQWcYmteEssEWpk0I6lrpnaNtSg0vZ1dnUGLg== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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