* sleep in make_request_fn() casue system no response(2.4.20-8)
@ 2004-05-13 8:47 fisherman
0 siblings, 0 replies; only message in thread
From: fisherman @ 2004-05-13 8:47 UTC (permalink / raw)
To: linux-kernel
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-05-13 8:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-13 8:47 sleep in make_request_fn() casue system no response(2.4.20-8) fisherman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®