sleep in make_request_fn() casue system no response(2.4.20-8)
From: fisherman
Date: Thu May 13 2004 - 03:51:34 EST
Hello,
I am writting a virtual device driver, I found that if I add sleep
into function make_request_fn(), then use dd to copy 100M data to the
corresponding device, the system goes dead(keyboard & mouse have no
response, can't login by telnet).
I also tried to add sleep into LVM's driver, and the test result is
similar to our driver do, the test about LVM is shown as follws:
[1] source modification
-------- source begin --------
static int lvm_make_request_fn(request_queue_t * q,
int rw, struct buffer_head *bh)
{
current->state = TASK_INTERRUPTIBLE; /* newly added */
schedule_timeout(1); /*newly added*/
return (lvm_map(bh, rw) <= 0) ? 0 : 1;
}
-------- source end --------
[2] test 1
after building the module, the system will go dead if I run the
folling command to write data to a LV(100M bye ONE command):
#dd if=/dev/zero of=/dev/vg_data1/dlv3 bs=1024 count=100000
[3] test 2
but write operation with smaller size can be repeated many times, the
following script runs OK.
-------- script begin --------
#write 10M for 10 times
i=0
pos=0
cnt=10000
while [ $i -lt 10 ]
do
dd if=/dev/zero of=/dev/vg_data1/dlv3 bs=1024 count=$cnt seek=$pos
i=`expr $i + 1`
pos=`expr $pos + $cnt`
done
-------- script end --------
[4] environment
redhat 9;
kernel 2.4.20-8.
I repeated test 1 and test 2 for many times, ant the result are the
same.
Can anyone tell me the reason?
thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/