mm: shmem: Reschedule by unlocking and relocking RCU because of missing API

The commit introducing the call to cond_resched_rcu() is backported
from a recent kernel version, which has got some very good updates
to the RCU, including a new function cond_resched_rcu which is
doing not-so-complicated rescheduling stuff.
Kernel 3.10 hasn't got any of these and porting would be overkill.

On our current code base, the RCU management is pretty stupid
compared to newer kernels, so it's just ok to reschedule by just
unlocking the RCU and relocking it: this will allow to update its
status and the drivers will be happy.

Change-Id: Ic2cd85f97722e02a983d1338bf3df69d87c4be28
This commit is contained in:
Angelo G. Del Regno 2017-03-15 00:56:03 +01:00 committed by voidanix
parent d41857acb8
commit 624ae7ae04
1 changed files with 4 additions and 2 deletions

View File

@ -1924,7 +1924,8 @@ restart:
}
if (need_resched()) {
cond_resched_rcu();
rcu_read_unlock();
rcu_read_lock();
start = iter.index + 1;
goto restart;
}
@ -1994,7 +1995,8 @@ restart:
spin_unlock_irq(&mapping->tree_lock);
continue_resched:
if (need_resched()) {
cond_resched_rcu();
rcu_read_unlock();
rcu_read_lock();
start = iter.index + 1;
goto restart;
}