From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Prarit Bhargava <prarit@redhat.com>,
virtualization@lists.osdl.org,
Andrew Morton <akpm@linux-foundation.org>,
John Hawkes <hawkes@sgi.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Eric Dumazet <dada1@cosmosbay.com>
Subject: [patch 3/4] Locally disable the softlockup watchdog rather than touching it
Date: Tue, 27 Mar 2007 14:49:22 -0700 [thread overview]
Message-ID: <20070327215828.085422178@goop.org> (raw)
In-Reply-To: 20070327214919.800272641@goop.org
[-- Attachment #1: softlockup-disable-rather-than-touch.patch --]
[-- Type: text/plain, Size: 4996 bytes --]
If we're about to enter a prolonged period in which we know we're
going to hold off scheduler ticks, then disable the CPU's softlockup
watchdog for the duration. This avoids having to repeatedly touch the
timestamp, or conversely, risk having the watchdog timeout in the
middle of your long operation.
A question about each of these changes is whether they expect just the
current CPU to be locked up, or the whole machine.
touch_softlockup_watchdog updates the per-cpu timestamp, so I assumed
that its per-cpu for all these cases.
One semantic change this makes is that softlockup_disable/enable does
a preempt_disable/enable. I don't think this is a problem, since if
you're worried about triggering the softlockup watchdog, you're not
scheduling.
I haven't really worked out how this should interact with the nmi
watchdog; touch_nmi_watchdog() still ends up calling
touch_softlockup_watchdog(), so there's still some redundancy here.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Chris Lalancette <clalance@redhat.com>
Cc: Eric Dumazet <dada1@cosmosbay.com>
Cc: John Hawkes <hawkes@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
arch/ia64/kernel/uncached.c | 8 ++++++--
drivers/ide/ide-iops.c | 25 +++++++++++++++++++------
drivers/ide/ide-taskfile.c | 8 +++++++-
drivers/mtd/nand/nand_base.c | 8 +++++++-
4 files changed, 39 insertions(+), 10 deletions(-)
===================================================================
--- a/arch/ia64/kernel/uncached.c
+++ b/arch/ia64/kernel/uncached.c
@@ -253,13 +253,17 @@ static int __init uncached_build_memmap(
int nid = paddr_to_nid(uc_start - __IA64_UNCACHED_OFFSET);
struct gen_pool *pool = uncached_pools[nid].pool;
size_t size = uc_end - uc_start;
-
- touch_softlockup_watchdog();
+ int sl_state;
+
+ sl_state = softlockup_disable();
if (pool != NULL) {
memset((char *)uc_start, 0, size);
(void) gen_pool_add(pool, uc_start, size, nid);
}
+
+ softlockup_enable(sl_state);
+
return 0;
}
===================================================================
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -1215,6 +1215,12 @@ int ide_wait_not_busy(ide_hwif_t *hwif,
int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout)
{
u8 stat = 0;
+ int ret = -EBUSY;
+ int sl_state;
+
+ /* Tell softlockup this might take a while.
+ XXX should this be global or per-cpu? */
+ sl_state = softlockup_disable();
while(timeout--) {
/*
@@ -1223,19 +1229,26 @@ int ide_wait_not_busy(ide_hwif_t *hwif,
*/
mdelay(1);
stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]);
- if ((stat & BUSY_STAT) == 0)
- return 0;
+ if ((stat & BUSY_STAT) == 0) {
+ ret = 0;
+ break;
+ }
+
/*
* Assume a value of 0xff means nothing is connected to
* the interface and it doesn't implement the pull-down
* resistor on D7.
*/
- if (stat == 0xff)
- return -ENODEV;
- touch_softlockup_watchdog();
+ if (stat == 0xff) {
+ ret = -ENODEV;
+ break;
+ }
touch_nmi_watchdog();
}
- return -EBUSY;
+
+ softlockup_enable(sl_state);
+
+ return ret;
}
EXPORT_SYMBOL_GPL(ide_wait_not_busy);
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -310,10 +310,14 @@ static void ide_pio_datablock(ide_drive_
static void ide_pio_datablock(ide_drive_t *drive, struct request *rq,
unsigned int write)
{
+ int sl_state;
+
if (rq->bio) /* fs request */
rq->errors = 0;
- touch_softlockup_watchdog();
+ /* Tell softlockup this might take a while.
+ XXX should this be global or per-cpu? */
+ sl_state = softlockup_disable();
switch (drive->hwif->data_phase) {
case TASKFILE_MULTI_IN:
@@ -324,6 +328,8 @@ static void ide_pio_datablock(ide_drive_
ide_pio_sector(drive, write);
break;
}
+
+ softlockup_enable(sl_state);
}
static ide_startstop_t task_error(ide_drive_t *drive, struct request *rq,
===================================================================
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -419,15 +419,21 @@ void nand_wait_ready(struct mtd_info *mt
{
struct nand_chip *chip = mtd->priv;
unsigned long timeo = jiffies + 2;
+ int sl_state;
+
+ /* Tell softlockup this might take a while.
+ XXX should this be global or per-cpu? */
+ sl_state = softlockup_disable();
led_trigger_event(nand_led_trigger, LED_FULL);
/* wait until command is processed or timeout occures */
do {
if (chip->dev_ready(mtd))
break;
- touch_softlockup_watchdog();
} while (time_before(jiffies, timeo));
led_trigger_event(nand_led_trigger, LED_OFF);
+
+ softlockup_enable(sl_state);
}
EXPORT_SYMBOL_GPL(nand_wait_ready);
--
next prev parent reply other threads:[~2007-03-27 21:49 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-27 21:49 [patch 0/4] Revised softlockup watchdog improvement patches Jeremy Fitzhardinge
2007-03-27 21:49 ` [patch 1/4] Ignore stolen time in the softlockup watchdog Jeremy Fitzhardinge
2007-04-24 6:49 ` Andrew Morton
2007-04-24 6:58 ` Jeremy Fitzhardinge
2007-04-24 7:09 ` Andrew Morton
2007-04-24 17:51 ` Jeremy Fitzhardinge
2007-04-24 17:57 ` Andrew Morton
2007-04-24 18:16 ` Jeremy Fitzhardinge
2007-04-24 18:32 ` Andrew Morton
2007-04-24 20:00 ` Jeremy Fitzhardinge
2007-04-24 20:14 ` Andrew Morton
2007-04-24 20:46 ` Jeremy Fitzhardinge
2007-04-24 20:24 ` Jeremy Fitzhardinge
2007-04-24 20:33 ` Andrew Morton
2007-04-24 20:48 ` Jeremy Fitzhardinge
2007-04-24 20:52 ` Daniel Walker
2007-04-24 20:59 ` Ingo Molnar
2007-04-24 21:01 ` Daniel Walker
2007-04-24 21:14 ` Andrew Morton
2007-04-24 21:20 ` Andi Kleen
2007-04-24 21:33 ` Daniel Walker
2007-03-27 21:49 ` [patch 2/4] percpu enable flag for " Jeremy Fitzhardinge
2007-03-27 21:49 ` Jeremy Fitzhardinge [this message]
2007-03-28 13:33 ` [patch 3/4] Locally disable the softlockup watchdog rather than touching it Prarit Bhargava
2007-03-28 13:50 ` Andi Kleen
2007-03-28 14:00 ` Prarit Bhargava
2007-03-28 14:09 ` Andi Kleen
2007-03-28 14:13 ` Prarit Bhargava
2007-03-28 14:44 ` Jeremy Fitzhardinge
2007-03-28 14:51 ` Prarit Bhargava
2007-03-28 15:22 ` Jeremy Fitzhardinge
2007-03-28 15:27 ` Prarit Bhargava
2007-03-27 21:49 ` [patch 4/4] Add global disable/enable for softlockup watchdog Jeremy Fitzhardinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070327215828.085422178@goop.org \
--to=jeremy@goop.org \
--cc=akpm@linux-foundation.org \
--cc=dada1@cosmosbay.com \
--cc=hawkes@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=prarit@redhat.com \
--cc=virtualization@lists.osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).