From owner-freebsd-stable@FreeBSD.ORG Thu Aug 25 18:26:08 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E751106566B for ; Thu, 25 Aug 2011 18:26:08 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 179B28FC0A for ; Thu, 25 Aug 2011 18:26:07 +0000 (UTC) Received: by gwb15 with SMTP id 15so2372884gwb.13 for ; Thu, 25 Aug 2011 11:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=pozPNoH1XiQgXNdivUqHKBD/U+PK1eG2NrDU34NBzyw=; b=bFalVIq8x5jFh/ZYSk075g/QJ8CsSYm9OinAxNF95o6oQ5LD6B9nZSs+VXluvwzY+N wOFS2rTuNN+LofN6myL99GGOgbq7bM3UXAQl/4gD6WG0JH/WOHFmwTO04DkQ9zfitZ6R k1Ym1I7QeR/V/aFBWgeK68I0UTkhlyDwv0rfE= Received: by 10.231.4.3 with SMTP id 3mr38975ibp.72.1314294914113; Thu, 25 Aug 2011 10:55:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.42.4 with HTTP; Thu, 25 Aug 2011 10:54:43 -0700 (PDT) In-Reply-To: <4e55153e.Tj16zX3SskfuVesE%perryh@pluto.rain.com> References: <1B4FC0D8-60E6-49DA-BC52-688052C4DA51@langille.org> <20110819232125.GA4965@icarus.home.lan> <20110820032438.GA21925@icarus.home.lan> <4774BC00-F32B-4BF4-A955-3728F885CAA1@langille.org> <4E4FF4D6.1090305@os2.kiev.ua> <20110820183456.GA38317@icarus.home.lan> <4e50c931.gCNlQFqn5sVQXXax%perryh@pluto.rain.com> <20110821050051.GA47415@icarus.home.lan> <4e5141dd.mmh6t9R/knnc8Jll%perryh@pluto.rain.com> <4e55153e.Tj16zX3SskfuVesE%perryh@pluto.rain.com> From: Chris Rees Date: Thu, 25 Aug 2011 18:54:43 +0100 Message-ID: To: perryh@pluto.rain.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: vincepoy@gmail.com, freebsd-stable@freebsd.org, freebsd-ports@freebsd.org, freebsd@jdc.parodius.com Subject: Re: ports/sysutils/diskcheckd (Re: bad sector in gmirror HDD) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2011 18:26:08 -0000 On 24 August 2011 16:14, wrote: >> When the specified or calculated rate exceeds 64KB/sec, the >> required sleep interval between 64KB chunks is less than one >> second. =A0Since diskcheckd calculates the interval in whole seconds >> -- because it calls sleep() rather than usleep() or nanosleep() >> -- an interval of less than one second is calculated as zero ... >> I suspect the fix will be to calculate in microseconds, and call >> usleep() instead of sleep(). > > I think I may have this fixed. > > Could one of you try the attached patch? =A0I'm especially interested > to see if this also clears up the issues reported as connected with > gmirror (http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dports/143566), > since I haven't been able to reproduce that part here. > > Summary of changes: > > * Calculate delays in microseconds, so that delays of less than > =A0one second between reads (needed to implement rates exceeding > =A064KB/sec) do not get rounded down to zero. > > * Fix a reinitialization problem when handling SIGHUP. > > * Additional debug messages (only with -d). > > * Comment and manpage improvememts. > Hi Perry, The changes look good, so if there's no response for a few days I'll commit the changes. Thanks for rescuing the port :) Chris --=20 Chris Rees =A0 =A0 =A0 =A0 =A0| FreeBSD Developer crees@FreeBSD.org =A0 | http://people.freebsd.org/~crees