From owner-freebsd-current@FreeBSD.ORG Fri Sep 16 19:51:58 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F745106564A for ; Fri, 16 Sep 2011 19:51:58 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id E99708FC0A for ; Fri, 16 Sep 2011 19:51:57 +0000 (UTC) Received: by gyf2 with SMTP id 2so3946974gyf.13 for ; Fri, 16 Sep 2011 12:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=Sne76rd2d9ymzgFtqfDX9qlo3frPgOosJNw8zBAgWHM=; b=hLgtSfZd+H8ototehAROawdv9qLo4+5HCA8+GBPKj0N/OBzAMUhOUfNqVBeXp0EILy DlL6JzbYpZAeL9OHec4QlH/2uQihWqchC24xsxQhxPaXFXSp3Ab/FZjXvMueMvh8Fb44 5zL0cXnS0yAQxaSr1fnWeFaxNuODoCDS/a8Ls= MIME-Version: 1.0 Received: by 10.68.71.200 with SMTP id x8mr2451404pbu.465.1316202716933; Fri, 16 Sep 2011 12:51:56 -0700 (PDT) Received: by 10.142.12.18 with HTTP; Fri, 16 Sep 2011 12:51:56 -0700 (PDT) Date: Fri, 16 Sep 2011 15:51:56 -0400 Message-ID: From: Arnaud Lacombe To: FreeBSD-Current Content-Type: text/plain; charset=ISO-8859-1 Subject: Very imprecise watchdogd(8) timeout X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2011 19:51:58 -0000 Hi, I just had a look to the way the timeout specified to watchdogd is passed to the kernel. watchdogd(8) says: The -t timeout specifies the desired timeout period in seconds. The default timeout is 16 seconds. So as a dumb user, I would expect `-t 30' to set the timeout to 30s. You can imagine my surprise when the watchdog ends up being set to 34s, result of the convoluted conversion from double to integer from the log base 2 of the timeout converted to nanosecond. That's more than 10% of error on this timeout to what the manual page says it would, and at the end, you can only set the watchdog to 62 different value. Folks, I'm definitively not impressed... - Arnaud