Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp630745pxb; Wed, 13 Jan 2021 11:57:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGjIxYahUgHr0y9vtXNx73w1Vbh4o8xZ201qkzZ9yuS+DMixNwtvJJ8wNxqA6R4AQYP68K X-Received: by 2002:a17:906:a192:: with SMTP id s18mr2641835ejy.249.1610567853622; Wed, 13 Jan 2021 11:57:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610567853; cv=none; d=google.com; s=arc-20160816; b=YNO01/Kd9UOK1O3BLCnrZGCZVIk+Nm6sy32Ewy3tqNyZ15eW4jaTA8ePPCVrKV0nhw G7zQYSV35MyiwkKmA9CsHrA97zbz52mOkQi6uJ0FXIK+Ka+zIGhZXgRr08G3J0ks4/Z/ Yfy88M816PBbXeGvLLuoBVXgh2LVuUm9UdFpcZ47jjcwycA5xbAgjTBrmUagypG8zwfD vieeRvtbOnvJFgX9jcTr8QSoRmIHPM2gqJJwVfhLH8R8kg9Uxs46wTcIumCz9+y7AbCB A08WlmGBOGqqy4o9J6r0K+MTGtjw5Y+QgTZJcD4MUl/9tMIQeH1SRnDQ2uG6qSnEdbBG AMng== 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=V0bs1fi/eE8isvmmJjMQkUZIf1rb+BYIcBHJLO1oqcE=; b=0YZEPwc8dNFFgCMXxAyNm4XLI5lUFnn7ryNSSKtAr9nB63DsoS21wIdjX75oH+4BPe aBg0z0bzNpcSXG/2iFyblVkvaDM843j2yLE7UHxT3nbuyNTkdvzHKEHzwF3uEXBYJWrM 0yPBgMqecLPJinKiNmVpP5rqMOpmtLkEn67KMAZWjAmyT5fuV4cZO1yKoOcBVLUymERP Kgg0vsoDOnJq0JJZl2sO28GYtA/Yf5ufVQSexrGFrKm7MAVzBiQamTOwT0IJEcNF/kUg n3lysuplTT7iSrC/3N+aR+spCNcE0fsZCBl4ZHJXbfGNSrYVRyuEOhrVDcb3V8BYDa0D AiAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fU8xQWv0; 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 dm3si1432412edb.547.2021.01.13.11.57.08; Wed, 13 Jan 2021 11:57:33 -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=fU8xQWv0; 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 S1728832AbhAMT4F (ORCPT + 99 others); Wed, 13 Jan 2021 14:56:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbhAMT4E (ORCPT ); Wed, 13 Jan 2021 14:56:04 -0500 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C24FC061786 for ; Wed, 13 Jan 2021 11:55:24 -0800 (PST) Received: by mail-lj1-x233.google.com with SMTP id n11so3939874lji.5 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=rhIH6h7MFJheAKz/HoWye1qqJIBPn4ToZV7zHNfl/SztvApt/GIutWQh7+2ZMR8fSd 4lq1aaJnJ/NE/OoJMPv/Vue9wPTYgayr+QgtMH4Q3RBjEFqudpLJe2jIx6n0tbwUUKmn a3IaRPcl0Zlll+ZBVkRqjokn/1eot5p8aMDckZ5J73UjwKKY0IVWJEkvMP5HG+RETE9E bYIxxQE34Eqb3e/1ylngt9lO8R75ol9//2x1E+F51hXNUBIfQcj7KChLyDPwD03I8BOV qA+Yv33xrrZA6vrR+4a3ZbsfliSFdVYXIUumIK11rpef6L9XcvwInBTfki++mxBKOXQM VLBg== X-Gm-Message-State: AOAM5323Iyskf8h2zA7xq3/Fxvr9F9PPEQ/IuvDcehpODFOfnHKOeGQC XZGy5dlvR9qh+F7X7m+ooOlKIWh94+36C7D4KOfy2A== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.