linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Shakeel Butt <shakeelb@google.com>
Cc: mkoutny@suse.com, cgroups@vger.kernel.org, hannes@cmpxchg.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	mhocko@kernel.org
Subject: Re: [PATCH v2 1/2] memcg: flush stats only if updated
Date: Thu, 4 Nov 2021 14:27:51 -0700	[thread overview]
Message-ID: <20211104142751.5ab290d5cf4be1749c9c87ed@linux-foundation.org> (raw)
In-Reply-To: <20211014163146.2177266-1-shakeelb@google.com>

On Thu, 14 Oct 2021 09:31:46 -0700 Shakeel Butt <shakeelb@google.com> wrote:

> Hi Michal,
> 
> On Wed, Oct 13, 2021 at 11:01 AM Michal Koutný <mkoutny@suse.com> wrote:
> >
> > On Fri, Oct 01, 2021 at 12:00:39PM -0700, Shakeel Butt <shakeelb@google.com> wrote:
> > > In this patch we kept the stats update codepath very minimal and let the
> > > stats reader side to flush the stats only when the updates are over a
> > > specific threshold.  For now the threshold is (nr_cpus * CHARGE_BATCH).
> >
> > BTW, a noob question -- are the updates always single page sized?
> >
> > This is motivated by apples vs oranges comparison since the
> >         nr_cpus * MEMCG_CHARGE_BATCH
> > suggests what could the expected error be in pages (bytes). But it's mostly
> > wrong since: a) uncertain single-page updates, b) various counter
> > updates summed together. I wonder whether the formula can serve to
> > provide at least some (upper) estimate.
> >
> 
> Thanks for your review. This forces me to think more on this because each
> update does not necessarily be a single page sized update e.g. adding a hugepage
> to an LRU.
> 
> Though I think the error is time bounded by 2 seconds but in those 2 seconds
> mathematically the error can be large.

Sounds significant?

> What do you think of the following
> change? It will bound the error better within the 2 seconds window.

This didn't seem to go anywhere.  I'll send "memcg: flush stats only if
updated" Linuswards, but please remember to resurrect this idea soonish
(this month?) if you think such a change is desirable.


  parent reply	other threads:[~2021-11-04 21:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 19:00 [PATCH v2 1/2] memcg: flush stats only if updated Shakeel Butt
2021-10-01 19:00 ` [PATCH v2 2/2] memcg: unify memcg stat flushing Shakeel Butt
2021-10-13 18:01   ` Michal Koutný
2021-10-13 19:24     ` Shakeel Butt
2021-10-14  9:04       ` Michal Koutný
2021-10-13 18:01 ` [PATCH v2 1/2] memcg: flush stats only if updated Michal Koutný
2021-10-14 16:31   ` Shakeel Butt
2021-10-15 17:55     ` Michal Koutný
2021-11-04 21:27     ` Andrew Morton [this message]
2021-11-04 22:09       ` Shakeel Butt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211104142751.5ab290d5cf4be1749c9c87ed@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=shakeelb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).