Re: [PATCH] mm/shmem: report RCU-tasks quiescent states while undoing a range
From: Paul E. McKenney
Date: Fri Sep 18 2026 - 16:48:27 EST
On Fri, Sep 18, 2026 at 01:43:42PM -0700, Andrew Morton wrote:
> On Fri, 18 Sep 2026 13:24:53 -0700 "Paul E. McKenney" <paulmck@xxxxxxxxxx> wrote:
>
> > >
> > > > --- a/mm/shmem.c
> > > > +++ b/mm/shmem.c
> > > > @@ -1367,7 +1367,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,
> > > > }
> > > > folio_batch_remove_exceptionals(&fbatch);
> > > > folio_batch_release(&fbatch);
> > > > - cond_resched();
> > > > + cond_resched_tasks_rcu_qs();
> > >
> > > Won't this change remove the cond_resched() function from old kernels
> > > which really want it?
> >
> > The cond_resched_tasks_rcu_qs() macro implies cond_resched():
> >
> > #define cond_resched_tasks_rcu_qs() \
> > do { \
> > rcu_tasks_qs(current, false); \
> > cond_resched(); \
> > } while (0)
>
> Oh, should've looked.
No problem, and yes, I do know that feeling. ;-)
Thanx, Paul
> And it appears to have been this way forever, so
> s/cond_resched/cond_resched_tasks_rcu_qs/ won't break old kernels.