Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/linux Make sure the RCU GC thread proc...



details:   https://anonhg.NetBSD.org/src/rev/54e1fd0101cb
branches:  trunk
changeset: 1027944:54e1fd0101cb
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:19:52 2021 +0000

description:
Make sure the RCU GC thread processes all callbacks before dying.

diffstat:

 sys/external/bsd/drm2/linux/linux_rcu.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 970830a6da78 -r 54e1fd0101cb sys/external/bsd/drm2/linux/linux_rcu.c
--- a/sys/external/bsd/drm2/linux/linux_rcu.c   Sun Dec 19 01:19:45 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_rcu.c   Sun Dec 19 01:19:52 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_rcu.c,v 1.6 2021/12/19 01:19:45 riastradh Exp $  */
+/*     $NetBSD: linux_rcu.c,v 1.7 2021/12/19 01:19:52 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_rcu.c,v 1.6 2021/12/19 01:19:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_rcu.c,v 1.7 2021/12/19 01:19:52 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -169,12 +169,20 @@
                        mutex_enter(&gc.lock);
                        gc.gen++;               /* done running */
                        cv_broadcast(&gc.cv);   /* notify rcu_barrier */
+
+                       /*
+                        * Go back to the top and get more work before
+                        * deciding whether to stop so that we
+                        * guarantee to run all callbacks.
+                        */
+                       continue;
                }
 
                /* If we're asked to close shop, do so.  */
                if (gc.dying)
                        break;
        }
+       KASSERT(gc.first == NULL);
        mutex_exit(&gc.lock);
 
        kthread_exit(0);



Home | Main Index | Thread Index | Old Index