public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* plug problem in linux-2.4.0-test11
@ 2000-11-29 11:56 schwidefsky
  2000-11-29 14:23 ` Jens Axboe
  2000-12-27 20:04 ` Andrea Arcangeli
  0 siblings, 2 replies; 6+ messages in thread
From: schwidefsky @ 2000-11-29 11:56 UTC (permalink / raw)
  To: linux-kernel



Hi,
I experienced disk hangs with linux-2.4.0-test11 on S/390 and after
some debugging I found the cause. It the new method of unplugging
block devices that doesn't go along with the S/390 disk driver:

/*
 * remove the plug and let it rip..
 */
static inline void __generic_unplug_device(request_queue_t *q)
{
        if (!list_empty(&q->queue_head)) {
                q->plugged = 0;
                q->request_fn(q);
        }
}

The story goes like this: at start the request queue was empty but
the disk driver was still working on an older, already dequeued
request. Someone plugged the device (q->plugged = 1 && queue on
tq_disk). Then a new request arrived and the unplugging was
started. But before __generic_unplug_device was reached the
outstanding request finished. The bottom half of the S/390 disk
drivers always checks for queued requests after an interrupt,
starts the first and dequeues some of the requests on the
request queue to put them on its internal queue. You could argue
that it shouldn't dequeue request if q->plugged == 1. On the other
hand why not, before the disk has nothing to do. Anyway the result
was that when the unplug routine was finally reached list_empty
was true. In that case q->plugged will not be cleared! The device
stays plugged. Forever.

The following implementation works:

/*
 * remove the plug and let it rip..
 */
static inline void __generic_unplug_device(request_queue_t *q)
{
        q->plugged = 0;
        if (!list_empty(&q->queue_head))
                q->request_fn(q);
}

blue skies,
   Martin

Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH
Schönaicherstr. 220, D-71032 Böblingen, Telefon: 49 - (0)7031 - 16-2247
E-Mail: schwidefsky@de.ibm.com


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

end of thread, other threads:[~2000-12-28 14:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-29 11:56 plug problem in linux-2.4.0-test11 schwidefsky
2000-11-29 14:23 ` Jens Axboe
2000-11-29 17:52   ` Linus Torvalds
2000-11-29 18:11     ` Jens Axboe
2000-12-27 20:04 ` Andrea Arcangeli
2000-12-28 13:47   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox