[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YnwJUL90fuoHs3YW@cmpxchg.org>
Date: Wed, 11 May 2022 15:06:56 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Michal Koutný <mkoutny@...e.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.com>, Roman Gushchin <guro@...com>,
Shakeel Butt <shakeelb@...gle.com>,
Seth Jennings <sjenning@...hat.com>,
Dan Streetman <ddstreet@...e.org>,
Minchan Kim <minchan@...nel.org>, linux-mm@...ck.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-team@...com
Subject: Re: [PATCH v2 6/6] zswap: memcg accounting
On Wed, May 11, 2022 at 07:32:18PM +0200, Michal Koutný wrote:
> Hello.
>
> On Tue, May 10, 2022 at 11:28:47AM -0400, Johannes Weiner <hannes@...xchg.org> wrote:
> > +void obj_cgroup_charge_zswap(struct obj_cgroup *objcg, size_t size)
> > +{
> > + struct mem_cgroup *memcg;
> > +
> > + VM_WARN_ON_ONCE(!(current->flags & PF_MEMALLOC));
> > +
> > + /* PF_MEMALLOC context, charging must succeed */
> > + if (obj_cgroup_charge(objcg, GFP_KERNEL, size))
> > + VM_WARN_ON_ONCE(1);
>
> IIUC, the objcg is derived from the compressed page, i.e. same memcg
> (reparenting neglected for now). This memcg's memory.current is then
> charged with the compressed object size.
Correct. After which the uncompressed page is reclaimed and uncharged.
So the zswapout process will reduce the charge bottom line.
> Do I get it right that memory.zswap.current is a subset of memory.current?
>
> (And that zswap is limited both by memory.max and memory.zswap.max?)
Yes. Zswap is a memory consumer, and we want the compressed part of a
workload's memory to show up in the total memory footprint.
memory.zswap.* are there to configure zswap policy, within the
boundaries of available memory - it's by definition a subset.
Powered by blists - more mailing lists