Source-Changes-HG archive

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

[src/trunk]: src/sys/kern vflush(9): Insert `involuntary' preemption point at...



details:   https://anonhg.NetBSD.org/src/rev/17e9b024177a
branches:  trunk
changeset: 370037:17e9b024177a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Sep 13 09:35:31 2022 +0000

description:
vflush(9): Insert `involuntary' preemption point at each vnode.

Currently there is a voluntary yield every 100ms, but that's a long
time.  Should help to avoid hogging the CPU while flushing lots of
data to big disks on systems without kpreemption.

diffstat:

 sys/kern/vfs_mount.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 1f20342fa020 -r 17e9b024177a sys/kern/vfs_mount.c
--- a/sys/kern/vfs_mount.c      Tue Sep 13 09:28:05 2022 +0000
+++ b/sys/kern/vfs_mount.c      Tue Sep 13 09:35:31 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_mount.c,v 1.96 2022/08/26 11:03:53 hannken Exp $   */
+/*     $NetBSD: vfs_mount.c,v 1.97 2022/09/13 09:35:31 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.96 2022/08/26 11:03:53 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.97 2022/09/13 09:35:31 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -549,6 +549,7 @@
                yield();
                *when = getticks() + hz / 10;
        }
+       preempt_point();
        return vfs_vnode_iterator_next1(marker, NULL, NULL, true);
 }
 



Home | Main Index | Thread Index | Old Index