Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/common/linux linux: Rate-limit RCU GC threa...
details: https://anonhg.NetBSD.org/src/rev/bdc11ca7f077
branches: trunk
changeset: 1028994:bdc11ca7f077
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 12:40:03 2021 +0000
description:
linux: Rate-limit RCU GC thread as a cheap experiment.
diffstat:
sys/external/bsd/common/linux/linux_rcu.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diffs (34 lines):
diff -r 52b6a891da3b -r bdc11ca7f077 sys/external/bsd/common/linux/linux_rcu.c
--- a/sys/external/bsd/common/linux/linux_rcu.c Sun Dec 19 12:39:56 2021 +0000
+++ b/sys/external/bsd/common/linux/linux_rcu.c Sun Dec 19 12:40:03 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_rcu.c,v 1.5 2021/12/19 12:07:55 riastradh Exp $ */
+/* $NetBSD: linux_rcu.c,v 1.6 2021/12/19 12:40:03 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.5 2021/12/19 12:07:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_rcu.c,v 1.6 2021/12/19 12:40:03 riastradh Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -276,6 +276,15 @@
/* Finished a batch of work. Notify rcu_barrier. */
gc.gen++;
cv_broadcast(&gc.cv);
+
+ /*
+ * Limit ourselves to one batch per tick, in an attempt
+ * to make the batches larger.
+ *
+ * XXX We should maybe also limit the size of each
+ * batch.
+ */
+ (void)kpause("lxrcubat", /*intr*/false, /*timo*/1, &gc.lock);
}
KASSERT(gc.first_callback == NULL);
KASSERT(gc.first_kfree == NULL);
Home |
Main Index |
Thread Index |
Old Index