[PATCH v5 3/6] zswap: make shrinking memcg-aware (fix)

2023-11-06 Thread Nhat Pham
Rename get_mem_cgroup_from_entry() to mem_cgroup_from_entry() and use the zswap_pools_lock for next_shrink update. Suggested-by: Yosry Ahmed Signed-off-by: Nhat Pham --- mm/zswap.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/mm/zswap.c

Re: [PATCH v5 3/6] zswap: make shrinking memcg-aware

2023-11-06 Thread Nhat Pham
On Mon, Nov 6, 2023 at 12:58 PM Yosry Ahmed wrote: > > > > > > > This lock is only needed to synchronize updating pool->next_shrink, > > > right? Can we just use atomic operations instead? (e.g. cmpxchg()). > > > > I'm not entirely sure. I think in the pool destroy path, we have to also > > put

Re: [PATCH v5 3/6] zswap: make shrinking memcg-aware

2023-11-06 Thread Yosry Ahmed
> > > > This lock is only needed to synchronize updating pool->next_shrink, > > right? Can we just use atomic operations instead? (e.g. cmpxchg()). > > I'm not entirely sure. I think in the pool destroy path, we have to also > put the next_shrink memcg, so there's that. We can use xchg() to

Re: [PATCH v5 3/6] zswap: make shrinking memcg-aware

2023-11-06 Thread Nhat Pham
On Mon, Nov 6, 2023 at 12:26 PM Yosry Ahmed wrote: > > On Mon, Nov 6, 2023 at 10:32 AM Nhat Pham wrote: > > > > From: Domenico Cerasuolo > > > > Currently, we only have a single global LRU for zswap. This makes it > > impossible to perform worload-specific shrinking - an memcg cannot > >

Re: [PATCH v5 3/6] zswap: make shrinking memcg-aware

2023-11-06 Thread Yosry Ahmed
On Mon, Nov 6, 2023 at 10:32 AM Nhat Pham wrote: > > From: Domenico Cerasuolo > > Currently, we only have a single global LRU for zswap. This makes it > impossible to perform worload-specific shrinking - an memcg cannot > determine which pages in the pool it owns, and often ends up writing >

[PATCH v5 3/6] zswap: make shrinking memcg-aware

2023-11-06 Thread Nhat Pham
From: Domenico Cerasuolo Currently, we only have a single global LRU for zswap. This makes it impossible to perform worload-specific shrinking - an memcg cannot determine which pages in the pool it owns, and often ends up writing pages from other memcgs. This issue has been previously observed