lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJD7tkZebGv1Bd+T6u3UL5buf8J9RFh0y_kC0ZJjBRT3NdNOBA@mail.gmail.com>
Date: Mon, 1 Jul 2024 06:42:17 -0700
From: Yosry Ahmed <yosryahmed@...gle.com>
To: Alex Shi <seakeel@...il.com>
Cc: Hyeonggon Yoo <42.hyeyoo@...il.com>, alexs@...nel.org, 
	Vitaly Wool <vitaly.wool@...sulko.com>, Miaohe Lin <linmiaohe@...wei.com>, 
	Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org, 
	linux-mm@...ck.org, minchan@...nel.org, willy@...radead.org, 
	senozhatsky@...omium.org, david@...hat.com
Subject: Re: [PATCH 01/20] mm/zsmalloc: add zpdesc memory descriptor for zswap.zpool

[..]
> >> +       union {
> >> +               /* Next zpdescs in a zspage in zsmalloc zpool */
> >> +               struct zpdesc *next;
> >> +               /* For huge zspage in zsmalloc zpool */
> >> +               unsigned long handle;
> >> +       };
> >> +       struct zspage *zspage;
> >
> > There was a discussion with Yosry on including memcg_data on zpdesc
> > even if it's not used at the moment.
> >
> > Maybe you can look at:
> > https://lore.kernel.org/linux-mm/CAB=+i9Quz9iP2-Lq=oQfKVVnzPDtOaKMm=hUPbnRg5hRxH+qaA@mail.gmail.com/
>
> Thanks for notice.
> The memcg_data isn't used for zpdesc. And I have a bit confusion since Yosry said: "I think to drop memcg_data we need to enlighten the code that ...". So we actually don't need to have this unused member, is this right, Yosry?

I think we need to have it, at least for now. When the pages are
freed, put_page() -> folio_put() -> __folio_put() will call
mem_cgroup_uncharge(). The latter will call folio_memcg() (which reads
folio->memcg_data) to figure out if uncharging needs to be done.

There are also other similar code paths that will check
folio->memcg_data. It is currently expected to be present for all
folios. So until we have custom code paths per-folio type for
allocation/freeing/etc, we need to keep folio->memcg_data present and
properly initialized.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ