Re: [PATCH] mm/shmem: report RCU-tasks quiescent states while undoing a range
From: Andrew Morton
Date: Fri Sep 18 2026 - 16:43:53 EST
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.
And it appears to have been this way forever, so
s/cond_resched/cond_resched_tasks_rcu_qs/ won't break old kernels.