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

2023-12-05 Thread Nhat Pham
Drop the pool's reference at the end of the writeback step. Apply on top of the first fixlet: https://lore.kernel.org/linux-mm/20231130203522.gc543...@cmpxchg.org/T/#m6ba8efd2205486b1b333a29f5a890563b45c7a7e Signed-off-by: Nhat Pham --- mm/zswap.c | 1 + 1 file changed, 1 insertion(+) diff

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

2023-12-05 Thread Nhat Pham
On Thu, Nov 30, 2023 at 11:40 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 >

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

2023-12-05 Thread Nhat Pham
On Tue, Dec 5, 2023 at 4:10 PM Chris Li wrote: > > Hi Nhat, > > Still working my way up of your patches series. > > On Thu, Nov 30, 2023 at 11:40 AM Nhat Pham wrote: > > > > From: Domenico Cerasuolo > > > > Currently, we only have a single global LRU for zswap. This makes it > > impossible to

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

2023-12-05 Thread Chris Li
Hi Nhat, Still working my way up of your patches series. On Thu, Nov 30, 2023 at 11:40 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

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

2023-12-05 Thread Nhat Pham
Use the correct function for the onlineness check for the memcg selection, and use mem_cgroup_iter_break() to break the iteration. Suggested-by: Yosry Ahmed Signed-off-by: Nhat Pham --- mm/zswap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c

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

2023-12-05 Thread Nhat Pham
On Tue, Dec 5, 2023 at 11:00 AM Yosry Ahmed wrote: > > [..] > > > > static void shrink_worker(struct work_struct *w) > > > > { > > > > struct zswap_pool *pool = container_of(w, typeof(*pool), > > > > shrink_work); > > > > + struct

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

2023-12-05 Thread Yosry Ahmed
[..] > > > static void shrink_worker(struct work_struct *w) > > > { > > > struct zswap_pool *pool = container_of(w, typeof(*pool), > > > shrink_work); > > > + struct mem_cgroup *memcg; > > > int ret, failures = 0; > > > > > >

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

2023-12-05 Thread Nhat Pham
On Tue, Dec 5, 2023 at 10:21 AM Yosry Ahmed wrote: > > On Thu, Nov 30, 2023 at 11:40 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 v8 3/6] zswap: make shrinking memcg-aware

2023-12-05 Thread Yosry Ahmed
On Thu, Nov 30, 2023 at 11:40 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 v8 3/6] zswap: make shrinking memcg-aware

2023-11-30 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