Re: question on memcg_stats_[un]lock in memcg code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2025-03-13 18:46:53 [-0700], Shakeel Butt wrote:
> On Thu, Mar 13, 2025 at 06:11:30PM -0700, Shakeel Butt wrote:
> > Hi Sebastian,
> > 
> > The commit be3e67b54b43 ("mm/memcg: protect per-CPU counter by disabling
> > preemption on PREEMPT_RT where needed.") added memcg_stats_lock() and
> > other variants in memcontrol.c. There usage were added in
> > __mod_memcg_lruvec_state, __count_memcg_events and mem_cgroup_swapout. I
> > am wondering why __mod_memcg_state was excluded?
> > 
> 
> Basically I wanted to know if the reason was that there were no direct
> caller for __mod_memcg_state and something like the following patch is

I guess it was omitted because the only caller is mod_memcg_state()
which disables interrupts prior calling. So this is enough.

Now if you add a user then you should add the locking like in the
suggested patch.

Sebastian




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux