mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: fisherman <fishermandong@yahoo.com.cn>
To: linux-kernel@vger.kernel.org
Subject: sleep in make_request_fn() casue system no response(2.4.20-8)
Date: Thu, 13 May 2004 16:47:55 +0800	[thread overview]
Message-ID: <821514233.20040513164755@yahoo.com.cn> (raw)

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.





                 reply	other threads:[~2004-05-13  8:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=821514233.20040513164755@yahoo.com.cn \
    --to=fishermandong@yahoo.com.cn \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®