NetBSD Problem Report #57263

From root@pip.kardel.name  Wed Mar  8 12:59:48 2023
Return-Path: <root@pip.kardel.name>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D4A651A9239
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  8 Mar 2023 12:59:48 +0000 (UTC)
Message-Id: <20230308125943.3BBF8AAAC82F@pip.kardel.name>
Date: Wed,  8 Mar 2023 13:59:43 +0100 (CET)
From: kardel@netbsd.org
Reply-To: kardel@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: vnd locks up when using vn_rdwr
X-Send-Pr-Version: 3.95

>Number:         57263
>Category:       kern
>Synopsis:       vnd locks up when using vn_rdwr
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    hannken
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 08 13:00:00 +0000 2023
>Closed-Date:    Thu Mar 16 09:52:58 +0000 2023
>Last-Modified:  Thu Mar 16 09:52:58 +0000 2023
>Originator:     Frank Kardel
>Release:        NetBSD 9.99.100
>Organization:

>Environment:


System: NetBSD pip.kardel.name 9.99.100 NetBSD 9.99.100 (PIPGEN) #0: Fri Feb 17 20:19:40 CET 2023 ...
Architecture: x86_64
Machine: amd64
>Description:
	vndX stalls on following setups
		- ffs on raidX
		- zfs
	the wchan is "vndpc" which is only used when
	vnd uses vn_rdwr() for I/O.
	vnd will work when vnd can use strategy() and the block mapping functions.
	thus, currently vnd is of limited use
>How-To-Repeat:
	configure vnd device off of ffs on raidX or zfs files systems. Do some
	heavy I/O and get stuck on "vndpc".
	the waiting code fragment in vndstrategy is:
        if ((vnd->sc_flags & VNF_USE_VN_RDWR)) {
                KASSERT(vnd->sc_pending >= 0 &&
                    vnd->sc_pending <= VND_MAXPENDING(vnd));
                while (vnd->sc_pending == VND_MAXPENDING(vnd))
                        tsleep(&vnd->sc_pending, PRIBIO, "vndpc", 0);
                vnd->sc_pending++;
        }

>Fix:
	find the root cause why vnd->sc_pending is stuck at VND_MAXPENDING(vnd)

>Release-Note:

>Audit-Trail:
From: "Juergen Hannken-Illjes" <hannken@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57263 CVS commit: src/sys/dev
Date: Tue, 14 Mar 2023 12:55:43 +0000

 Module Name:	src
 Committed By:	hannken
 Date:		Tue Mar 14 12:55:43 UTC 2023

 Modified Files:
 	src/sys/dev: vnd.c

 Log Message:
 Do not limit the number of pending requests for the worker thread.

 With wedge on vnd it prevents a deadlock when requests get queued with
 biodone() -> dkstart() -> vndstrategy().

 Fixes PR kern/57263 "vnd locks up when using vn_rdwr"


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

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

From: Frank Kardel <kardel@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: PR/57263 CVS commit: src/sys/dev
Date: Tue, 14 Mar 2023 15:16:44 +0100

 Danke!


 On 03/14/23 14:00, Juergen Hannken-Illjes wrote:
 > The following reply was made to PR kern/57263; it has been noted by GNATS.
 >
 > From: "Juergen Hannken-Illjes" <hannken@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc:
 > Subject: PR/57263 CVS commit: src/sys/dev
 > Date: Tue, 14 Mar 2023 12:55:43 +0000
 >
 >   Module Name:	src
 >   Committed By:	hannken
 >   Date:		Tue Mar 14 12:55:43 UTC 2023
 >   
 >   Modified Files:
 >   	src/sys/dev: vnd.c
 >   
 >   Log Message:
 >   Do not limit the number of pending requests for the worker thread.
 >   
 >   With wedge on vnd it prevents a deadlock when requests get queued with
 >   biodone() -> dkstart() -> vndstrategy().
 >   
 >   Fixes PR kern/57263 "vnd locks up when using vn_rdwr"
 >   
 >   
 >   To generate a diff of this commit:
 >   cvs rdiff -u -r1.287 -r1.288 src/sys/dev/vnd.c
 >   
 >   Please note that diffs are not public domain; they are subject to the
 >   copyright notices on the relevant files.
 >   

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57263 CVS commit: [netbsd-9] src/sys/dev
Date: Wed, 15 Mar 2023 18:43:29 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Wed Mar 15 18:43:28 UTC 2023

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

 Log Message:
 Pull up following revision(s) (requested by hannken in ticket #1614):

 	sys/dev/vnd.c: revision 1.288

 Do not limit the number of pending requests for the worker thread.

 With wedge on vnd it prevents a deadlock when requests get queued with
 biodone() -> dkstart() -> vndstrategy().

 Fixes PR kern/57263 "vnd locks up when using vn_rdwr"


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

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

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57263 CVS commit: [netbsd-10] src/sys/dev
Date: Thu, 16 Mar 2023 07:19:51 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu Mar 16 07:19:51 UTC 2023

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

 Log Message:
 Pull up following revision(s) (requested by hannken in ticket #121):

 	sys/dev/vnd.c: revision 1.288

 Do not limit the number of pending requests for the worker thread.

 With wedge on vnd it prevents a deadlock when requests get queued with
 biodone() -> dkstart() -> vndstrategy().

 Fixes PR kern/57263 "vnd locks up when using vn_rdwr"


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

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

Responsible-Changed-From-To: kern-bug-people->hannken
Responsible-Changed-By: hannken@NetBSD.org
Responsible-Changed-When: Thu, 16 Mar 2023 09:52:58 +0000
Responsible-Changed-Why:
Committed the fix.


State-Changed-From-To: open->closed
State-Changed-By: hannken@NetBSD.org
State-Changed-When: Thu, 16 Mar 2023 09:52:58 +0000
State-Changed-Why:
Fixed in head; pullups to -9 and -10 complete.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.