From nobody@FreeBSD.org  Fri Apr 18 13:21:38 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 857271065672
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Apr 2008 13:21:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 71CEF8FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Apr 2008 13:21:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m3IDLOK2036889
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Apr 2008 13:21:24 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m3IDLOLt036887;
	Fri, 18 Apr 2008 13:21:24 GMT
	(envelope-from nobody)
Message-Id: <200804181321.m3IDLOLt036887@www.freebsd.org>
Date: Fri, 18 Apr 2008 13:21:24 GMT
From: James Snyder <jbsnyder@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: zfs hang w/ prefetch on, zil off while running transmission-daemon
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         122888
>Category:       kern
>Synopsis:       [zfs] zfs hang w/ prefetch on, zil off while running transmission-daemon
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pjd
>State:          feedback
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 18 13:30:01 UTC 2008
>Closed-Date:    
>Last-Modified:  Tue Sep 29 07:18:32 UTC 2009
>Originator:     James Snyder
>Release:        FreeBSD 7.0-RELEASE
>Organization:
>Environment:
FreeBSD erlanger.local 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 10:35:36 UTC 2008     root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Start and run transmission-daemon with a torrent active for somewhere between a few hours and a day.  transmission-daemon will eventually hang in zfs:lo state (not sure if the state name is longer, I've just had top running when the hangs take place).  I've had this happen both on zfs on root, and with zfs just providing /usr.

It seems to only happen when the zil is disabled and prefetch is left enabled.

loader.conf:
zfs_load="YES"
vfs.root.mountfrom="zfs:tank/root"
vm.kmem_size_max="1073741824"
vm.kmem_size="1073741824"
vfs.zfs.zil_disable=1
>How-To-Repeat:
loader.conf:
zfs_load="YES"
vfs.root.mountfrom="zfs:tank/root"
vm.kmem_size_max="1073741824"
vm.kmem_size="1073741824"
vfs.zfs.zil_disable=1

- install transmission-daemon from ports, run transmission-daemon (it will daemonize, automatically backgrounding. I ran it as a regular user.)
- grab a torrent, such as KNOPPIX (http://torrent.unix-ag.uni-kl.de/)
- transmission-remote -a <torrentfile> (add the torrent)
- transmission-remote -s all  (start all the torrents)

wait hours to a day or so with whatever you want logging things running and active since anything that hits disk after the hang will get hung as well
>Fix:
Workaround seems to be to disable prefetch.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-amd64->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon May 5 01:39:18 UTC 2008 
Responsible-Changed-Why:  
Reclassify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122888 

From: Samuel Boivie <samuel@boivie.org>
To: bug-followup@freebsd.org,
 jbsnyder@gmail.com
Cc:  
Subject: Re: kern/122888: [zfs] zfs hang w/ prefetch on, zil off while running transmission-daemon
Date: Mon, 7 Sep 2009 21:12:29 +0200

 I'm seeing the same behavior using ktorrent on 8.0 beta3 
 amd64 without tuning. Workaround is good.
State-Changed-From-To: open->feedback 
State-Changed-By: pjd 
State-Changed-When: pon 28 wrz 2009 18:02:24 UTC 
State-Changed-Why:  
How much RAM do you systems have? 
PS. zfs:lo comes from zfs:lowmem, it means that process is stuck in ZFS trying 
to free memory, but if it is stuck for good, it means that ZFS cannot reclaim 
any memory. 


Responsible-Changed-From-To: freebsd-fs->pjd 
Responsible-Changed-By: pjd 
Responsible-Changed-When: pon 28 wrz 2009 18:02:24 UTC 
Responsible-Changed-Why:  
I'll take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122888 
>Unformatted:
