File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -831,11 +831,15 @@ EXPORT_SYMBOL(unregister_shrinker);
831
831
/**
832
832
* synchronize_shrinkers - Wait for all running shrinkers to complete.
833
833
*
834
- * This is useful to guarantee that all shrinker invocations have seen an
835
- * update, before freeing memory.
834
+ * This is equivalent to calling unregister_shrink() and register_shrinker(),
835
+ * but atomically and with less overhead. This is useful to guarantee that all
836
+ * shrinker invocations have seen an update, before freeing memory, similar to
837
+ * rcu.
836
838
*/
837
839
void synchronize_shrinkers (void )
838
840
{
841
+ down_write (& shrinker_rwsem );
842
+ up_write (& shrinker_rwsem );
839
843
atomic_inc (& shrinker_srcu_generation );
840
844
synchronize_srcu (& shrinker_srcu );
841
845
}
You can’t perform that action at this time.
0 commit comments