linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 2.6.0-test4 - Watchdog patches - Documentation
@ 2003-09-06 10:51 Wim Van Sebroeck
  2003-12-29 19:52 ` [PATCH] 2.6.0 - Watchdog patches Wim Van Sebroeck
  0 siblings, 1 reply; 17+ messages in thread
From: Wim Van Sebroeck @ 2003-09-06 10:51 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Hi Linus,

please do a

	bk pull http://linux-watchdog.bkbits.net/linux-2.5-watchdog

This will update the following files:

 Documentation/pcwd-watchdog.txt          |  132 ----------
 Documentation/watchdog-api.txt           |  390 -------------------------------
 Documentation/watchdog.txt               |  113 --------
 Documentation/watchdog/pcwd-watchdog.txt |  134 ++++++++++
 Documentation/watchdog/watchdog-api.txt  |  390 +++++++++++++++++++++++++++++++
 Documentation/watchdog/watchdog.txt      |  115 +++++++++
 6 files changed, 639 insertions(+), 635 deletions(-)

through these ChangeSets:

<wim@iguana.be> (03/09/06 1.1180)
   [WATCHDOG] Documentation
   
   move all watchdog documentation into Documentation/watchdog/


The ChangeSets can also be looked at on:
	http://linux-watchdog.bkbits.net:8080/linux-2.5-watchdog

For completeness, I added the patches below.

Greetings,
Wim.

================================================================================
diff -Nru a/Documentation/pcwd-watchdog.txt b/Documentation/pcwd-watchdog.txt
--- a/Documentation/pcwd-watchdog.txt	Sat Sep  6 12:47:30 2003
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,134 +0,0 @@
-                     Berkshire Products PC Watchdog Card
-                   Support for ISA Cards  Revision A and C
-           Documentation and Driver by Ken Hollis <kenji@bitgate.com>
-
- The PC Watchdog is a card that offers the same type of functionality that
- the WDT card does, only it doesn't require an IRQ to run.  Furthermore,
- the Revision C card allows you to monitor any IO Port to automatically
- trigger the card into being reset.  This way you can make the card
- monitor hard drive status, or anything else you need.
-
- The Watchdog Driver has one basic role: to talk to the card and send
- signals to it so it doesn't reset your computer ... at least during
- normal operation.
-
- The Watchdog Driver will automatically find your watchdog card, and will
- attach a running driver for use with that card.  After the watchdog
- drivers have initialized, you can then talk to the card using the PC
- Watchdog program, available from http://ftp.bitgate.com/pcwd/.
-
- I suggest putting a "watchdog -d" before the beginning of an fsck, and
- a "watchdog -e -t 1" immediately after the end of an fsck.  (Remember
- to run the program with an "&" to run it in the background!)
-
- If you want to write a program to be compatible with the PC Watchdog
- driver, simply do the following:
-
--- Snippet of code --
-/*
- * Watchdog Driver Test Program
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <linux/pcwd.h>
-
-int fd;
-
-/*
- * This function simply sends an IOCTL to the driver, which in turn ticks
- * the PC Watchdog card to reset its internal timer so it doesn't trigger
- * a computer reset.
- */
-void keep_alive(void)
-{
-    int dummy;
-
-    ioctl(fd, WDIOC_KEEPALIVE, &dummy);
-}
-
-/*
- * The main program.  Run the program with "-d" to disable the card,
- * or "-e" to enable the card.
- */
-int main(int argc, char *argv[])
-{
-    fd = open("/dev/watchdog", O_WRONLY);
-
-    if (fd == -1) {
-	fprintf(stderr, "Watchdog device not enabled.\n");
-	fflush(stderr);
-	exit(-1);
-    }
-
-    if (argc > 1) {
-	if (!strncasecmp(argv[1], "-d", 2)) {
-	    ioctl(fd, WDIOC_SETOPTIONS, WDIOS_DISABLECARD);
-	    fprintf(stderr, "Watchdog card disabled.\n");
-	    fflush(stderr);
-	    exit(0);
-	} else if (!strncasecmp(argv[1], "-e", 2)) {
-	    ioctl(fd, WDIOC_SETOPTIONS, WDIOS_ENABLECARD);
-	    fprintf(stderr, "Watchdog card enabled.\n");
-	    fflush(stderr);
-	    exit(0);
-	} else {
-	    fprintf(stderr, "-d to disable, -e to enable.\n");
-	    fprintf(stderr, "run by itself to tick the card.\n");
-	    fflush(stderr);
-	    exit(0);
-	}
-    } else {
-	fprintf(stderr, "Watchdog Ticking Away!\n");
-	fflush(stderr);
-    }
-
-    while(1) {
-	keep_alive();
-	sleep(1);
-    }
-}
--- End snippet --
-
- Other IOCTL functions include:
-
-	WDIOC_GETSUPPORT
-		This returns the support of the card itself.  This
-		returns in structure "PCWDS" which returns:
-			options = WDIOS_TEMPPANIC
-				  (This card supports temperature)
-			firmware_version = xxxx
-				  (Firmware version of the card)
-
-	WDIOC_GETSTATUS
-		This returns the status of the card, with the bits of
-		WDIOF_* bitwise-anded into the value.  (The comments
-		are in linux/pcwd.h)
-
-	WDIOC_GETBOOTSTATUS
-		This returns the status of the card that was reported
-		at bootup.
-
-	WDIOC_GETTEMP
-		This returns the temperature of the card.  (You can also
-		read /dev/watchdog, which gives a temperature update
-		every second.)
-
-	WDIOC_SETOPTIONS
-		This lets you set the options of the card.  You can either
-		enable or disable the card this way.
-
-	WDIOC_KEEPALIVE
-		This pings the card to tell it not to reset your computer.
-
- And that's all she wrote!
-
- -- Ken Hollis
-    (kenji@bitgate.com)
-
-(This documentation may be out of date.  Check
- http://ftp.bitgate.com/pcwd/ for the absolute latest additions.)
diff -Nru a/Documentation/watchdog/pcwd-watchdog.txt b/Documentation/watchdog/pcwd-watchdog.txt
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/watchdog/pcwd-watchdog.txt	Sat Sep  6 12:47:30 2003
@@ -0,0 +1,134 @@
+                     Berkshire Products PC Watchdog Card
+                   Support for ISA Cards  Revision A and C
+           Documentation and Driver by Ken Hollis <kenji@bitgate.com>
+
+ The PC Watchdog is a card that offers the same type of functionality that
+ the WDT card does, only it doesn't require an IRQ to run.  Furthermore,
+ the Revision C card allows you to monitor any IO Port to automatically
+ trigger the card into being reset.  This way you can make the card
+ monitor hard drive status, or anything else you need.
+
+ The Watchdog Driver has one basic role: to talk to the card and send
+ signals to it so it doesn't reset your computer ... at least during
+ normal operation.
+
+ The Watchdog Driver will automatically find your watchdog card, and will
+ attach a running driver for use with that card.  After the watchdog
+ drivers have initialized, you can then talk to the card using the PC
+ Watchdog program, available from http://ftp.bitgate.com/pcwd/.
+
+ I suggest putting a "watchdog -d" before the beginning of an fsck, and
+ a "watchdog -e -t 1" immediately after the end of an fsck.  (Remember
+ to run the program with an "&" to run it in the background!)
+
+ If you want to write a program to be compatible with the PC Watchdog
+ driver, simply do the following:
+
+-- Snippet of code --
+/*
+ * Watchdog Driver Test Program
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <linux/pcwd.h>
+
+int fd;
+
+/*
+ * This function simply sends an IOCTL to the driver, which in turn ticks
+ * the PC Watchdog card to reset its internal timer so it doesn't trigger
+ * a computer reset.
+ */
+void keep_alive(void)
+{
+    int dummy;
+
+    ioctl(fd, WDIOC_KEEPALIVE, &dummy);
+}
+
+/*
+ * The main program.  Run the program with "-d" to disable the card,
+ * or "-e" to enable the card.
+ */
+int main(int argc, char *argv[])
+{
+    fd = open("/dev/watchdog", O_WRONLY);
+
+    if (fd == -1) {
+	fprintf(stderr, "Watchdog device not enabled.\n");
+	fflush(stderr);
+	exit(-1);
+    }
+
+    if (argc > 1) {
+	if (!strncasecmp(argv[1], "-d", 2)) {
+	    ioctl(fd, WDIOC_SETOPTIONS, WDIOS_DISABLECARD);
+	    fprintf(stderr, "Watchdog card disabled.\n");
+	    fflush(stderr);
+	    exit(0);
+	} else if (!strncasecmp(argv[1], "-e", 2)) {
+	    ioctl(fd, WDIOC_SETOPTIONS, WDIOS_ENABLECARD);
+	    fprintf(stderr, "Watchdog card enabled.\n");
+	    fflush(stderr);
+	    exit(0);
+	} else {
+	    fprintf(stderr, "-d to disable, -e to enable.\n");
+	    fprintf(stderr, "run by itself to tick the card.\n");
+	    fflush(stderr);
+	    exit(0);
+	}
+    } else {
+	fprintf(stderr, "Watchdog Ticking Away!\n");
+	fflush(stderr);
+    }
+
+    while(1) {
+	keep_alive();
+	sleep(1);
+    }
+}
+-- End snippet --
+
+ Other IOCTL functions include:
+
+	WDIOC_GETSUPPORT
+		This returns the support of the card itself.  This
+		returns in structure "PCWDS" which returns:
+			options = WDIOS_TEMPPANIC
+				  (This card supports temperature)
+			firmware_version = xxxx
+				  (Firmware version of the card)
+
+	WDIOC_GETSTATUS
+		This returns the status of the card, with the bits of
+		WDIOF_* bitwise-anded into the value.  (The comments
+		are in linux/pcwd.h)
+
+	WDIOC_GETBOOTSTATUS
+		This returns the status of the card that was reported
+		at bootup.
+
+	WDIOC_GETTEMP
+		This returns the temperature of the card.  (You can also
+		read /dev/watchdog, which gives a temperature update
+		every second.)
+
+	WDIOC_SETOPTIONS
+		This lets you set the options of the card.  You can either
+		enable or disable the card this way.
+
+	WDIOC_KEEPALIVE
+		This pings the card to tell it not to reset your computer.
+
+ And that's all she wrote!
+
+ -- Ken Hollis
+    (kenji@bitgate.com)
+
+(This documentation may be out of date.  Check
+ http://ftp.bitgate.com/pcwd/ for the absolute latest additions.)
diff -Nru a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.txt
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/watchdog/watchdog-api.txt	Sat Sep  6 12:47:30 2003
@@ -0,0 +1,390 @@
+The Linux Watchdog driver API.
+
+Copyright 2002 Christer Weingel <wingel@nano-system.com>
+
+Some parts of this document are copied verbatim from the sbc60xxwdt
+driver which is (c) Copyright 2000 Jakob Oestergaard <jakob@ostenfeld.dk>
+
+This document describes the state of the Linux 2.4.18 kernel.
+
+Introduction:
+
+A Watchdog Timer (WDT) is a hardware circuit that can reset the
+computer system in case of a software fault.  You probably knew that
+already.
+
+Usually a userspace daemon will notify the kernel watchdog driver via the
+/dev/watchdog special device file that userspace is still alive, at
+regular intervals.  When such a notification occurs, the driver will
+usually tell the hardware watchdog that everything is in order, and
+that the watchdog should wait for yet another little while to reset
+the system.  If userspace fails (RAM error, kernel bug, whatever), the
+notifications cease to occur, and the hardware watchdog will reset the
+system (causing a reboot) after the timeout occurs.
+
+The Linux watchdog API is a rather AD hoc construction and different
+drivers implement different, and sometimes incompatible, parts of it.
+This file is an attempt to document the existing usage and allow
+future driver writers to use it as a reference.
+
+The simplest API:
+
+All drivers support the basic mode of operation, where the watchdog
+activates as soon as /dev/watchdog is opened and will reboot unless
+the watchdog is pinged within a certain time, this time is called the
+timeout or margin.  The simplest way to ping the watchdog is to write
+some data to the device.  So a very simple watchdog daemon would look
+like this:
+
+int main(int argc, const char *argv[]) {
+	int fd=open("/dev/watchdog",O_WRONLY);
+	if (fd==-1) {
+		perror("watchdog");
+		exit(1);
+	}
+	while(1) {
+		write(fd, "\0", 1);
+		sleep(10);
+	}
+}
+
+A more advanced driver could for example check that a HTTP server is
+still responding before doing the write call to ping the watchdog.
+
+When the device is closed, the watchdog is disabled.  This is not
+always such a good idea, since if there is a bug in the watchdog
+daemon and it crashes the system will not reboot.  Because of this,
+some of the drivers support the configuration option "Disable watchdog
+shutdown on close", CONFIG_WATCHDOG_NOWAYOUT.  If it is set to Y when
+compiling the kernel, there is no way of disabling the watchdog once
+it has been started.  So, if the watchdog dameon crashes, the system
+will reboot after the timeout has passed.
+
+Some other drivers will not disable the watchdog, unless a specific
+magic character 'V' has been sent /dev/watchdog just before closing
+the file.  If the userspace daemon closes the file without sending
+this special character, the driver will assume that the daemon (and
+userspace in general) died, and will stop pinging the watchdog without
+disabling it first.  This will then cause a reboot.
+
+The ioctl API:
+
+All conforming drivers also support an ioctl API.
+
+Pinging the watchdog using an ioctl:
+
+All drivers that have an ioctl interface support at least one ioctl,
+KEEPALIVE.  This ioctl does exactly the same thing as a write to the
+watchdog device, so the main loop in the above program could be
+replaced with:
+
+	while (1) {
+		ioctl(fd, WDIOC_KEEPALIVE, 0);
+		sleep(10);
+	}
+
+the argument to the ioctl is ignored.
+
+Setting and getting the timeout:
+
+For some drivers it is possible to modify the watchdog timeout on the
+fly with the SETTIMEOUT ioctl, those drivers have the WDIOF_SETTIMEOUT
+flag set in their option field.  The argument is an integer
+representing the timeout in seconds.  The driver returns the real
+timeout used in the same variable, and this timeout might differ from
+the requested one due to limitation of the hardware.
+
+    int timeout = 45;
+    ioctl(fd, WDIOC_SETTIMEOUT, &timeout);
+    printf("The timeout was set to %d seconds\n", timeout);
+
+This example might actually print "The timeout was set to 60 seconds"
+if the device has a granularity of minutes for its timeout.
+
+Starting with the Linux 2.4.18 kernel, it is possible to query the
+current timeout using the GETTIMEOUT ioctl.
+
+    ioctl(fd, WDIOC_GETTIMEOUT, &timeout);
+    printf("The timeout was is %d seconds\n", timeout);
+
+Envinronmental monitoring:
+
+All watchdog drivers are required return more information about the system,
+some do temperature, fan and power level monitoring, some can tell you
+the reason for the last reboot of the system.  The GETSUPPORT ioctl is
+available to ask what the device can do:
+
+	struct watchdog_info ident;
+	ioctl(fd, WDIOC_GETSUPPORT, &ident);
+
+the fields returned in the ident struct are:
+
+        identity		a string identifying the watchdog driver
+	firmware_version	the firmware version of the card if available
+	options			a flags describing what the device supports
+
+the options field can have the following bits set, and describes what
+kind of information that the GET_STATUS and GET_BOOT_STATUS ioctls can
+return.   [FIXME -- Is this correct?]
+
+	WDIOF_OVERHEAT		Reset due to CPU overheat
+
+The machine was last rebooted by the watchdog because the thermal limit was
+exceeded
+
+	WDIOF_FANFAULT		Fan failed
+
+A system fan monitored by the watchdog card has failed
+
+	WDIOF_EXTERN1		External relay 1
+
+External monitoring relay/source 1 was triggered. Controllers intended for
+real world applications include external monitoring pins that will trigger
+a reset.
+
+	WDIOF_EXTERN2		External relay 2
+
+External monitoring relay/source 2 was triggered
+
+	WDIOF_POWERUNDER	Power bad/power fault
+
+The machine is showing an undervoltage status
+
+	WDIOF_CARDRESET		Card previously reset the CPU
+
+The last reboot was caused by the watchdog card
+
+	WDIOF_POWEROVER		Power over voltage
+
+The machine is showing an overvoltage status. Note that if one level is
+under and one over both bits will be set - this may seem odd but makes
+sense.
+
+	WDIOF_KEEPALIVEPING	Keep alive ping reply
+
+The watchdog saw a keepalive ping since it was last queried.
+
+	WDIOF_SETTIMEOUT	Can set/get the timeout
+
+
+For those drivers that return any bits set in the option field, the
+GETSTATUS and GETBOOTSTATUS ioctls can be used to ask for the current
+status, and the status at the last reboot, respectively.  
+
+    int flags;
+    ioctl(fd, WDIOC_GETSTATUS, &flags);
+
+    or
+
+    ioctl(fd, WDIOC_GETBOOTSTATUS, &flags);
+
+Note that not all devices support these two calls, and some only
+support the GETBOOTSTATUS call.
+
+Some drivers can measure the temperature using the GETTEMP ioctl.  The
+returned value is the temperature in degrees farenheit.
+
+    int temperature;
+    ioctl(fd, WDIOC_GETTEMP, &temperature);
+
+Finally the SETOPTIONS ioctl can be used to control some aspects of
+the cards operation; right now the pcwd driver is the only one
+supporting thiss ioctl.
+
+    int options = 0;
+    ioctl(fd, WDIOC_SETOPTIONS, options);
+
+The following options are available:
+
+	WDIOS_DISABLECARD	Turn off the watchdog timer
+	WDIOS_ENABLECARD	Turn on the watchdog timer
+	WDIOS_TEMPPANIC		Kernel panic on temperature trip
+
+[FIXME -- better explanations]
+
+Implementations in the current drivers in the kernel tree:
+
+Here I have tried to summarize what the different drivers support and
+where they do strange things compared to the other drivers.
+
+acquirewdt.c -- Acquire Single Board Computer
+
+	This driver has a hardcoded timeout of 1 minute
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT
+
+	GETSUPPORT returns KEEPALIVEPING.  GETSTATUS will return 1 if
+	the device is open, 0 if not.  [FIXME -- isn't this rather
+	silly?  To be able to use the ioctl, the device must be open
+	and so GETSTATUS will always return 1].
+
+advantechwdt.c -- Advantech Single Board Computer
+
+	Timeout that defaults to 60 seconds, supports SETTIMEOUT.
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT
+
+	GETSUPPORT returns WDIOF_KEEPALIVEPING and WDIOF_SETTIMEOUT.
+	The GETSTATUS call returns if the device is open or not.
+	[FIXME -- silliness again?]
+	
+eurotechwdt.c -- Eurotech CPU-1220/1410
+
+	The timeout can be set using the SETTIMEOUT ioctl and defaults
+	to 60 seconds.
+
+	Also has a module parameter "ev", event type which controls
+	what should happen on a timeout, the string "int" or anything
+	else that causes a reboot.  [FIXME -- better description]
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT
+
+	GETSUPPORT returns CARDRESET and WDIOF_SETTIMEOUT but
+	GETSTATUS is not supported and GETBOOTSTATUS just returns 0.
+
+i810-tco.c -- Intel 810 chipset
+
+	Also has support for a lot of other i8x0 stuff, but the
+	watchdog is one of the things.
+
+	The timeout is set using the module parameter "i810_margin",
+	which is in steps of 0.6 seconds where 2<i810_margin<64.  The
+	driver supports the SETTIMEOUT ioctl.
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT.
+
+	GETSUPPORT returns WDIOF_SETTIMEOUT.  The GETSTATUS call
+	returns some kind of timer value which ist not compatible with
+	the other drivers.  GETBOOT status returns some kind of
+	hardware specific boot status.  [FIXME -- describe this]
+
+ib700wdt.c -- IB700 Single Board Computer
+
+	Default timeout of 30 seconds and the timeout is settable
+	using the SETTIMEOUT ioctl.  Note that only a few timeout
+	values are supported.
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT
+
+	GETSUPPORT returns WDIOF_KEEPALIVEPING and WDIOF_SETTIMEOUT.
+	The GETSTATUS call returns if the device is open or not.
+	[FIXME -- silliness again?]
+
+machzwd.c -- MachZ ZF-Logic
+
+	Hardcoded timeout of 10 seconds
+
+	Has a module parameter "action" that controls what happens
+	when the timeout runs out which can be 0 = RESET (default), 
+	1 = SMI, 2 = NMI, 3 = SCI.
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT and the magic character
+	'V' close handling.
+
+	GETSUPPORT returns WDIOF_KEEPALIVEPING, and the GETSTATUS call
+	returns if the device is open or not.  [FIXME -- silliness
+	again?]
+
+mixcomwd.c -- MixCom Watchdog
+
+	[FIXME -- I'm unable to tell what the timeout is]
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT
+
+	GETSUPPORT returns WDIOF_KEEPALIVEPING, GETSTATUS returns if
+	the device is opened or not [FIXME -- I'm not really sure how
+	this works, there seems to be some magic connected to
+	CONFIG_WATCHDOG_NOWAYOUT]
+
+pcwd.c -- Berkshire PC Watchdog
+
+	Hardcoded timeout of 1.5 seconds
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT
+
+	GETSUPPORT returns WDIOF_OVERHEAT|WDIOF_CARDRESET and both
+	GETSTATUS and GETBOOTSTATUS return something useful.
+
+	The SETOPTIONS call can be used to enable and disable the card
+	and to ask the driver to call panic if the system overheats.
+
+sbc60xxwdt.c -- 60xx Single Board Computer
+
+	Hardcoded timeout of 10 seconds
+
+	Does not support CONFIG_WATCHDOG_NOWAYOUT, but has the magic
+	character 'V' close handling.
+
+	No bits set in GETSUPPORT
+
+scx200.c -- National SCx200 CPUs
+
+	Not in the kernel yet.
+
+	The timeout is set using a module parameter "margin" which
+	defaults to 60 seconds.  The timeout can also be set using
+	SETTIMEOUT and read using GETTIMEOUT.
+
+	Supports a module parameter "nowayout" that is initialized
+	with the value of CONFIG_WATCHDOG_NOWAYOUT.  Also supports the
+	magic character 'V' handling.
+
+shwdt.c -- SuperH 3/4 processors
+
+	[FIXME -- I'm unable to tell what the timeout is]
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT
+
+	GETSUPPORT returns WDIOF_KEEPALIVEPING, and the GETSTATUS call
+	returns if the device is open or not.  [FIXME -- silliness
+	again?]
+
+softdog.c -- Software watchdog
+
+	The timeout is set with the module parameter "soft_margin"
+	which defaults to 60 seconds, the timeout is also settable
+	using the SETTIMEOUT ioctl.
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT
+
+	WDIOF_SETTIMEOUT bit set in GETSUPPORT
+
+w83877f_wdt.c -- W83877F Computer
+
+	Hardcoded timeout of 30 seconds
+
+	Does not support CONFIG_WATCHDOG_NOWAYOUT, but has the magic
+	character 'V' close handling.
+
+	No bits set in GETSUPPORT
+
+wdt.c -- ICS WDT500/501 ISA and
+wdt_pci.c -- ICS WDT500/501 PCI
+
+	Default timeout of 60 seconds.  The timeout is also settable
+        using the SETTIMEOUT ioctl.
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT
+
+	GETSUPPORT returns with bits set depending on the actual
+	card. The WDT501 supports a lot of external monitoring, the
+	WDT500 much less.
+
+wdt285.c -- Footbridge watchdog
+
+	The timeout is set with the module parameter "soft_margin"
+	which defaults to 60 seconds.  The timeout is also settable
+	using the SETTIMEOUT ioctl.
+
+	Does not support CONFIG_WATCHDOG_NOWAYOUT
+
+	WDIOF_SETTIMEOUT bit set in GETSUPPORT
+
+wdt977.c -- Netwinder W83977AF chip
+
+	Hardcoded timeout of 3 minutes
+
+	Supports CONFIG_WATCHDOG_NOWAYOUT
+
+	Does not support any ioctls at all.
+
diff -Nru a/Documentation/watchdog/watchdog.txt b/Documentation/watchdog/watchdog.txt
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/Documentation/watchdog/watchdog.txt	Sat Sep  6 12:47:30 2003
@@ -0,0 +1,115 @@
+	Watchdog Timer Interfaces For The Linux Operating System
+
+		Alan Cox <alan@lxorguk.ukuu.org.uk>
+
+	     Custom Linux Driver And Program Development
+
+
+The following watchdog drivers are currently implemented:
+
+	ICS	WDT501-P
+	ICS	WDT501-P (no fan tachometer)
+	ICS	WDT500-P
+	Software Only
+	SA1100 Internal Watchdog
+	Berkshire Products PC Watchdog Revision A & C (by Ken Hollis)
+
+
+All six interfaces provide /dev/watchdog, which when open must be written
+to within a timeout or the machine will reboot. Each write delays the reboot
+time another timeout. In the case of the software watchdog the ability to 
+reboot will depend on the state of the machines and interrupts. The hardware
+boards physically pull the machine down off their own onboard timers and
+will reboot from almost anything.
+
+A second temperature monitoring interface is available on the WDT501P cards
+and some Berkshire cards. This provides /dev/temperature. This is the machine 
+internal temperature in degrees Fahrenheit. Each read returns a single byte 
+giving the temperature.
+
+The third interface logs kernel messages on additional alert events.
+
+Both software and hardware watchdog drivers are available in the standard
+kernel. If you are using the software watchdog, you probably also want
+to use "panic=60" as a boot argument as well.
+
+The wdt card cannot be safely probed for. Instead you need to pass
+wdt=ioaddr,irq as a boot parameter - eg "wdt=0x240,11".
+
+The SA1100 watchdog module can be configured with the "sa1100_margin"
+commandline argument which specifies timeout value in seconds.
+
+The i810 TCO watchdog modules can be configured with the "i810_margin"
+commandline argument which specifies the counter initial value. The counter
+is decremented every 0.6 seconds and default to 50 (30 seconds). Values can
+range between 3 and 63.
+
+The i810 TCO watchdog driver also implements the WDIOC_GETSTATUS and
+WDIOC_GETBOOTSTATUS ioctl()s. WDIOC_GETSTATUS returns the actual counter value
+and WDIOC_GETBOOTSTATUS returns the value of TCO2 Status Register (see Intel's
+documentation for the 82801AA and 82801AB datasheet). 
+
+Features
+--------
+		WDT501P		WDT500P		Software	Berkshire	i810 TCO	SA1100WD
+Reboot Timer	   X               X                X		    X               X               X
+External Reboot	   X	           X                o		    o               o               X
+I/O Port Monitor   o		   o		    o		    X               o               o
+Temperature	   X		   o		    o               X               o               o
+Fan Speed          X		   o		    o               o               o               o
+Power Under	   X               o                o               o               o               o
+Power Over         X               o                o               o               o               o
+Overheat           X               o                o               o               o               o
+
+The external event interfaces on the WDT boards are not currently supported.
+Minor numbers are however allocated for it.
+
+
+Example Watchdog Driver
+-----------------------
+
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+int main(int argc, const char *argv[])
+{
+	int fd=open("/dev/watchdog",O_WRONLY);
+	if(fd==-1)
+	{
+		perror("watchdog");
+		exit(1);
+	}
+	while(1)
+	{
+		write(fd,"\0",1);
+		fsync(fd);
+		sleep(10);
+	}
+}
+
+
+Contact Information
+
+People keep asking about the WDT watchdog timer hardware: The phone contacts
+for Industrial Computer Source are:
+ 
+Industrial Computer Source
+http://www.indcompsrc.com
+ICS Advent, San Diego
+6260 Sequence Dr.
+San Diego, CA 92121-4371
+Phone (858) 677-0877
+FAX: (858) 677-0895
+>
+ICS Advent Europe, UK
+Oving Road
+Chichester,
+West Sussex,
+PO19 4ET, UK
+Phone: 00.44.1243.533900
+
+
+and please mention Linux when enquiring.
+
+For full information about the PCWD cards see the pcwd-watchdog.txt document.
diff -Nru a/Documentation/watchdog-api.txt b/Documentation/watchdog-api.txt
--- a/Documentation/watchdog-api.txt	Sat Sep  6 12:47:30 2003
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,390 +0,0 @@
-The Linux Watchdog driver API.
-
-Copyright 2002 Christer Weingel <wingel@nano-system.com>
-
-Some parts of this document are copied verbatim from the sbc60xxwdt
-driver which is (c) Copyright 2000 Jakob Oestergaard <jakob@ostenfeld.dk>
-
-This document describes the state of the Linux 2.4.18 kernel.
-
-Introduction:
-
-A Watchdog Timer (WDT) is a hardware circuit that can reset the
-computer system in case of a software fault.  You probably knew that
-already.
-
-Usually a userspace daemon will notify the kernel watchdog driver via the
-/dev/watchdog special device file that userspace is still alive, at
-regular intervals.  When such a notification occurs, the driver will
-usually tell the hardware watchdog that everything is in order, and
-that the watchdog should wait for yet another little while to reset
-the system.  If userspace fails (RAM error, kernel bug, whatever), the
-notifications cease to occur, and the hardware watchdog will reset the
-system (causing a reboot) after the timeout occurs.
-
-The Linux watchdog API is a rather AD hoc construction and different
-drivers implement different, and sometimes incompatible, parts of it.
-This file is an attempt to document the existing usage and allow
-future driver writers to use it as a reference.
-
-The simplest API:
-
-All drivers support the basic mode of operation, where the watchdog
-activates as soon as /dev/watchdog is opened and will reboot unless
-the watchdog is pinged within a certain time, this time is called the
-timeout or margin.  The simplest way to ping the watchdog is to write
-some data to the device.  So a very simple watchdog daemon would look
-like this:
-
-int main(int argc, const char *argv[]) {
-	int fd=open("/dev/watchdog",O_WRONLY);
-	if (fd==-1) {
-		perror("watchdog");
-		exit(1);
-	}
-	while(1) {
-		write(fd, "\0", 1);
-		sleep(10);
-	}
-}
-
-A more advanced driver could for example check that a HTTP server is
-still responding before doing the write call to ping the watchdog.
-
-When the device is closed, the watchdog is disabled.  This is not
-always such a good idea, since if there is a bug in the watchdog
-daemon and it crashes the system will not reboot.  Because of this,
-some of the drivers support the configuration option "Disable watchdog
-shutdown on close", CONFIG_WATCHDOG_NOWAYOUT.  If it is set to Y when
-compiling the kernel, there is no way of disabling the watchdog once
-it has been started.  So, if the watchdog dameon crashes, the system
-will reboot after the timeout has passed.
-
-Some other drivers will not disable the watchdog, unless a specific
-magic character 'V' has been sent /dev/watchdog just before closing
-the file.  If the userspace daemon closes the file without sending
-this special character, the driver will assume that the daemon (and
-userspace in general) died, and will stop pinging the watchdog without
-disabling it first.  This will then cause a reboot.
-
-The ioctl API:
-
-All conforming drivers also support an ioctl API.
-
-Pinging the watchdog using an ioctl:
-
-All drivers that have an ioctl interface support at least one ioctl,
-KEEPALIVE.  This ioctl does exactly the same thing as a write to the
-watchdog device, so the main loop in the above program could be
-replaced with:
-
-	while (1) {
-		ioctl(fd, WDIOC_KEEPALIVE, 0);
-		sleep(10);
-	}
-
-the argument to the ioctl is ignored.
-
-Setting and getting the timeout:
-
-For some drivers it is possible to modify the watchdog timeout on the
-fly with the SETTIMEOUT ioctl, those drivers have the WDIOF_SETTIMEOUT
-flag set in their option field.  The argument is an integer
-representing the timeout in seconds.  The driver returns the real
-timeout used in the same variable, and this timeout might differ from
-the requested one due to limitation of the hardware.
-
-    int timeout = 45;
-    ioctl(fd, WDIOC_SETTIMEOUT, &timeout);
-    printf("The timeout was set to %d seconds\n", timeout);
-
-This example might actually print "The timeout was set to 60 seconds"
-if the device has a granularity of minutes for its timeout.
-
-Starting with the Linux 2.4.18 kernel, it is possible to query the
-current timeout using the GETTIMEOUT ioctl.
-
-    ioctl(fd, WDIOC_GETTIMEOUT, &timeout);
-    printf("The timeout was is %d seconds\n", timeout);
-
-Envinronmental monitoring:
-
-All watchdog drivers are required return more information about the system,
-some do temperature, fan and power level monitoring, some can tell you
-the reason for the last reboot of the system.  The GETSUPPORT ioctl is
-available to ask what the device can do:
-
-	struct watchdog_info ident;
-	ioctl(fd, WDIOC_GETSUPPORT, &ident);
-
-the fields returned in the ident struct are:
-
-        identity		a string identifying the watchdog driver
-	firmware_version	the firmware version of the card if available
-	options			a flags describing what the device supports
-
-the options field can have the following bits set, and describes what
-kind of information that the GET_STATUS and GET_BOOT_STATUS ioctls can
-return.   [FIXME -- Is this correct?]
-
-	WDIOF_OVERHEAT		Reset due to CPU overheat
-
-The machine was last rebooted by the watchdog because the thermal limit was
-exceeded
-
-	WDIOF_FANFAULT		Fan failed
-
-A system fan monitored by the watchdog card has failed
-
-	WDIOF_EXTERN1		External relay 1
-
-External monitoring relay/source 1 was triggered. Controllers intended for
-real world applications include external monitoring pins that will trigger
-a reset.
-
-	WDIOF_EXTERN2		External relay 2
-
-External monitoring relay/source 2 was triggered
-
-	WDIOF_POWERUNDER	Power bad/power fault
-
-The machine is showing an undervoltage status
-
-	WDIOF_CARDRESET		Card previously reset the CPU
-
-The last reboot was caused by the watchdog card
-
-	WDIOF_POWEROVER		Power over voltage
-
-The machine is showing an overvoltage status. Note that if one level is
-under and one over both bits will be set - this may seem odd but makes
-sense.
-
-	WDIOF_KEEPALIVEPING	Keep alive ping reply
-
-The watchdog saw a keepalive ping since it was last queried.
-
-	WDIOF_SETTIMEOUT	Can set/get the timeout
-
-
-For those drivers that return any bits set in the option field, the
-GETSTATUS and GETBOOTSTATUS ioctls can be used to ask for the current
-status, and the status at the last reboot, respectively.  
-
-    int flags;
-    ioctl(fd, WDIOC_GETSTATUS, &flags);
-
-    or
-
-    ioctl(fd, WDIOC_GETBOOTSTATUS, &flags);
-
-Note that not all devices support these two calls, and some only
-support the GETBOOTSTATUS call.
-
-Some drivers can measure the temperature using the GETTEMP ioctl.  The
-returned value is the temperature in degrees farenheit.
-
-    int temperature;
-    ioctl(fd, WDIOC_GETTEMP, &temperature);
-
-Finally the SETOPTIONS ioctl can be used to control some aspects of
-the cards operation; right now the pcwd driver is the only one
-supporting thiss ioctl.
-
-    int options = 0;
-    ioctl(fd, WDIOC_SETOPTIONS, options);
-
-The following options are available:
-
-	WDIOS_DISABLECARD	Turn off the watchdog timer
-	WDIOS_ENABLECARD	Turn on the watchdog timer
-	WDIOS_TEMPPANIC		Kernel panic on temperature trip
-
-[FIXME -- better explanations]
-
-Implementations in the current drivers in the kernel tree:
-
-Here I have tried to summarize what the different drivers support and
-where they do strange things compared to the other drivers.
-
-acquirewdt.c -- Acquire Single Board Computer
-
-	This driver has a hardcoded timeout of 1 minute
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT
-
-	GETSUPPORT returns KEEPALIVEPING.  GETSTATUS will return 1 if
-	the device is open, 0 if not.  [FIXME -- isn't this rather
-	silly?  To be able to use the ioctl, the device must be open
-	and so GETSTATUS will always return 1].
-
-advantechwdt.c -- Advantech Single Board Computer
-
-	Timeout that defaults to 60 seconds, supports SETTIMEOUT.
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT
-
-	GETSUPPORT returns WDIOF_KEEPALIVEPING and WDIOF_SETTIMEOUT.
-	The GETSTATUS call returns if the device is open or not.
-	[FIXME -- silliness again?]
-	
-eurotechwdt.c -- Eurotech CPU-1220/1410
-
-	The timeout can be set using the SETTIMEOUT ioctl and defaults
-	to 60 seconds.
-
-	Also has a module parameter "ev", event type which controls
-	what should happen on a timeout, the string "int" or anything
-	else that causes a reboot.  [FIXME -- better description]
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT
-
-	GETSUPPORT returns CARDRESET and WDIOF_SETTIMEOUT but
-	GETSTATUS is not supported and GETBOOTSTATUS just returns 0.
-
-i810-tco.c -- Intel 810 chipset
-
-	Also has support for a lot of other i8x0 stuff, but the
-	watchdog is one of the things.
-
-	The timeout is set using the module parameter "i810_margin",
-	which is in steps of 0.6 seconds where 2<i810_margin<64.  The
-	driver supports the SETTIMEOUT ioctl.
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT.
-
-	GETSUPPORT returns WDIOF_SETTIMEOUT.  The GETSTATUS call
-	returns some kind of timer value which ist not compatible with
-	the other drivers.  GETBOOT status returns some kind of
-	hardware specific boot status.  [FIXME -- describe this]
-
-ib700wdt.c -- IB700 Single Board Computer
-
-	Default timeout of 30 seconds and the timeout is settable
-	using the SETTIMEOUT ioctl.  Note that only a few timeout
-	values are supported.
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT
-
-	GETSUPPORT returns WDIOF_KEEPALIVEPING and WDIOF_SETTIMEOUT.
-	The GETSTATUS call returns if the device is open or not.
-	[FIXME -- silliness again?]
-
-machzwd.c -- MachZ ZF-Logic
-
-	Hardcoded timeout of 10 seconds
-
-	Has a module parameter "action" that controls what happens
-	when the timeout runs out which can be 0 = RESET (default), 
-	1 = SMI, 2 = NMI, 3 = SCI.
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT and the magic character
-	'V' close handling.
-
-	GETSUPPORT returns WDIOF_KEEPALIVEPING, and the GETSTATUS call
-	returns if the device is open or not.  [FIXME -- silliness
-	again?]
-
-mixcomwd.c -- MixCom Watchdog
-
-	[FIXME -- I'm unable to tell what the timeout is]
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT
-
-	GETSUPPORT returns WDIOF_KEEPALIVEPING, GETSTATUS returns if
-	the device is opened or not [FIXME -- I'm not really sure how
-	this works, there seems to be some magic connected to
-	CONFIG_WATCHDOG_NOWAYOUT]
-
-pcwd.c -- Berkshire PC Watchdog
-
-	Hardcoded timeout of 1.5 seconds
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT
-
-	GETSUPPORT returns WDIOF_OVERHEAT|WDIOF_CARDRESET and both
-	GETSTATUS and GETBOOTSTATUS return something useful.
-
-	The SETOPTIONS call can be used to enable and disable the card
-	and to ask the driver to call panic if the system overheats.
-
-sbc60xxwdt.c -- 60xx Single Board Computer
-
-	Hardcoded timeout of 10 seconds
-
-	Does not support CONFIG_WATCHDOG_NOWAYOUT, but has the magic
-	character 'V' close handling.
-
-	No bits set in GETSUPPORT
-
-scx200.c -- National SCx200 CPUs
-
-	Not in the kernel yet.
-
-	The timeout is set using a module parameter "margin" which
-	defaults to 60 seconds.  The timeout can also be set using
-	SETTIMEOUT and read using GETTIMEOUT.
-
-	Supports a module parameter "nowayout" that is initialized
-	with the value of CONFIG_WATCHDOG_NOWAYOUT.  Also supports the
-	magic character 'V' handling.
-
-shwdt.c -- SuperH 3/4 processors
-
-	[FIXME -- I'm unable to tell what the timeout is]
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT
-
-	GETSUPPORT returns WDIOF_KEEPALIVEPING, and the GETSTATUS call
-	returns if the device is open or not.  [FIXME -- silliness
-	again?]
-
-softdog.c -- Software watchdog
-
-	The timeout is set with the module parameter "soft_margin"
-	which defaults to 60 seconds, the timeout is also settable
-	using the SETTIMEOUT ioctl.
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT
-
-	WDIOF_SETTIMEOUT bit set in GETSUPPORT
-
-w83877f_wdt.c -- W83877F Computer
-
-	Hardcoded timeout of 30 seconds
-
-	Does not support CONFIG_WATCHDOG_NOWAYOUT, but has the magic
-	character 'V' close handling.
-
-	No bits set in GETSUPPORT
-
-wdt.c -- ICS WDT500/501 ISA and
-wdt_pci.c -- ICS WDT500/501 PCI
-
-	Default timeout of 60 seconds.  The timeout is also settable
-        using the SETTIMEOUT ioctl.
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT
-
-	GETSUPPORT returns with bits set depending on the actual
-	card. The WDT501 supports a lot of external monitoring, the
-	WDT500 much less.
-
-wdt285.c -- Footbridge watchdog
-
-	The timeout is set with the module parameter "soft_margin"
-	which defaults to 60 seconds.  The timeout is also settable
-	using the SETTIMEOUT ioctl.
-
-	Does not support CONFIG_WATCHDOG_NOWAYOUT
-
-	WDIOF_SETTIMEOUT bit set in GETSUPPORT
-
-wdt977.c -- Netwinder W83977AF chip
-
-	Hardcoded timeout of 3 minutes
-
-	Supports CONFIG_WATCHDOG_NOWAYOUT
-
-	Does not support any ioctls at all.
-
diff -Nru a/Documentation/watchdog.txt b/Documentation/watchdog.txt
--- a/Documentation/watchdog.txt	Sat Sep  6 12:47:30 2003
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,115 +0,0 @@
-	Watchdog Timer Interfaces For The Linux Operating System
-
-		Alan Cox <alan@lxorguk.ukuu.org.uk>
-
-	     Custom Linux Driver And Program Development
-
-
-The following watchdog drivers are currently implemented:
-
-	ICS	WDT501-P
-	ICS	WDT501-P (no fan tachometer)
-	ICS	WDT500-P
-	Software Only
-	SA1100 Internal Watchdog
-	Berkshire Products PC Watchdog Revision A & C (by Ken Hollis)
-
-
-All six interfaces provide /dev/watchdog, which when open must be written
-to within a timeout or the machine will reboot. Each write delays the reboot
-time another timeout. In the case of the software watchdog the ability to 
-reboot will depend on the state of the machines and interrupts. The hardware
-boards physically pull the machine down off their own onboard timers and
-will reboot from almost anything.
-
-A second temperature monitoring interface is available on the WDT501P cards
-and some Berkshire cards. This provides /dev/temperature. This is the machine 
-internal temperature in degrees Fahrenheit. Each read returns a single byte 
-giving the temperature.
-
-The third interface logs kernel messages on additional alert events.
-
-Both software and hardware watchdog drivers are available in the standard
-kernel. If you are using the software watchdog, you probably also want
-to use "panic=60" as a boot argument as well.
-
-The wdt card cannot be safely probed for. Instead you need to pass
-wdt=ioaddr,irq as a boot parameter - eg "wdt=0x240,11".
-
-The SA1100 watchdog module can be configured with the "sa1100_margin"
-commandline argument which specifies timeout value in seconds.
-
-The i810 TCO watchdog modules can be configured with the "i810_margin"
-commandline argument which specifies the counter initial value. The counter
-is decremented every 0.6 seconds and default to 50 (30 seconds). Values can
-range between 3 and 63.
-
-The i810 TCO watchdog driver also implements the WDIOC_GETSTATUS and
-WDIOC_GETBOOTSTATUS ioctl()s. WDIOC_GETSTATUS returns the actual counter value
-and WDIOC_GETBOOTSTATUS returns the value of TCO2 Status Register (see Intel's
-documentation for the 82801AA and 82801AB datasheet). 
-
-Features
---------
-		WDT501P		WDT500P		Software	Berkshire	i810 TCO	SA1100WD
-Reboot Timer	   X               X                X		    X               X               X
-External Reboot	   X	           X                o		    o               o               X
-I/O Port Monitor   o		   o		    o		    X               o               o
-Temperature	   X		   o		    o               X               o               o
-Fan Speed          X		   o		    o               o               o               o
-Power Under	   X               o                o               o               o               o
-Power Over         X               o                o               o               o               o
-Overheat           X               o                o               o               o               o
-
-The external event interfaces on the WDT boards are not currently supported.
-Minor numbers are however allocated for it.
-
-
-Example Watchdog Driver
------------------------
-
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-int main(int argc, const char *argv[])
-{
-	int fd=open("/dev/watchdog",O_WRONLY);
-	if(fd==-1)
-	{
-		perror("watchdog");
-		exit(1);
-	}
-	while(1)
-	{
-		write(fd,"\0",1);
-		fsync(fd);
-		sleep(10);
-	}
-}
-
-
-Contact Information
-
-People keep asking about the WDT watchdog timer hardware: The phone contacts
-for Industrial Computer Source are:
- 
-Industrial Computer Source
-http://www.indcompsrc.com
-ICS Advent, San Diego
-6260 Sequence Dr.
-San Diego, CA 92121-4371
-Phone (858) 677-0877
-FAX: (858) 677-0895
->
-ICS Advent Europe, UK
-Oving Road
-Chichester,
-West Sussex,
-PO19 4ET, UK
-Phone: 00.44.1243.533900
-
-
-and please mention Linux when enquiring.
-
-For full information about the PCWD cards see the pcwd-watchdog.txt document.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH] 2.6.0 - Watchdog patches
  2003-09-06 10:51 [PATCH] 2.6.0-test4 - Watchdog patches - Documentation Wim Van Sebroeck
@ 2003-12-29 19:52 ` Wim Van Sebroeck
  2003-12-29 20:11   ` Linus Torvalds
  0 siblings, 1 reply; 17+ messages in thread
From: Wim Van Sebroeck @ 2003-12-29 19:52 UTC (permalink / raw)
  To: torvalds, Andrew Morton; +Cc: linux-kernel

Hi Linus, Andrew,

please do a

	bk pull http://linux-watchdog.bkbits.net/linux-2.5-watchdog

This will update the following files:

 drivers/char/watchdog/Kconfig |    4 ++--
 drivers/usb/input/hid-core.c  |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

through these ChangeSets:

<wim@iguana.be> (03/10/26 1.1350.2.1)
   [WATCHDOG] Kconfig
   
   Reflect new watchdog Documentation directory.

<wim@iguana.be> (03/12/11 1.1436)
   [USB] hid blacklist addition
   
   Added the Berkshire Products USB PC Watchdog to the hid blacklist.
   This to avoid problems with USB-Disconnects when the card feels it should reboot...


The ChangeSets can also be looked at on:
	http://linux-watchdog.bkbits.net:8080/linux-2.5-watchdog

For completeness, I added the patches below.

Greetings,
Wim.

================================================================================
diff -Nru a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
--- a/drivers/char/watchdog/Kconfig	Mon Dec 29 20:39:18 2003
+++ b/drivers/char/watchdog/Kconfig	Mon Dec 29 20:39:18 2003
@@ -17,7 +17,7 @@
 	  implementation entirely in software (which can sometimes fail to
 	  reboot the machine) and a driver for hardware watchdog boards, which
 	  are more robust and can also keep track of the temperature inside
-	  your computer. For details, read <file:Documentation/watchdog.txt>
+	  your computer. For details, read <file:Documentation/watchdog/watchdog.txt>
 	  in the kernel source.
 
 	  The watchdog is usually used together with the watchdog daemon
@@ -114,7 +114,7 @@
 	  This card simply watches your kernel to make sure it doesn't freeze,
 	  and if it does, it reboots your computer after a certain amount of
 	  time. This driver is like the WDT501 driver but for different
-	  hardware. Please read <file:Documentation/pcwd-watchdog.txt>. The PC
+	  hardware. Please read <file:Documentation/watchdog/pcwd-watchdog.txt>. The PC
 	  watchdog cards can be ordered from <http://www.berkprod.com/>.
 
 	  To compile this driver as a module, choose M here: the
diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c	Mon Dec 29 20:39:39 2003
+++ b/drivers/usb/input/hid-core.c	Mon Dec 29 20:39:39 2003
@@ -1354,6 +1354,9 @@
 #define USB_VENDOR_ID_A4TECH		0x09DA
 #define USB_DEVICE_ID_A4TECH_WCP32PU	0x0006
 
+#define USB_VENDOR_ID_BERKSHIRE		0x0c98
+#define USB_DEVICE_ID_BERKSHIRE_PCWD	0x1140
+
 struct hid_blacklist {
 	__u16 idVendor;
 	__u16 idProduct;
@@ -1403,6 +1406,7 @@
 	{ USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK },
+	{ USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE },
 	{ 0, 0 }
 };
 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches
  2003-12-29 19:52 ` [PATCH] 2.6.0 - Watchdog patches Wim Van Sebroeck
@ 2003-12-29 20:11   ` Linus Torvalds
  2003-12-29 20:22     ` Wim Van Sebroeck
  2003-12-29 20:36     ` [PATCH] 2.6.0 - Watchdog patches Jeff Garzik
  0 siblings, 2 replies; 17+ messages in thread
From: Linus Torvalds @ 2003-12-29 20:11 UTC (permalink / raw)
  To: Wim Van Sebroeck; +Cc: Andrew Morton, linux-kernel



On Mon, 29 Dec 2003, Wim Van Sebroeck wrote:
>
> Hi Linus, Andrew,
> 
> please do a
> 
> 	bk pull http://linux-watchdog.bkbits.net/linux-2.5-watchdog

This tree has 38 deltas, all just merges.

The end result is a horribly messy revision tree, for a few one-liners.

I'm going to take the patch as a patch instead, and hope that you'll throw 
your BK tree away.

Please don't follow the release tree in your development trees, it makes 
it impossible to see how the revision history happened.

		Linus

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches
  2003-12-29 20:11   ` Linus Torvalds
@ 2003-12-29 20:22     ` Wim Van Sebroeck
  2003-12-29 20:30       ` Linus Torvalds
  2003-12-29 20:36     ` [PATCH] 2.6.0 - Watchdog patches Jeff Garzik
  1 sibling, 1 reply; 17+ messages in thread
From: Wim Van Sebroeck @ 2003-12-29 20:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, linux-kernel

Hi Linus,

> This tree has 38 deltas, all just merges.
> 
> The end result is a horribly messy revision tree, for a few one-liners.
> 
> I'm going to take the patch as a patch instead, and hope that you'll throw 
> your BK tree away.

Hmmm, the result of postponing these one-liners until 2.6.0 was out... I'll throw
it away in a couple of minutes. Thanks for the feedback though!

Greetings and a happy new-year,
Wim.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches
  2003-12-29 20:22     ` Wim Van Sebroeck
@ 2003-12-29 20:30       ` Linus Torvalds
  2003-12-30  0:49         ` Matthias Andree
  0 siblings, 1 reply; 17+ messages in thread
From: Linus Torvalds @ 2003-12-29 20:30 UTC (permalink / raw)
  To: Wim Van Sebroeck; +Cc: Andrew Morton, linux-kernel



On Mon, 29 Dec 2003, Wim Van Sebroeck wrote:
> 
> Hmmm, the result of postponing these one-liners until 2.6.0 was out...

Yeah, I know. It's one of the downsides of having anal revision control, 
and BK is more anal than most.

I do end up taking patches that have this syndrome if it looks like the 
pain of not taking the messy revision history is larger than the pain of 
just fixing it. Sometimes it's hard to avoid.

But most of the time the proper thing to do is to just not merge
unnecessarily - if something is pending for a while, Bk does the merge
correctly anyway, so you can just leave it pending and have me pull from
an old tree (after you have verified in your own tree that the pull will 
succeed and do the right thing).

That way it ends up being trivial to see where/when the changes happened.

		Linus

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches
  2003-12-29 20:11   ` Linus Torvalds
  2003-12-29 20:22     ` Wim Van Sebroeck
@ 2003-12-29 20:36     ` Jeff Garzik
  2003-12-30 12:14       ` Paul Jackson
  1 sibling, 1 reply; 17+ messages in thread
From: Jeff Garzik @ 2003-12-29 20:36 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Wim Van Sebroeck, Andrew Morton, linux-kernel, Patrick Mochel

Linus Torvalds wrote:
> 
> On Mon, 29 Dec 2003, Wim Van Sebroeck wrote:
> 
>>Hi Linus, Andrew,
>>
>>please do a
>>
>>	bk pull http://linux-watchdog.bkbits.net/linux-2.5-watchdog
> 
> 
> This tree has 38 deltas, all just merges.
> 
> The end result is a horribly messy revision tree, for a few one-liners.
> 
> I'm going to take the patch as a patch instead, and hope that you'll throw 
> your BK tree away.
> 
> Please don't follow the release tree in your development trees, it makes 
> it impossible to see how the revision history happened.


Agreed.  Several BK developers do this, forgetting that one of things 
that makes BK so useful is its merge technology.

I recommend (assuming no patches outstanding),

* clone latest tree
* do development
* only 'bk pull' from latest tree iff (a) you are about to submit to 
Linus/Andrew or (b) you know there is a conflicting change in upstream

Pulling the latest, just to be up-to-date, just obfuscates things and 
needlessly increases the size of the master ChangeSet file.

	Jeff




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches
  2003-12-29 20:30       ` Linus Torvalds
@ 2003-12-30  0:49         ` Matthias Andree
  2003-12-30  6:36           ` Linus Torvalds
  2003-12-30 13:36           ` [PATCH] 2.6.0 - Watchdog patches (BK consistency checks) Ed Tomlinson
  0 siblings, 2 replies; 17+ messages in thread
From: Matthias Andree @ 2003-12-30  0:49 UTC (permalink / raw)
  To: linux-kernel

On Mon, 29 Dec 2003, Linus Torvalds wrote:

> I do end up taking patches that have this syndrome if it looks like the 
> pain of not taking the messy revision history is larger than the pain of 
> just fixing it. Sometimes it's hard to avoid.
> 
> But most of the time the proper thing to do is to just not merge
> unnecessarily - if something is pending for a while, Bk does the merge
> correctly anyway, so you can just leave it pending and have me pull from
> an old tree (after you have verified in your own tree that the pull will 
> succeed and do the right thing).
> 
> That way it ends up being trivial to see where/when the changes happened.

Not being very used to BK, does that mean I have several trees around:

1. the official release tree
2. an "old tree" with my local change that I'm forwarding
3. a temporary test tree to see if the merge would succeed, which
   I'll get by cloning (1) and then pulling from (2)?

Well, talk about FAAAAAAST drives (10,025/min SCSI kind) unless you have
time to waste on all those BK consistency checks (which are, of course,
what #3 is all about).

Or am I missing some obvious short cut?

-- 
Matthias Andree

Encrypt your mail: my GnuPG key ID is 0x052E7D95

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches
  2003-12-30  0:49         ` Matthias Andree
@ 2003-12-30  6:36           ` Linus Torvalds
  2003-12-30 13:36           ` [PATCH] 2.6.0 - Watchdog patches (BK consistency checks) Ed Tomlinson
  1 sibling, 0 replies; 17+ messages in thread
From: Linus Torvalds @ 2003-12-30  6:36 UTC (permalink / raw)
  To: Matthias Andree; +Cc: linux-kernel



On Tue, 30 Dec 2003, Matthias Andree wrote:
> 
> Not being very used to BK, does that mean I have several trees around:

The answer to that question is always a resounding "yes".

BK really thrives on having several trees around. You don't _have_ to have 
them, but basically the default rule should be: use separate trees for 
everything you can think of that isn't directly dependent on stuff in 
another tree.

That does _not_ mean that you should necessarily create "temporary trees". 
I actually do that a lot of the time, because I tend to create a totally 
new clone when I start applying long series of patches or do anything even 
half-way strange: it's just a lot easier to throw failures away, than it 
is to try to sort it out later.

But most people probably do _not_ want to have that kind of "temporary
tree" mentality in general. People should realize that it's ok, and in
particular that if you're doing something experimental it's fine to just
create a new tree and later on decide that it was crap and just do a full
"rm -rf" on it, and realize that the only thing you lost was some time.

> 1. the official release tree
> 2. an "old tree" with my local change that I'm forwarding
> 3. a temporary test tree to see if the merge would succeed, which
>    I'll get by cloning (1) and then pulling from (2)?

The tree doesn't really need to be temporary per se. It can be your "work 
tree" - the tree where you merge all the different sources of BK input. I 
realize that a lot of people only really have two sources of input (the 
standard tree and their own development tree), but if you get that concept 
early, you'll find it trivial to merge in other peoples trees into your 
"work tree", and keep track of many different development trees at the 
same time and just let BK do the merging for you.

> Or am I missing some obvious short cut?

Basically, the obvious shortcut is to keep your work-tree around, so you 
don't have to clone and re-pull it all the time.

After a while, your work-tree is really messy (especially if you pull from 
multiple different development trees), but the point should be that no 
actual development gets done there, so you don't care: you can always just 
flush it entirely, and re-create it anew.

But you don't have to flush and re-create it _all_ the time. That would 
just be wasteful. Although if you have the hardware, it isn't that 
painful..

		Linus

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches
  2003-12-29 20:36     ` [PATCH] 2.6.0 - Watchdog patches Jeff Garzik
@ 2003-12-30 12:14       ` Paul Jackson
  0 siblings, 0 replies; 17+ messages in thread
From: Paul Jackson @ 2003-12-30 12:14 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: torvalds, wim, akpm, linux-kernel, mochel

Another possibility I like is to recreate my changes (what few so far
...) against a clean bk tree, before sending.  Hide all my internal
iterations and changes from others.

I will pull frequently and liberally into the bk clones that I use to
track 2.6, 2.6-mm and whatever else I am based on.  These in turn I pull
into my main working bk tree, along with pulling in the various changes
I have in progress, each from their own bk clone.

Then when it comes time to send out a patch, I:

  1) Generate an old fashioned patch (bk export -tpatch),
     containing just the revisions relevant to what I will send.
  2) Clone a fresh bk tree that is closest to whatever
     the recipient of my patch would like to work with
  3) Apply the patch to the fresh clone, generating a
     clean history of one change for just that patch.
  4) Double check that that builds and boots.
  5) Then send that change out, usually by exporting it as a
     -second- old fashioned patch, since for reasons not
     relevant here, I end up sending patches, not bk pulls,
     down stream.

The objective being:

  My final "published work" is that patch - it should be
  as clean as practical.

By going into and back out of old fashioned patches, I isolate
the anal history that bk kept of all my interim changes from
the rest of the world.

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches (BK consistency checks)
  2003-12-30  0:49         ` Matthias Andree
  2003-12-30  6:36           ` Linus Torvalds
@ 2003-12-30 13:36           ` Ed Tomlinson
  2003-12-30 19:13             ` Andy Isaacson
  1 sibling, 1 reply; 17+ messages in thread
From: Ed Tomlinson @ 2003-12-30 13:36 UTC (permalink / raw)
  To: linux-kernel

On December 29, 2003 07:49 pm, Matthias Andree wrote:
> Well, talk about FAAAAAAST drives (10,025/min SCSI kind) unless you have
> time to waste on all those BK consistency checks (which are, of course,
> what #3 is all about).
>
> Or am I missing some obvious short cut?

Is there a way to tell BK when to do consistency checks?  Here they easily take
15-20 min each time.  I would love to be able to tell BK to defer these checks.

Ed Tomlinson

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches (BK consistency checks)
  2003-12-30 13:36           ` [PATCH] 2.6.0 - Watchdog patches (BK consistency checks) Ed Tomlinson
@ 2003-12-30 19:13             ` Andy Isaacson
  2003-12-30 19:56               ` Eric D. Mudama
  2003-12-31 15:01               ` Ed Tomlinson
  0 siblings, 2 replies; 17+ messages in thread
From: Andy Isaacson @ 2003-12-30 19:13 UTC (permalink / raw)
  To: Ed Tomlinson; +Cc: linux-kernel

On Tue, Dec 30, 2003 at 08:36:15AM -0500, Ed Tomlinson wrote:
> On December 29, 2003 07:49 pm, Matthias Andree wrote:
> > Well, talk about FAAAAAAST drives (10,025/min SCSI kind) unless you have
> > time to waste on all those BK consistency checks (which are, of course,
> > what #3 is all about).
> >
> > Or am I missing some obvious short cut?
> 
> Is there a way to tell BK when to do consistency checks?  Here they
> easily take 15-20 min each time.  I would love to be able to tell BK
> to defer these checks.

The consistency check definitely should not take 15 minutes.  It should
be (much) less than 30 seconds.  What is the hardware you're running on?

I'm running on an Athlon 2 GHz (XP 2400+) with 512MB and a 7200RPM IDE
disk, and I can do a complete clone (with full data copy and consistency
check) of the 2.4 tree in 1:40.  That was with cold caches; with the
sfile copies and "checkout:get", a half-gig isn't enough to cache
everything.  The consistency check is about 19 seconds (bk -r check -acv).

If you keep all your trees on one filesystem, you can use "bk clone -l"
to make hard-links for the s. files.  This means you can create a
complete copy of the tree in about 6 MB, in 40 seconds or so.  BK is
very careful to check the links and break them when necessary.  

To save diskspace, you can turn off "checkout:get", like so:

--- 1.4/BitKeeper/etc/config    Tue Dec 30 12:16:44 2003
+++ edited/BitKeeper/etc/config Tue Dec 30 12:13:53 2003
@@ -3,4 +3,3 @@
 logging: logging@openlogging.org
 email: torvalds@transmeta.com
 [davem]checkout:none
-[]checkout:get

(Or, add a [$USER]checkout:none line if that is easier.)

If the consistency check is problematic, let's fix that problem -- don't
turn it off, it's valuable.  It's found IDE corruption, it's found BK
bugs, it's found users who move s. files around behind BK's back.

-andy

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches (BK consistency checks)
  2003-12-30 19:13             ` Andy Isaacson
@ 2003-12-30 19:56               ` Eric D. Mudama
  2003-12-30 20:16                 ` Andy Isaacson
  2003-12-31 15:01               ` Ed Tomlinson
  1 sibling, 1 reply; 17+ messages in thread
From: Eric D. Mudama @ 2003-12-30 19:56 UTC (permalink / raw)
  To: linux-kernel

On Tue, Dec 30 at 13:13, Andy Isaacson wrote:
>On Tue, Dec 30, 2003 at 08:36:15AM -0500, Ed Tomlinson wrote:
>The consistency check definitely should not take 15 minutes.  It should
>be (much) less than 30 seconds.  What is the hardware you're running on?
>
>I'm running on an Athlon 2 GHz (XP 2400+) with 512MB and a 7200RPM IDE
>disk, and I can do a complete clone (with full data copy and consistency
>check) of the 2.4 tree in 1:40.  That was with cold caches; with the
>sfile copies and "checkout:get", a half-gig isn't enough to cache
>everything.  The consistency check is about 19 seconds (bk -r check -acv).

For what it is worth:

AMD Duron 950MHz, 768MB RAM
7200RPM 80GB Quantum Viper IDE drive, 26% full

phat-penguin:~/src/linux-2.5> time bk -r check -acv
100% |=================================================================| OK
42.710u 5.770s 2:04.63 38.8%    0+0k 0+0io 74078pf+0w

over 2 minutes of wall time, 42 seconds of "user" time... (if I'm reading it right), without primed disk caches.

The 2nd run, half a minute later:

phat-penguin:~/src/linux-2.5> time bk -r check -acv
100% |=================================================================| OK
41.900u 3.080s 0:45.53 98.7%    0+0k 0+0io 74078pf+0w


...would appear to show that BK's checksumming, on my system, is
constrained near 41 seconds of calculation time, and the difference
between the user and the wall-clock time is basically time spent
waiting for the disk to do all its reads.


I guess in that case, it'd be interesting to see what the user and
wall times were for the original poster who reported a 15+ minute
integrity check.

--eric



-- 
Eric D. Mudama
edmudama@mail.bounceswoosh.org


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches (BK consistency checks)
  2003-12-30 19:56               ` Eric D. Mudama
@ 2003-12-30 20:16                 ` Andy Isaacson
  2003-12-31 16:33                   ` Ed Tomlinson
  0 siblings, 1 reply; 17+ messages in thread
From: Andy Isaacson @ 2003-12-30 20:16 UTC (permalink / raw)
  To: linux-kernel

On Tue, Dec 30, 2003 at 12:56:32PM -0700, Eric D. Mudama wrote:
> On Tue, Dec 30 at 13:13, Andy Isaacson wrote:
> >On Tue, Dec 30, 2003 at 08:36:15AM -0500, Ed Tomlinson wrote:
> >The consistency check definitely should not take 15 minutes.  It should
> >be (much) less than 30 seconds.  What is the hardware you're running on?
> >
> >I'm running on an Athlon 2 GHz (XP 2400+) with 512MB and a 7200RPM IDE
> >disk, and I can do a complete clone (with full data copy and consistency
> >check) of the 2.4 tree in 1:40.  That was with cold caches; with the
> >sfile copies and "checkout:get", a half-gig isn't enough to cache
> >everything.  The consistency check is about 19 seconds (bk -r check -acv).
> 
> For what it is worth:
> 
> AMD Duron 950MHz, 768MB RAM
> 7200RPM 80GB Quantum Viper IDE drive, 26% full
> 
> phat-penguin:~/src/linux-2.5> time bk -r check -acv
> 100% |=================================================================| OK
> 42.710u 5.770s 2:04.63 38.8%    0+0k 0+0io 74078pf+0w
> 
> over 2 minutes of wall time, 42 seconds of "user" time... (if I'm reading it right), without primed disk caches.
> 
> The 2nd run, half a minute later:
> 
> phat-penguin:~/src/linux-2.5> time bk -r check -acv
> 100% |=================================================================| OK
> 41.900u 3.080s 0:45.53 98.7%    0+0k 0+0io 74078pf+0w
> 
> 
> ...would appear to show that BK's checksumming, on my system, is
> constrained near 41 seconds of calculation time, and the difference
> between the user and the wall-clock time is basically time spent
> waiting for the disk to do all its reads.
> 
> 
> I guess in that case, it'd be interesting to see what the user and
> wall times were for the original poster who reported a 15+ minute
> integrity check.

That's basically right, except that if you don't have enough memory to
keep bk's working set in memory, then you're paging and performance
starts to suck.

I didn't realize that the cpu-bound portion of the check would scale so
closely with CPU speed, but it looks like the scaling is almost dead-on;
18.4/41.9 = .439
950/2000  = .475

So I was wrong to say "less than 30 seconds".  "If you have a fast CPU
and enough memory", I guess.  But the memory matters a lot more than the
CPU.

-andy

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches (BK consistency checks)
  2003-12-30 19:13             ` Andy Isaacson
  2003-12-30 19:56               ` Eric D. Mudama
@ 2003-12-31 15:01               ` Ed Tomlinson
  2003-12-31 17:42                 ` Eric D. Mudama
  2003-12-31 19:13                 ` Andy Isaacson
  1 sibling, 2 replies; 17+ messages in thread
From: Ed Tomlinson @ 2003-12-31 15:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andy Isaacson

On December 30, 2003 02:13 pm, Andy Isaacson wrote:
> On Tue, Dec 30, 2003 at 08:36:15AM -0500, Ed Tomlinson wrote:
> > On December 29, 2003 07:49 pm, Matthias Andree wrote:
> > > Well, talk about FAAAAAAST drives (10,025/min SCSI kind) unless you
> > > have time to waste on all those BK consistency checks (which are, of
> > > course, what #3 is all about).
> > >
> > > Or am I missing some obvious short cut?
> >
> > Is there a way to tell BK when to do consistency checks?  Here they
> > easily take 15-20 min each time.  I would love to be able to tell BK
> > to defer these checks.
>
> The consistency check definitely should not take 15 minutes.  It should
> be (much) less than 30 seconds.  What is the hardware you're running on?
>
> I'm running on an Athlon 2 GHz (XP 2400+) with 512MB and a 7200RPM IDE
> disk, and I can do a complete clone (with full data copy and consistency
> check) of the 2.4 tree in 1:40.  That was with cold caches; with the
> sfile copies and "checkout:get", a half-gig isn't enough to cache
> everything.  The consistency check is about 19 seconds (bk -r check -acv).

Its not a fast box.  Its an old K6-III 400 with 512MB with UDMA2 harddrives.

> If you keep all your trees on one filesystem, you can use "bk clone -l"
> to make hard-links for the s. files.  This means you can create a
> complete copy of the tree in about 6 MB, in 40 seconds or so.  BK is
> very careful to check the links and break them when necessary.

I use -ql for clones

> To save diskspace, you can turn off "checkout:get", like so:
>
> --- 1.4/BitKeeper/etc/config    Tue Dec 30 12:16:44 2003
> +++ edited/BitKeeper/etc/config Tue Dec 30 12:13:53 2003
> @@ -3,4 +3,3 @@
>  logging: logging@openlogging.org
>  email: torvalds@transmeta.com
>  [davem]checkout:none
> -[]checkout:get
>
> (Or, add a [$USER]checkout:none line if that is easier.)
>
> If the consistency check is problematic, let's fix that problem -- don't
> turn it off, it's valuable.  It's found IDE corruption, it's found BK
> bugs, it's found users who move s. files around behind BK's back.

I am not saying I do not want do have consistency checks done.  I do want
to control _when_ and how often they run

Ed

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches (BK consistency checks)
  2003-12-30 20:16                 ` Andy Isaacson
@ 2003-12-31 16:33                   ` Ed Tomlinson
  0 siblings, 0 replies; 17+ messages in thread
From: Ed Tomlinson @ 2003-12-31 16:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andy Isaacson

On December 30, 2003 03:16 pm, Andy Isaacson wrote:
> On Tue, Dec 30, 2003 at 12:56:32PM -0700, Eric D. Mudama wrote:
> > On Tue, Dec 30 at 13:13, Andy Isaacson wrote:
> > >On Tue, Dec 30, 2003 at 08:36:15AM -0500, Ed Tomlinson wrote:
> > >The consistency check definitely should not take 15 minutes.  It should
> > >be (much) less than 30 seconds.  What is the hardware you're running on?
> > >
> > >I'm running on an Athlon 2 GHz (XP 2400+) with 512MB and a 7200RPM IDE
> > >disk, and I can do a complete clone (with full data copy and consistency
> > >check) of the 2.4 tree in 1:40.  That was with cold caches; with the
> > >sfile copies and "checkout:get", a half-gig isn't enough to cache
> > >everything.  The consistency check is about 19 seconds (bk -r check
> > > -acv).
> >
> > For what it is worth:
> >
> > AMD Duron 950MHz, 768MB RAM
> > 7200RPM 80GB Quantum Viper IDE drive, 26% full
> >
> > phat-penguin:~/src/linux-2.5> time bk -r check -acv
> > 100% |=================================================================|
> > OK 42.710u 5.770s 2:04.63 38.8%    0+0k 0+0io 74078pf+0w
> >
> > over 2 minutes of wall time, 42 seconds of "user" time... (if I'm reading
> > it right), without primed disk caches.
> >
> > The 2nd run, half a minute later:
> >
> > phat-penguin:~/src/linux-2.5> time bk -r check -acv
> > 100% |=================================================================|
> > OK 41.900u 3.080s 0:45.53 98.7%    0+0k 0+0io 74078pf+0w
> >
> >
> > ...would appear to show that BK's checksumming, on my system, is
> > constrained near 41 seconds of calculation time, and the difference
> > between the user and the wall-clock time is basically time spent
> > waiting for the disk to do all its reads.
> >
> >
> > I guess in that case, it'd be interesting to see what the user and
> > wall times were for the original poster who reported a 15+ minute
> > integrity check.
>
> That's basically right, except that if you don't have enough memory to
> keep bk's working set in memory, then you're paging and performance
> starts to suck.
>
> I didn't realize that the cpu-bound portion of the check would scale so
> closely with CPU speed, but it looks like the scaling is almost dead-on;
> 18.4/41.9 = .439
> 950/2000  = .475
>
> So I was wrong to say "less than 30 seconds".  "If you have a fast CPU
> and enough memory", I guess.  But the memory matters a lot more than the
> CPU.

Here are the numbers from my box:

oscar% cd /usr/src/linux
oscar% time bk -r check -acv
100% |=================================================================| OK
bk -r check -acv  80.63s user 16.18s system 21% cpu 7:32.06 total

oscar% time bk clone -ql linux yy
bk clone -ql linux yy  77.57s user 23.49s system 17% cpu 9:50.51 total

Ed


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches (BK consistency checks)
  2003-12-31 15:01               ` Ed Tomlinson
@ 2003-12-31 17:42                 ` Eric D. Mudama
  2003-12-31 19:13                 ` Andy Isaacson
  1 sibling, 0 replies; 17+ messages in thread
From: Eric D. Mudama @ 2003-12-31 17:42 UTC (permalink / raw)
  To: linux-kernel

On Wed, Dec 31 at 10:01, Ed Tomlinson wrote:
>I am not saying I do not want do have consistency checks done.  I do want
>to control _when_ and how often they run

I don't see how it would be valid to not do a consistency check after
every network operation, which is what it does now...

Every time you are modifying your archive from a remote source, the
consistency check makes sure you don't have corruption in the transfer
that was previously undetected, or corruption in the underlying
archive which is about to accept the changes.  Since you can only do
network updates at a time when your own archive is in a "checked-in"
state, if the network update fails or detects corruption, you can
clone what you'd already checked in to a new location and recover
trivially.  The most work you can lose is the delta between your last
changeset and the current one, assuming you keep some sort of backups
around.

What exactly would you do if you'd been working "offline" for 3 weeks,
went to sync, and it said that your archive was corrupted?  Or should
it try to merge into a corrupt archive anyway?  Should that archive
that was corrupt, and then had possibly good changes layered on top of
it, be valid for attempting a clone?

I think that limiting the consistency checking could be like opening a
*very big* can of worms.




-- 
Eric D. Mudama
edmudama@mail.bounceswoosh.org


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] 2.6.0 - Watchdog patches (BK consistency checks)
  2003-12-31 15:01               ` Ed Tomlinson
  2003-12-31 17:42                 ` Eric D. Mudama
@ 2003-12-31 19:13                 ` Andy Isaacson
  1 sibling, 0 replies; 17+ messages in thread
From: Andy Isaacson @ 2003-12-31 19:13 UTC (permalink / raw)
  To: Ed Tomlinson; +Cc: linux-kernel

On Wed, Dec 31, 2003 at 10:01:48AM -0500, Ed Tomlinson wrote:
> On December 30, 2003 02:13 pm, Andy Isaacson wrote:
> > On Tue, Dec 30, 2003 at 08:36:15AM -0500, Ed Tomlinson wrote:
> > > Is there a way to tell BK when to do consistency checks?  Here they
> > > easily take 15-20 min each time.  I would love to be able to tell BK
> > > to defer these checks.
> >
> > The consistency check definitely should not take 15 minutes.  It should
> > be (much) less than 30 seconds.  What is the hardware you're running on?
> >
> > I'm running on an Athlon 2 GHz (XP 2400+) with 512MB and a 7200RPM IDE
> > disk, and I can do a complete clone (with full data copy and consistency
> > check) of the 2.4 tree in 1:40.  That was with cold caches; with the
> > sfile copies and "checkout:get", a half-gig isn't enough to cache
> > everything.  The consistency check is about 19 seconds (bk -r check -acv).
> 
> Its not a fast box.  Its an old K6-III 400 with 512MB with UDMA2 harddrives.

I haven't run bk on a K6, but for a WAG I will guess that it's about 75%
of a clock-scaled Duron.  Based on Eric Mudama's numbers, that would put
your CPU load at about 133 seconds.  You've got enough RAM that you
shouldn't be thrashing, and maybe even enough to cache the sfiles.  For
a cold-cache machine, disk seek time is more important than
UDMA33/66/100; are you using a 5400 RPM disk or a 7200 RPM disk?

> > If you keep all your trees on one filesystem, you can use "bk clone -l"
> > to make hard-links for the s. files.  This means you can create a
> > complete copy of the tree in about 6 MB, in 40 seconds or so.  BK is
> > very careful to check the links and break them when necessary.
> 
> I use -ql for clones

Glad to hear it, I wasn't sure if l-k people in general know about that
trick, which is a giant savings.

[snip]

> > If the consistency check is problematic, let's fix that problem -- don't
> > turn it off, it's valuable.  It's found IDE corruption, it's found BK
> > bugs, it's found users who move s. files around behind BK's back.
> 
> I am not saying I do not want do have consistency checks done.  I do want
> to control _when_ and how often they run

Ideally the consistency check is fast enough that you want to run it
after every significant data-modification operation.  Sorta like a
testsuite in XP, it should be run *all the time* so you can say with
confidence "everything was OK until I did X, then it broke" rather than
"oops, at some point in the last week somebody did something that broke
it".

Obviously on an archive as large and complex as the linux kernel, it's
challenging to get a consistency check to go that fast.

On Wed, Dec 31, 2003 at 11:33:58AM -0500, Ed Tomlinson wrote:
> Here are the numbers from my box:
> 
> oscar% cd /usr/src/linux
> oscar% time bk -r check -acv
> 100% |=================================================================| OK
> bk -r check -acv  80.63s user 16.18s system 21% cpu 7:32.06 total
> 
> oscar% time bk clone -ql linux yy
> bk clone -ql linux yy  77.57s user 23.49s system 17% cpu 9:50.51 total

So you're actually going faster than I predicted, CPU-wise.  But that
wallclock time is scary.  On my box the same operation takes less than a
minute:

bk clone -ql linux-2.4 foo  27.73s user 3.12s system 74% cpu 41.200 total

I'm running 2.4.22, Athlon 2 GHz, 512MB.  Why am I getting 74% CPU
utilization when you're getting 17%?  Can you run 'vmstat 10' while the
clone is going?  Here's what I got:

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 0  0 153584  11668  33352 338216    1    1     3     8    3     7  3  0 96  0
 1  0 153584 142132  33536 207536    0    0    31   486  317   389  3  5 92  0
 2  0 153584  88776  33760 217800    0    0    45  2518  362   830 60  9 31  0
 1  0 153584  85776  33808 218084    0    0    26   148  304   466 98  2  0  0
 1  1 153584  32504  33972 298940    0    0    38 10298  506   437 73 11 16  0
 1  0 153584  15284  19864 353544    0  163    27  8026  483   452 58 12 30  0
 0  0 153584  14964  19928 353800    0    0    26  2304  345   344  0  1 99  0
 0  0 153584  14552  19956 354184    0    0    40     2  302   320  2  1 97  0
 1  0 153584  14272  19980 354440    0    0    26    16  316   389  3  1 97  0

bk clone -ql linux-2.4 fooz  28.19s user 2.82s system 85% cpu 36.099 total

(warm caches, that time.)

Is there something else running on the box, perhaps?

-andy

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2003-12-31 19:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-06 10:51 [PATCH] 2.6.0-test4 - Watchdog patches - Documentation Wim Van Sebroeck
2003-12-29 19:52 ` [PATCH] 2.6.0 - Watchdog patches Wim Van Sebroeck
2003-12-29 20:11   ` Linus Torvalds
2003-12-29 20:22     ` Wim Van Sebroeck
2003-12-29 20:30       ` Linus Torvalds
2003-12-30  0:49         ` Matthias Andree
2003-12-30  6:36           ` Linus Torvalds
2003-12-30 13:36           ` [PATCH] 2.6.0 - Watchdog patches (BK consistency checks) Ed Tomlinson
2003-12-30 19:13             ` Andy Isaacson
2003-12-30 19:56               ` Eric D. Mudama
2003-12-30 20:16                 ` Andy Isaacson
2003-12-31 16:33                   ` Ed Tomlinson
2003-12-31 15:01               ` Ed Tomlinson
2003-12-31 17:42                 ` Eric D. Mudama
2003-12-31 19:13                 ` Andy Isaacson
2003-12-29 20:36     ` [PATCH] 2.6.0 - Watchdog patches Jeff Garzik
2003-12-30 12:14       ` Paul Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).