[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+PVUaQ40isbN14=gJTM7Bo_h1cRF=7AQUbE2g+PYNUMwdZLog@mail.gmail.com>
Date: Thu, 15 Jun 2023 11:32:50 +0200
From: Fabian Deutsch <fdeutsch@...hat.com>
To: Yu Zhao <yuzhao@...gle.com>
Cc: Zhongkun He <hezhongkun.hzk@...edance.com>, minchan@...nel.org,
senozhatsky@...omium.org, mhocko@...e.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Andrea Arcangeli <aarcange@...hat.com>,
David Hildenbrand <david@...hat.com>,
Yosry Ahmed <yosryahmed@...gle.com>
Subject: Re: [RFC PATCH 1/3] zram: charge the compressed RAM to the page's memcgroup
On Thu, Jun 15, 2023 at 6:59 AM Yu Zhao <yuzhao@...gle.com> wrote:
>
> On Wed, Jun 14, 2023 at 9:48 PM Zhongkun He
> <hezhongkun.hzk@...edance.com> wrote:
> >
> > The compressed RAM is currently charged to kernel, not to
> > any memory cgroup, which is not satisfy our usage scenario.
> > if the memory of a task is limited by memcgroup, it will
> > swap out the memory to zram swap device when the memory
> > is insufficient. In that case, the memory limit will have
> > no effect.
> >
> > So, it should makes sense to charge the compressed RAM to
> > the page's memory cgroup.
While looking at this in the past weeks, I believe that there are two
distinct problems:
1. Direct zram usage by process within a cg ie. a process writing to a
zram device
2. Indirect zram usage by a process within a cg via swap (described above)
Both of them probably require different solutions.
In order to fix #1, accounting a zram device should be accounted
towards a cgroup. IMHO this is something that should be fixed.
Yu Zhao and Yosry are probably much more familiar with the solution to #2.
WRT per-cgrou-swapfile, to me this is addressing #2, but I agree with
Yu Zhao, that there are probably better solutions to this.
Lastly, this patchset, while it will possibly not address the swap
issue (#2) completely, is it satisfying the needs of #1?
- fabian
> We used to do this a long time ago, but we had per-memcg swapfiles [1[
> to prevent compressed pages from different memcgs from sharing the
> same zspage.
>
> Does this patchset alone suffer from the same problem, i.e., memcgs
> sharing zspages?
>
> [1] https://lwn.net/Articles/592923/
>
Powered by blists - more mailing lists