]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vmscan: memcg: sleep when flushing stats during reclaim
authorYosry Ahmed <yosryahmed@google.com>
Thu, 30 Mar 2023 19:18:00 +0000 (19:18 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 5 Apr 2023 23:02:52 +0000 (16:02 -0700)
commit12480e6ca02fbb9bb82ca5637e55bbb9f00328fb
tree41575d6b24911150434fba8532d4fb7b387be60f
parent389655083fad3e07d030c06a27a4e4cc8537da04
vmscan: memcg: sleep when flushing stats during reclaim

Memory reclaim is a sleepable context.  Flushing is an expensive operaiton
that scales with the number of cpus and the number of cgroups in the
system, so avoid doing it atomically unnecessarily.  This can slow down
reclaim code if flushing stats is taking too long, but there is already
multiple cond_resched()'s in reclaim code.

Link: https://lkml.kernel.org/r/20230330191801.1967435-8-yosryahmed@google.com
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Acked-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vasily Averin <vasily.averin@linux.dev>
Cc: Zefan Li <lizefan.x@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c