Re: [PATCH v2 2/4] rseq: Run the mm_cid_compaction from rseq_handle_notify_resume()

From: Gabriele Monaco

Date: Tue Sep 30 2025 - 06:18:23 EST


On Tue, 2025-09-30 at 00:01 +0200, Thomas Gleixner wrote:
>
> The current overhead of RSEQ is way too high. People have reported 3%
> regressions just because glibc uses RSEQ now. So that needs to be
> addressed. Moving the RSEQ fastpath to the last point before going back
> to user space is the correct thing to do.
>
> mm cid compaction is a related but orthogonal problem. I just skimmed
> your patches and I'm really not convinced that this is the right
> approach to solve the problem.
>
> The main issue with task_mm_cid_work() is that it iterates over all
> possible CPUs twice. Your batching just makes the impact smaller, but it
> does not really try to change the overall approach to this.

Thanks for the thorough explanation and sketch implementation. As I'm not really
confident with rseq I didn't dare changing the compaction logic too much, but
clearly your approach of getting compact cid by construction seems the way to
go.

I confirm your patch passes the selftest in 4/4 of this series and, obviously,
removes the latency I was observing.

Thanks,
Gabriele