Re: [PATCH v1 7/9] workingset: memcg: sleep when flushing stats in workingset_refault()

From: Johannes Weiner
Date: Tue Mar 28 2023 - 14:43:44 EST


On Tue, Mar 28, 2023 at 06:16:36AM +0000, Yosry Ahmed wrote:
> @@ -406,6 +406,8 @@ void workingset_refault(struct folio *folio, void *shadow)
> unpack_shadow(shadow, &memcgid, &pgdat, &eviction, &workingset);
> eviction <<= bucket_order;
>
> + /* Flush stats (and potentially sleep) before holding RCU read lock */
> + mem_cgroup_flush_stats_ratelimited();
> rcu_read_lock();

Minor nit, but please keep the lock section visually separated by an
empty line between the flush and the rcu lock.

Other than that,

Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>