Date: Thu, 16 Apr 2009 10:52:10 +0100 (BST) From: "Mark Powell" <M.S.Powell@salford.ac.uk> To: "James R. Van Artsdalen" <james-freebsd-current@jrv.org> Cc: freebsd-current@freebsd.org Subject: Re: ata FLUSHCACHE timeout errors? [patch] Message-ID: <20090416104803.O88758@rust.salford.ac.uk> In-Reply-To: <49E69F7C.9020402@jrv.org> References: <49E4CED7.2040206@jrv.org> <49E69F7C.9020402@jrv.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Wed, 15 Apr 2009, James R. Van Artsdalen wrote: > James R. Van Artsdalen wrote: >> I am getting many FLUSHCACHE timeout errors during "zfs recv" operations. > > This patch fixes this. PR to be filed. > In addition this causes any ata request that times out to print the > timeout, since it's going to be the timeout itself that's likely wrong. This is well known and had been repeated ad. inf.. Problem is, it never got addressed: http://wiki.freebsd.org/JeremyChadwick/ATA_issues_and_troubleshooting Attached is an 8-CURRENT patch which makes the ata timeout a tuneable. Shamelessy ripped off the FreeNAS patch on the above url. Cheers. -- Mark Powell - UNIX System Administrator - The University of Salford Information & Learning Services, Clifford Whitworth Building, Salford University, Manchester, M5 4WT, UK. Tel: +44 161 295 6843 Fax: +44 161 295 5888 www.pgp.com for PGP key [-- Attachment #2 --] --- ata-all.c.orig 2009-03-19 14:00:36.000000000 +0000 +++ ata-all.c 2009-03-19 14:04:55.000000000 +0000 @@ -75,6 +75,7 @@ uma_zone_t ata_request_zone; uma_zone_t ata_composite_zone; int ata_wc = 1; +int ata_to = 5; int ata_setmax = 0; int ata_dma_check_80pin = 1; @@ -97,6 +98,9 @@ TUNABLE_INT("hw.ata.wc", &ata_wc); SYSCTL_INT(_hw_ata, OID_AUTO, wc, CTLFLAG_RDTUN, &ata_wc, 0, "ATA disk write caching"); +TUNABLE_INT("hw.ata.to", &ata_to); +SYSCTL_INT(_hw_ata, OID_AUTO, to, CTLFLAG_RW, &ata_to, 0, + "ATA disk timeout vis-a-vis power-saving"); TUNABLE_INT("hw.ata.setmax", &ata_setmax); SYSCTL_INT(_hw_ata, OID_AUTO, setmax, CTLFLAG_RDTUN, &ata_setmax, 0, "ATA disk set max native address"); --- ata-all.h.orig 2009-03-19 14:00:36.000000000 +0000 +++ ata-all.h 2009-03-19 14:05:31.000000000 +0000 @@ -545,6 +545,7 @@ extern struct intr_config_hook *ata_delayed_attach; extern devclass_t ata_devclass; extern int ata_wc; +extern int ata_to; extern int ata_setmax; extern int ata_dma_check_80pin; --- ata-disk.c.orig 2009-03-19 14:00:36.000000000 +0000 +++ ata-disk.c 2009-03-19 14:06:41.000000000 +0000 @@ -230,7 +230,7 @@ } request->dev = dev; request->flags = ATA_R_CONTROL; - request->timeout = 5; + request->timeout = ata_to; request->retries = 1; request->callback = ad_power_callback; request->u.ata.command = ATA_STANDBY_IMMEDIATE; @@ -265,7 +265,7 @@ request->timeout = 31; } else { - request->timeout = 5; + request->timeout = ata_to; } request->retries = 2; request->data = bp->bio_data; @@ -460,7 +460,7 @@ request->u.ata.count = 0; request->u.ata.feature = 0; request->flags = ATA_R_CONTROL | ATA_R_QUIET; - request->timeout = 5; + request->timeout = ata_to; request->retries = 0; ata_queue_request(request); if (request->status & ATA_S_ERROR) @@ -479,7 +479,7 @@ request->u.ata.count = 1; request->u.ata.feature = 0; request->flags = ATA_R_CONTROL; - request->timeout = 5; + request->timeout = ata_to; request->retries = 0; ata_queue_request(request); if (request->status & ATA_S_ERROR)help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090416104803.O88758>
