* Re: [PATCH 0/4] memcg: cleanup the memcg stats interfaces [not found] ` <99429fb8-dcec-43e7-a23b-bee54b8ed6e6@linux.dev> @ 2025-11-11 3:05 ` Harry Yoo 2025-11-11 8:01 ` Sebastian Andrzej Siewior 0 siblings, 1 reply; 2+ messages in thread From: Harry Yoo @ 2025-11-11 3:05 UTC (permalink / raw) To: Qi Zheng Cc: Shakeel Butt, Andrew Morton, Johannes Weiner, Michal Hocko, Roman Gushchin, Muchun Song, Vlastimil Babka, linux-mm, cgroups, linux-kernel, Meta kernel team, Sebastian Andrzej Siewior, Clark Williams, linux-rt-devel On Tue, Nov 11, 2025 at 10:48:18AM +0800, Qi Zheng wrote: > Hi Shakeel, > > On 11/11/25 10:39 AM, Shakeel Butt wrote: > > On Tue, Nov 11, 2025 at 10:23:15AM +0800, Qi Zheng wrote: > > > Hi, > > > > > [...] > > > > > > > > Are you or Qi planning a follow-up that converts spin_lock_irq() to > > > > spin_lock() in places where they disabled IRQs was just to update vmstat? > > > > > > Perhaps this change could be implemented together in [PATCH 1/4]? > > > > > > Of course, it's also reasonable to make it a separate patch. If we > > > choose this method, I’m fine with either me or Shakeel doing it. > > > > > > > Let's do it separately as I wanted to keep the memcg related changes > > self-contained. > > OK. Agreed. > > Qi, can you please take a stab at that? > > Sure, I will do it. I'll be more than happy to review that ;) > > > > Qi's zombie memcg series will depends on that work I guess.. > > > > > > Yes, and there are other places that also need to be converted, such as > > > __folio_migrate_mapping(). > > > > I see __mod_zone_page_state() usage in __folio_migrate_mapping() and > > using the same reasoning we can convert it to use mod_zone_page_state(). > > Where else do you need to do these conversions (other than > > __folio_migrate_mapping)? > > I mean converting these places to use spin_lock() instead of > spin_lock_irq(). Just one thing I noticed while looking at __folio_migrate_mapping()... - xas_lock_irq() -> xas_unlock() -> local_irq_enable() - swap_cluster_get_and_lock_irq() -> swap_cluster_unlock() -> local_irq_enable() is wrong because spin_lock_irq() doesn't disable IRQ on PREEMPT_RT. Not 100% sure if it would be benign or lead to actual bugs that need to be fixed in -stable kernels. Cc'ing RT folks again :) -- Cheers, Harry / Hyeonggon ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 0/4] memcg: cleanup the memcg stats interfaces 2025-11-11 3:05 ` [PATCH 0/4] memcg: cleanup the memcg stats interfaces Harry Yoo @ 2025-11-11 8:01 ` Sebastian Andrzej Siewior 0 siblings, 0 replies; 2+ messages in thread From: Sebastian Andrzej Siewior @ 2025-11-11 8:01 UTC (permalink / raw) To: Harry Yoo Cc: Qi Zheng, Shakeel Butt, Andrew Morton, Johannes Weiner, Michal Hocko, Roman Gushchin, Muchun Song, Vlastimil Babka, linux-mm, cgroups, linux-kernel, Meta kernel team, Clark Williams, linux-rt-devel > > I mean converting these places to use spin_lock() instead of > > spin_lock_irq(). > > Just one thing I noticed while looking at __folio_migrate_mapping()... > > - xas_lock_irq() -> xas_unlock() -> local_irq_enable() > - swap_cluster_get_and_lock_irq() -> swap_cluster_unlock() -> local_irq_enable() > > is wrong because spin_lock_irq() doesn't disable IRQ on PREEMPT_RT. > > Not 100% sure if it would be benign or lead to actual bugs that need > to be fixed in -stable kernels. > > Cc'ing RT folks again :) The tail in __folio_migrate_mapping() after xas_unlock()/ swap_cluster_unlock(), is limited to __mod_lruvec_state() based stats updates. There is a preempt_disable_nested() in __mod_zone_page_state() to ensure that the update happens on the same CPU and is not preempted. On PREEMPT_RT there should be no in-IRQ updates of these counters. The IRQ enable at the end does nothing. There might be CPU migration between the individual stats updates. If it remains like this, it is fine. Please don't advertise ;) Sebastian ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-11 8:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20251110232008.1352063-1-shakeel.butt@linux.dev>
[not found] ` <aRKKfdN3B68wxFvN@hyeyoo>
[not found] ` <24969292-7543-456f-8b80-09c4521507e2@linux.dev>
[not found] ` <gsew67sciieqxbcczp5mzx4lj6pvvclfrxn6or3pzjqmj7eeic@7bxuwqgnqaum>
[not found] ` <99429fb8-dcec-43e7-a23b-bee54b8ed6e6@linux.dev>
2025-11-11 3:05 ` [PATCH 0/4] memcg: cleanup the memcg stats interfaces Harry Yoo
2025-11-11 8:01 ` Sebastian Andrzej Siewior
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).