Module Name:    src
Committed By:   martin
Date:           Mon Aug 21 10:57:07 UTC 2023

Modified Files:
        src/sys/dev [netbsd-9]: vnd.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1716):

        sys/dev/vnd.c: revision 1.289

Neither limit the number of requests for the page daemon.

Otherwise you may deadlock when the backend needs to allocate
memory and the page daemon needs to flush dirty vnd buffers.

See PR 57421 for details.


To generate a diff of this commit:
cvs rdiff -u -r1.272.4.1 -r1.272.4.2 src/sys/dev/vnd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.272.4.1 src/sys/dev/vnd.c:1.272.4.2
--- src/sys/dev/vnd.c:1.272.4.1	Wed Mar 15 18:43:28 2023
+++ src/sys/dev/vnd.c	Mon Aug 21 10:57:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.272.4.1 2023/03/15 18:43:28 martin Exp $	*/
+/*	$NetBSD: vnd.c,v 1.272.4.2 2023/08/21 10:57:07 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.272.4.1 2023/03/15 18:43:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.272.4.2 2023/08/21 10:57:07 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -122,6 +122,8 @@ __KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.27
 #include <sys/module.h>
 #include <sys/compat_stub.h>
 
+#include <uvm/uvm.h>
+
 #include <net/zlib.h>
 
 #include <miscfs/genfs/genfs.h>
@@ -558,7 +560,7 @@ vndstrategy(struct buf *bp)
 		 * thread to add requests, as a wedge on vnd queues
 		 * requests with biodone() -> dkstart() -> vndstrategy().
 		 */
-		if (curlwp != vnd->sc_kthread) {
+		if (curlwp != vnd->sc_kthread && curlwp != uvm.pagedaemon_lwp) {
 			while (vnd->sc_pending >= VND_MAXPENDING(vnd))
 				tsleep(&vnd->sc_pending, PRIBIO, "vndpc", 0);
 		}

Reply via email to