Re: [PATCH v1 04/26] mm: vmscan: refactor move_folios_to_lru()

Sebastian Andrzej Siewior
2025-11-07T07:18:36Z

On 2025-11-07 14:11:27 [+0900], Harry Yoo wrote:
> > @@ -4735,14 +4734,15 @@ static int evict_folios(unsigned long nr_to_scan, struct lruvec *lruvec,
> > set_mask_bits(&folio->flags.f, LRU_REFS_FLAGS, BIT(PG_active));
> > }
> >
> > - spin_lock_irq(&lruvec->lru_lock);
> > -
> > - move_folios_to_lru(lruvec, &list);
> > + move_folios_to_lru(&list);
> >
> > + local_irq_disable();
> > walk = current->reclaim_state->mm_walk;
> > if (walk && walk->batched) {
> > walk->lruvec = lruvec;
> > + spin_lock(&lruvec->lru_lock);
> > reset_batch_size(walk);
> > + spin_unlock(&lruvec->lru_lock);
> > }
>
> Cc'ing RT folks as they may not want to disable IRQ on PREEMPT_RT.

Thank you, this is not going to work. The local_irq_disable() shouldn't
be used.

> IIRC there has been some effort in MM to reduce the scope of
> IRQ-disabled section in MM when PREEMPT_RT config was added to the
> mainline. spin_lock_irq() doesn't disable IRQ on PREEMPT_RT.
Exactly.

Sebastian