Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3923171pxu; Mon, 30 Nov 2020 13:17:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYsAM4sI46nYRdvhhVX81UWqj6z/gMKYQC2sK2kMjtpUrurHcFoXWwqq466DOK3FLZezqD X-Received: by 2002:a17:906:7aca:: with SMTP id k10mr22272151ejo.215.1606771023538; Mon, 30 Nov 2020 13:17:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606771023; cv=none; d=google.com; s=arc-20160816; b=ic4e5Mw753XOlNHN/fN6+DVVf+dfpeZVXYJK/QV/z1IqTXo9QNfAYgkbYzwPq0JWUj Lt2Jsi9ItVTbYm1NWC6M12ef3RCML+HhwzrHu4qoKOm+CAYx08FoHwZYF1Gzl6rb9YI2 gfcGPnNp9OrEjBl3R+SkC2OtRiTjMIsSRFgmGaq6f0EZ++Gs1fuTB7iex8hxUdyfzQ+z XyGI8EUwW0BJjDwbRSfHSsY6Z6Xy7RDSUFpXDjMRIT16eOgpuBrubHSW26F2Y7PNKV9s v4c0jyNERa8LZnTepUu9fVZph+r6ZRxWzU2tCBbqHWMGhRu6fCY17X40D1hsBBXl0gUJ hbWw== 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=n3KWtTbyu910cgBxnHje89Hi5Pdj67SfhYeBysSLt7k=; b=wKzT4+M/s85tNK6SoNFmMn7WzDhIuw5pWTG1Nri8c4q4q5c5J0VRGYuQS+8ryGs1N4 sFxY8TEncUHTN4GYHjwIQd2PxF23jA1zGOry1/tn5enZk3AqqcKezY4tqCUk3Mun7b8E XIuDSE2JI2ztG9fUKJLgblrMnM1b/r7yo0AmaXw1dAr+RN5RXtI5gmm3MmQxMtT60XMT f/RMgQADXdIKH0bRtV/Z15jYxGG3IyZBWQTuHOlHov7GD4CbvhKCSbXJoo1/u++a/4LG eiPg1S/CXC4WZ+8Y0DMCXpWT2zslk3vyKrTxDhwcVzuyLgHlR7l4pkoWIG1UEyD/LgrK cEPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XKUoVsy0; 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 bl4si6650593ejb.79.2020.11.30.13.16.30; Mon, 30 Nov 2020 13:17:03 -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=XKUoVsy0; 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 S2388478AbgK3VNf (ORCPT + 99 others); Mon, 30 Nov 2020 16:13:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388399AbgK3VNe (ORCPT ); Mon, 30 Nov 2020 16:13:34 -0500 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA93FC0613CF for ; Mon, 30 Nov 2020 13:13:18 -0800 (PST) Received: by mail-lj1-x242.google.com with SMTP id f24so20256701ljk.13 for ; Mon, 30 Nov 2020 13:13:18 -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=n3KWtTbyu910cgBxnHje89Hi5Pdj67SfhYeBysSLt7k=; b=XKUoVsy05kCrVvddDePtP1hpa3frBZCDGjBpVl7lJPZTEaWp141MdeEkgWFXE2hMtZ Jg80YRM8bwYP283gjRBtADdNaKGlvkz/bJu5fQm/Ckd7P+G5/SbnNroKAddGj1XgbO3v PmRGS6aWjrAm44AlOHzhtyU+0r7PM3uciizC0Kq0ccOPUEqEqTFHvW/2BWQe/ceFeaS0 IHC+QLIsEs+SbquUOpbBHRlotQCu62+8vY6/MwuByvi2FhnrITWx+tJftLqlJH7ZJmKH 7Q8/QfqkKtI3fe5mJrlzsMGz2THKrM5iGkIAdTfeZ1ToA9oF4x+0TafKFFJ3JdZjCBq0 E1bg== 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=n3KWtTbyu910cgBxnHje89Hi5Pdj67SfhYeBysSLt7k=; b=aXtrf13e+Tw7YGy0Iqs3kBIGgJ9lyQEWEPQsuJkq+bUydJ/66tP01q0Ldj9qhpIr8G DjY/p77R4n762iSjsuevW3jZnopPkgamxz06ibqIpIIfjjcfDp2HNgxra+igcp13KgiG 4ELurj9OGwsXkx99j/a5XygH+9O2myLjY3NufsfinebqxH4b+W05er25+jzdOfhWeCTY 0h7V8LaJers/6CSAwe6UeEVn2r/ZyXhudClHaoo7ffOmeUSQ7neSRRRdiT5WWC3fHmbc WB9Db4z3gmZ2GX7BKNnfpvbk8Tb8rOKkXOSrSJUFgMTdsZiR7ey9SGvTqySsPQfZClG3 PFqQ== X-Gm-Message-State: AOAM532TgC5aDXVLHUeZwMNHdIM+LYO/Q2QmgPBeo5C8l8QVdN2Vaz7y WCGv45RGVWtcixGfl1BmBR8LLUX8E3REH1yRDEJGKw== X-Received: by 2002:a2e:b16a:: with SMTP id a10mr11561573ljm.446.1606770797208; Mon, 30 Nov 2020 13:13:17 -0800 (PST) MIME-Version: 1.0 References: <20201126005603.1293012-1-shakeelb@google.com> <20201130203425.GA1360286@carbon.DHCP.thefacebook.com> <20201130211050.GB1360286@carbon.DHCP.thefacebook.com> In-Reply-To: <20201130211050.GB1360286@carbon.DHCP.thefacebook.com> From: Shakeel Butt Date: Mon, 30 Nov 2020 13:13:06 -0800 Message-ID: Subject: Re: [PATCH 0/2] memcg: add pagetable comsumption to memory.stat To: Roman Gushchin Cc: Johannes Weiner , Michal Hocko , Andrew Morton , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 30, 2020 at 1:10 PM Roman Gushchin wrote: > > On Mon, Nov 30, 2020 at 01:01:18PM -0800, Shakeel Butt wrote: > > On Mon, Nov 30, 2020 at 12:34 PM Roman Gushchin wrote: > > > > > > On Wed, Nov 25, 2020 at 04:56:01PM -0800, Shakeel Butt wrote: > > > > Many workloads consumes significant amount of memory in pagetables. This > > > > patch series exposes the pagetable comsumption for each memory cgroup. > > > > > > Hi Shakeel! > > > > > > The code looks good to me. However I'm not sure I understand what's the > > > use case for the new statistics? Can you, please, elaborate a bit more here? > > > > > > From a very first glance, the size of pagetables should be _roughly_ equal > > > to the size_of(pte)/PAGE_SIZE*(size of a cgroup) and should not exceed 1% > > > of the cgroup size. So for all but very large cgroups the value will be > > > in the noise of per-cpu counters. Perhaps I'm missing some important cases? > > > > > > > I think this is in general a good metric to have but one specific > > use-case we have is the user space network driver which mmaps the > > memory of the applications for zero copy data transfers. This driver > > can consume a large amount of memory in page tables. So, this metric > > becomes really useful here. > > Got it, thank you for the explanation! > Would you mind to add this text to the cover letter as an example? Sure. > > Acked-by: Roman Gushchin > for the series. Thanks for the review.