Deadlocking in 2.1.132

Russell King (rmk@arm.linux.org.uk)
Mon, 28 Dec 1998 18:38:14 +0000 (GMT)


Hi,

I am experiencing deadlocking in 2.1.132 on the ARM port, which, according
to Alan Cox, has been present since 2.1.120 on the x86 architecture (unless
I misunderstood him tonight).

I'm seeing shells which wait in __wait_on_page indefinitely and uninterruptibly.
Just before this started happening, the kernel issued a pile of the following
messages:

ll_rw_block: device 03:03: only 1024-char blocks implemented (4096)

/dev/hda3 is my swap partition.

What appears to be happening is as follows:

- swapon /dev/hda3
block size for /dev/hda3 is set to 4096 bytes

- /dev/hda3 is accessed by some other means (eg, dd)
(ok, ok, you're not supposed to do this)
/dev/hda3's blocksize is reset to 1024

- kernel tries to swap some pages (eg, by dd if=/dev/hda of=/dev/null bs=10485760 count=4)
ll_rw_block complains because 4k blocks are passed (since the
swap code /did/ set the blocksize to 4k), but the device is only
accepting 1k now.

- the dropped buffer heads get their BH_Dirty and BH_Uptodate flags cleared,
however bh->b_end_io is never called. This means that the bh is never
unlocked, and processes will wait in __wait_on_page.

A possible fix for this would be (in ll_rw_blk.c, line 653) to add the following
line:

sorry:
for (i = 0; i < nr; i++) {
if (bh[i]) {
clear_bit(BH_Dirty, &bh[i]->b_state);
clear_bit(BH_Uptodate, &bh[i]->b_state);
+ bh[i]->b_end_io(bh[i], 0);
}
}
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King rmk@arm.linux.org.uk --- ---
| | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |

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