[Devel] [PATCH RHEL7 COMMIT] mm: Fix lost wakeup in put_shrinker()

Kirill Tkhai ktkhai at virtuozzo.com
Mon Jan 27 11:47:18 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1062.7.1.vz7.130.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.7.1.vz7.130.11
------>
commit afa788f30454886f7c1fe261b7c94fdf96846533
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Mon Jan 27 08:47:18 2020 +0000

    mm: Fix lost wakeup in put_shrinker()
    
    We must wake unregister_shrinker() up on refcnt == 0.
    Waking it up on non zero refcnt is useless.
    
    https://pmc.acronis.com/browse/VSTOR-30477
    
    Fixes: 311e5a449916 "mm: fix hanging shrinker management on long do_shrink_slab"
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 mm/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 52a3679..bc54d3a 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -473,7 +473,7 @@ void put_shrinker(struct shrinker *shrinker)
 	 * not freed before wake_up.
 	 */
 	rcu_read_lock();
-	if (!refcount_dec_and_test(&shrinker->refcnt)) {
+	if (refcount_dec_and_test(&shrinker->refcnt)) {
 		/* Pairs with smp_mb in wait_event()->prepare_to_wait() */
 		smp_mb();
 		if (waitqueue_active(&shrinker->wq))


More information about the Devel mailing list