Re: [PATCH-next v3] mm/memcg: Properly handle memcg_stock access for PREEMPT_RT

From: Sebastian Andrzej Siewior
Date: Fri Dec 17 2021 - 14:48:53 EST


On 2021-12-17 13:46:53 [-0500], Waiman Long wrote:
> > annotation. Looking at the history, I'm also impressed by that fact that
> > disabling/ enabling interrupts is *so* expensive that all this is
> > actually worth it.
>
> For !RT with voluntary or no preemption, preempt_disable() is just a
> compiler barrier. So it is definitely cheaper than disabling interrupt. The
> performance benefit is less with preemptible but !RT kernel. Microbenchmark
> testing shows a performance improvement of a few percents depending on the
> exact benchmark.

Thanks for confirming. I got the feeling that this optimisation is for
!CONFIG_PREEMPTION. So I instead of depending on CONFIG_PREEMPT_RT I'm
leaning towards CONFIG_PREEMPT instead.

> Cheers,
> Longman

Sebastian