[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ectfgr9d.fsf@linux.dev>
Date: Wed, 13 Aug 2025 08:45:02 -0700
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-mm@...ck.org, LKML <linux-kernel@...r.kernel.org>, Peter
Zijlstra <peterz@...radead.org>, Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>, Shakeel Butt <shakeel.butt@...ux.dev>,
Muchun Song <muchun.song@...ux.dev>, cgroups@...r.kernel.org, Andrew
Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] memcg: Optimize exit to user space
Thomas Gleixner <tglx@...utronix.de> writes:
> memcg uses TIF_NOTIFY_RESUME to handle reclaiming on exit to user
> space. TIF_NOTIFY_RESUME is a multiplexing TIF bit, which is utilized by
> other entities as well.
>
> This results in a unconditional mem_cgroup_handle_over_high() call for
> every invocation of resume_user_mode_work(), which is a pointless
> exercise as most of the time there is no reclaim work to do.
>
> Especially since RSEQ is used by glibc, TIF_NOTIFY_RESUME is raised
> quite frequently and the empty calls show up in exit path profiling.
>
> Optimize this by doing a quick check of the reclaim condition before
> invoking it.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Michal Hocko <mhocko@...nel.org>
> Cc: Roman Gushchin <roman.gushchin@...ux.dev>
> Cc: Shakeel Butt <shakeel.butt@...ux.dev>
> Cc: Muchun Song <muchun.song@...ux.dev>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
Reviewed-by: Roman Gushchin <roman.gushchin@...ux.dev>
Thanks!
Powered by blists - more mailing lists