mbox series

[mm-unstable,v1,0/4] Improve mem_cgroup_iter()

Message ID 20240724190214.1108049-1-kinseyho@google.com (mailing list archive)
Headers show
Series Improve mem_cgroup_iter() | expand

Message

Kinsey Ho July 24, 2024, 7:02 p.m. UTC
Incremental cgroup iteration is being used again [1], but incremental
cgroup iteration was introduced for cgroup v1. It hasn't been fully
maintained for many years. This patchset improves the reliability of
mem_cgroup_iter(), along with improving simplicity and code readability.

[1] https://lore.kernel.org/20240514202641.2821494-1-hannes@cmpxchg.org/

Kinsey Ho (4):
  mm: don't hold css->refcnt during traversal
  mm: increment gen # before restarting traversal
  mm: restart if multiple traversals raced
  mm: clean up mem_cgroup_iter()

 include/linux/memcontrol.h |  6 +--
 mm/memcontrol.c            | 84 +++++++++++++++-----------------------
 2 files changed, 37 insertions(+), 53 deletions(-)

Comments

Roman Gushchin July 25, 2024, 12:25 a.m. UTC | #1
cc memcg maintainers

On Wed, Jul 24, 2024 at 07:02:10PM +0000, Kinsey Ho wrote:
> Incremental cgroup iteration is being used again [1], but incremental
> cgroup iteration was introduced for cgroup v1. It hasn't been fully
> maintained for many years.

This is a bold statement :)

> This patchset improves the reliability of
> mem_cgroup_iter(), along with improving simplicity and code readability.
> 
> [1] https://lore.kernel.org/20240514202641.2821494-1-hannes@cmpxchg.org/
> 
> Kinsey Ho (4):
>   mm: don't hold css->refcnt during traversal
>   mm: increment gen # before restarting traversal
>   mm: restart if multiple traversals raced
>   mm: clean up mem_cgroup_iter()

But the series looks great to me!

Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
for the series.

Thanks!