Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3915901pxu; Mon, 30 Nov 2020 13:06:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdeTfqMEA6eWMTPVNdIDPUXxd9EaQqowPFVnXGjMI65kkLcT3KRQfbP5G9+GYquz2UHjch X-Received: by 2002:aa7:c603:: with SMTP id h3mr4304976edq.254.1606770391044; Mon, 30 Nov 2020 13:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606770391; cv=none; d=google.com; s=arc-20160816; b=z7Jsv0EApY55pvDTvXN+4WGDnj4ZslhoYnykd9hXkIcNUTXY+Rt9gEdxzoaZ9Rt0+1 9ErARWpiS3icItZmOG3/4Z8xxLTLxlS3E1IyGPqH/KLRXUGjCNnOfKqNcR7yubc8fzzH yNWuu7vWJDfDC298A3VVB33Qu43HtqLWmqdGfHBjp+3nwyzlUnlI+ZyID9OQwulJ7fWK bW/2ObMW+ZPgVoRbnG95oFe+fQmixXH+EAOzgoEh4xA1qrPX+BQkyeKDjGKTQbe5w9A7 eS81Wb9BJ4K185l6F9WbWtpgaa+c6wJQtmD78CyKnG15bBPjycU/LSIBfieIvHZr5BmA lrUg== 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=MfBG/54OyTRJiWtpsok7Jr2j/N7jeyEBXeoHXE64Qs8=; b=T2zxEYilb4iLt0F6YhG3jAW9iWl5XxVCgM38N/lSv7Kqv7ANBbsIA3MxZw0InjjLpW HtolG/nO9zShU7mqNEYK/fK5qtbWd795lVOAx8sFuUjrQy4lYELtFgpJ9nS0e00pb5ti LZbBAbeO4nlDKFjlKWrXYwLvpr+HGyck9dhV35EwSW7CnTwDlH6pmNOOQGSTCXACla4G mOlePKwQQy6ByazmkijLlteJQBH4BDcBhBgE6C0TGcXrfe0GtPaKz4GFmpm3IMZqg0s9 eSCnCyDTzUZ52BXlcHrEvA1i3I3we+5PsrKU6yeuSQ41kpKVdU7aKXzUwKTq0Khn8ilE 4h1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OR7LHevB; 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 g25si4903678ejr.326.2020.11.30.13.06.08; Mon, 30 Nov 2020 13:06:31 -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=OR7LHevB; 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 S2387576AbgK3VCS (ORCPT + 99 others); Mon, 30 Nov 2020 16:02:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387486AbgK3VCS (ORCPT ); Mon, 30 Nov 2020 16:02:18 -0500 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5018C0613CF for ; Mon, 30 Nov 2020 13:01:31 -0800 (PST) Received: by mail-lj1-x244.google.com with SMTP id t22so20256644ljk.0 for ; Mon, 30 Nov 2020 13:01:31 -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=MfBG/54OyTRJiWtpsok7Jr2j/N7jeyEBXeoHXE64Qs8=; b=OR7LHevBUwdO4js3xbw27kSJjJK7b7r2zrYg/+GicXe4c6K5tfvaKlgdOB3ni0ax1O 9FEUkoXJ/RCZgWPFClDOhgP+IIWJ9kRqYs6yML1ZC+oGdBNeHztsUbrWdOrq1zxYex/M e5831ufsaidd9Fc8KJOlIl5Dg8zYqrmHGsP5wYUhO+jmMMcjc2NTPRteTtbVrZn0y0yz b+F4qqgHCbo7HgT2620ZPLHu8YY2o3USpQlcbHb4Z8J2fRAjdEdMyuLh29wdugUs4aJ6 riPKAGHXxgxwXjJ7NEm9LJP0nsooNhJwUFNK9CIIsS2OqAekoZNOeJNg2g6rxvVYPnjp gpSA== 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=MfBG/54OyTRJiWtpsok7Jr2j/N7jeyEBXeoHXE64Qs8=; b=oKUFO4ErA2N6KhVbGKgeBOVdnvWfOiVxXpjZM4HrS9QhOy2UptV8xs/KOTXA9mx4Q8 0QhLCyxowLeCDjEjhLfnn2BcAMZm3YVByaO6EjpiLfI0D+gelf0cvgcOmVDqFN97B3Wt rhp11Gjq9UcBsEjkkfuKUvLBlrzOJ5Nbk+3kSxflHZFwFpn11YhidP1Cj/mMV6fOnMfL 4v/ERfxoHyESps4VCVVEidQkHvBc5y/Y+WuU4ahzanmAegqX9+spKLA3kmwgUQDI74V8 pxYZDxiQiOtL40XKMOiIfqgr8GpWGyxZIl5Fe0N0lQLei7jjqAe2K23xU4n38pK1HI0o v42w== X-Gm-Message-State: AOAM531UpT4SoFxB8rEUvWQc7X5pJExl3U+J4oHW+dimFrjnlG5Ivuaz aLhTWHssRPLIsPoqDhV0BiqYA2zP9EN7ZhICzgticA== X-Received: by 2002:a2e:8745:: with SMTP id q5mr10752520ljj.347.1606770089903; Mon, 30 Nov 2020 13:01:29 -0800 (PST) MIME-Version: 1.0 References: <20201126005603.1293012-1-shakeelb@google.com> <20201130203425.GA1360286@carbon.DHCP.thefacebook.com> In-Reply-To: <20201130203425.GA1360286@carbon.DHCP.thefacebook.com> From: Shakeel Butt Date: Mon, 30 Nov 2020 13:01:18 -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 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. Shakeel