Skip to contentSkip to conversation

mm: lru_cache_disable: use synchronize_rcu_expedited

PATCH New Marcelo Tosatti 1 participant 1 message May 30, 2022 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: lru_cache_disable: use synchronize_rcu_expedited

commit ff042f4a9b050895a42cae893cc01fa2ca81b95c replaced lru_cache_disable's usage of work queues with synchronize_rcu.

Some users reported performance regressions due to this commit, for example:
https://lore.kernel.org/all/20220521234616.GO1790663@paulmck-ThinkPad-P17-Gen-1/T/

Switching to synchronize_rcu_expedited fixes the problem.

mm/swap.c +1 -1
index bceff0cb559c..04a8bbf9817a 100644
@@ -879,7 +879,7 @@ void lru_cache_disable(void)
 	 * lru_disable_count = 0 will have exited the critical
 	 * section when synchronize_rcu() returns.
 	 */
-	synchronize_rcu();
+	synchronize_rcu_expedited();
 #ifdef CONFIG_SMP
 	__lru_add_drain_all(true);
 #else