* problem with ending requests asynchronously in my block device driver
@ 2007-12-17 19:50 cable_plug
0 siblings, 0 replies; 7+ messages in thread
From: cable_plug @ 2007-12-17 19:50 UTC (permalink / raw)
To: linux-kernel
Hi,
I've a block device driver which does the following,
Inside the request function I do something like this:
request(fn) {
while ((req = elv_next_request(q)) != NULL) {
....................set up the request;
spin_unlock_irq(q->queue_lock);
call the transfer(set_up_req) function;
spin_lock_irq(q->queue_lock);
}
spin_unlock_irq (q->queue_lock);
/* allow callback to execute as it needs the lock!!! */
spin_lock_irq (q->queue_lock);
}
and the transfer function calls the scsi_execute_asyn(....) with the
callback function doing the end request. So, the ending of the request is
done like below:
callback(fn) {
spin_lock_irqsave(q->queue_lock, flags);
if (!end_that_request_first(set_up_req->req, cmpstatus,
set_up_req->req->nr_sectors)) {
add_disk_randomness(...);
end_that_request_last(set_up_req->req,0);
}
spin_unlock_irqrestore(q->queue_lock, flags);
}
This code works fine with most of the kernel versions, but fails on some
like , Linux 2.6.18-8.el5-xen
Please help me to find out where I'm going wrong?
when I say 'fails' it just hangs without any error ....I'm using dt(Data
test) to write to the disk. The logs show that all the requests that have
been sent for processing, have completed sucessfully. Its just that new
requests never enter the request function. So, the dt writes almost half the
data and then simply hangs.
The actual code does nothing but, call the scsi_execute_async , which
later on calls the callback function which is used to end the request.
So, both the callback function and the request function need to share
the queue lock. So the code samples I sent cover all the aspects of my
program. What I'm looking for here is how can I end the requests
asynchronously much later after the request processing is done. Please note
here that the asynchronous end requests is done by the callback function
of the scsi_execute_async, which needs to share the queue lock with
the request function.
when I say 'fails' it just hangs without any error ....I'm using
dt(Data
test) to write to the disk. The logs show that all the requests that
have
been sent for processing, have completed successfully. Its just that new
requests never enter the request function. So, the dt writes almost
half the
data and then simply hangs.
Thanks in advance for an early reply.
Anil P.
--
View this message in context: http://www.nabble.com/problem-with-ending-requests-asynchronously-in-my-block-device-driver-tp14374016p14374016.html
Sent from the linux-kernel mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 7+ messages in thread* problem with ending requests asynchronously in my block device driver
@ 2007-12-17 20:21 cable_plug
0 siblings, 0 replies; 7+ messages in thread
From: cable_plug @ 2007-12-17 20:21 UTC (permalink / raw)
To: linux-kernel
Hi,
I've a block device driver which does the following,
Inside the request function I do something like this:
request(fn) {
while ((req = elv_next_request(q)) != NULL) {
....................set up the request;
spin_unlock_irq(q->queue_lock);
call the transfer(set_up_req) function;
spin_lock_irq(q->queue_lock);
}
spin_unlock_irq (q->queue_lock);
/* allow callback to execute as it needs the lock!!! */
spin_lock_irq (q->queue_lock);
}
and the transfer function calls the scsi_execute_asyn(....) with the
callback function doing the end request. So, the ending of the request is
done like below:
callback(fn) {
spin_lock_irqsave(q->queue_lock, flags);
if (!end_that_request_first(set_up_req->req, cmpstatus,
set_up_req->req->nr_sectors)) {
add_disk_randomness(...);
end_that_request_last(set_up_req->req,0);
}
spin_unlock_irqrestore(q->queue_lock, flags);
}
This code works fine with most of the kernel versions, but fails on some
like , Linux 2.6.18-8.el5-xen
Please help me to find out where I'm going wrong?
when I say 'fails' it just hangs without any error ....I'm using dt(Data
test) to write to the disk. The logs show that all the requests that have
been sent for processing, have completed sucessfully. Its just that new
requests never enter the request function. So, the dt writes almost half the
data and then simply hangs.
The actual code does nothing but, call the scsi_execute_async , which
later on calls the callback function which is used to end the request.
So, both the callback function and the request function need to share
the queue lock. So the code samples I sent cover all the aspects of my
program. What I'm looking for here is how can I end the requests
asynchronously much later after the request processing is done. Please note
here that the asynchronous end requests is done by the callback function
of the scsi_execute_async, which needs to share the queue lock with
the request function.
when I say 'fails' it just hangs without any error ....I'm using
dt(Data
test) to write to the disk. The logs show that all the requests that
have
been sent for processing, have completed successfully. Its just that new
requests never enter the request function. So, the dt writes almost
half the
data and then simply hangs.
Thanks in advance for an early reply.
Anil P.
--
View this message in context: http://www.nabble.com/problem-with-ending-requests-asynchronously-in-my-block-device-driver-tp14374028p14374028.html
Sent from the linux-kernel mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 7+ messages in thread* problem with ending requests asynchronously in my block device driver
@ 2007-12-17 15:52 a_kumar
0 siblings, 0 replies; 7+ messages in thread
From: a_kumar @ 2007-12-17 15:52 UTC (permalink / raw)
To: linux-kernel
Hi,
I've a block device driver which does the following,
Inside the request function I do something like this:
request(fn) {
while ((req = elv_next_request(q)) != NULL) {
....................set up the request;
spin_unlock_irq(q->queue_lock);
call the transfer(set_up_req) function;
spin_lock_irq(q->queue_lock);
}
spin_unlock_irq (q->queue_lock);
/* allow callback to execute as it needs the lock!!! */
spin_lock_irq (q->queue_lock);
}
and the transfer function calls the scsi_execute_asyn(....) with the
callback function doing the end request. So, the ending of the request is
done like below:
callback(fn) {
spin_lock_irqsave(q->queue_lock, flags);
if (!end_that_request_first(set_up_req->req, cmpstatus,
set_up_req->req->nr_sectors)) {
add_disk_randomness(...);
end_that_request_last(set_up_req->req,0);
}
spin_unlock_irqrestore(q->queue_lock, flags);
}
This code works fine with most of the kernel versions, but fails on some
like , Linux 2.6.18-8.el5-xen
Please help me to find out where I'm going wrong?
when I say 'fails' it just hangs without any error ....I'm using dt(Data
test) to write to the disk. The logs show that all the requests that have
been sent for processing, have completed sucessfully. Its just that new
requests never enter the request function. So, the dt writes almost half the
data and then simply hangs.
The actual code does nothing but, call the scsi_execute_async , which
later on calls the callback function which is used to end the request.
So, both the callback function and the request function need to share
the queue lock. So the code samples I sent cover all the aspects of my
program. What I'm looking for here is how can I end the requests
asynchronously much later after the request processing is done. Please note
here that the asynchronous end requests is done by the callback function
of the scsi_execute_async, which needs to share the queue lock with
the request function.
when I say 'fails' it just hangs without any error ....I'm using
dt(Data
test) to write to the disk. The logs show that all the requests that
have
been sent for processing, have completed successfully. Its just that new
requests never enter the request function. So, the dt writes almost
half the
data and then simply hangs.
Thanks in advance for an early reply.
Anil P.
--
View this message in context: http://www.nabble.com/problem-with-ending-requests-asynchronously-in-my-block-device-driver-tp14372561p14372561.html
Sent from the linux-kernel mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 7+ messages in thread* problem with ending requests asynchronously in my block device driver
@ 2007-12-15 21:57 a_kumar
0 siblings, 0 replies; 7+ messages in thread
From: a_kumar @ 2007-12-15 21:57 UTC (permalink / raw)
To: linux-kernel
Hi,
I've a block device driver which does the following,
Inside the request function I do something like this:
request(fn) {
while ((req = elv_next_request(q)) != NULL) {
....................set up the request;
spin_unlock_irq(q->queue_lock);
call the transfer(set_up_req) function;
spin_lock_irq(q->queue_lock);
}
spin_unlock_irq (q->queue_lock);
/* allow callback to execute as it needs the lock!!! */
spin_lock_irq (q->queue_lock);
}
and the transfer function calls the scsi_execute_asyn(....) with the
callback function doing the end request. So, the ending of the request is
done like below:
callback(fn) {
spin_lock_irqsave(q->queue_lock, flags);
if (!end_that_request_first(set_up_req->req, cmpstatus,
set_up_req->req->nr_sectors)) {
add_disk_randomness(...);
end_that_request_last(set_up_req->req,0);
}
spin_unlock_irqrestore(q->queue_lock, flags);
}
This code works fine with most of the kernel versions, but fails on some
like , Linux 2.6.18-8.el5-xen
Please help me to find out where I'm going wrong?
when I say 'fails' it just hangs without any error ....I'm using dt(Data
test) to write to the disk. The logs show that all the requests that have
been sent for processing, have completed sucessfully. Its just that new
requests never enter the request function. So, the dt writes almost half the
data and then simply hangs.
Thanks in advance for an early reply.
Anil P.
--
View this message in context: http://www.nabble.com/problem-with-ending-requests-asynchronously-in-my-block-device-driver-tp14355561p14355561.html
Sent from the linux-kernel mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 7+ messages in thread* problem with ending requests asynchronously in my block device driver
@ 2007-12-15 21:07 a_kumar
0 siblings, 0 replies; 7+ messages in thread
From: a_kumar @ 2007-12-15 21:07 UTC (permalink / raw)
To: linux-kernel
Hi,
I've a block device driver which does the following,
Inside the request function I do something like this:
request(fn) {
while ((req = elv_next_request(q)) != NULL) {
....................set up the request;
spin_unlock_irq(q->queue_lock);
call the transfer(set_up_req) function;
spin_lock_irq(q->queue_lock);
}
spin_unlock_irq (q->queue_lock);
/* allow callback to execute as it needs the lock!!! */
spin_lock_irq (q->queue_lock);
}
and the transfer function calls the scsi_execute_asyn(....) with the
callback function doing the end request. So, the ending of the request is
done like below:
callback(fn) {
spin_lock_irqsave(q->queue_lock, flags);
if (!end_that_request_first(set_up_req->req, cmpstatus,
set_up_req->req->nr_sectors)) {
add_disk_randomness(...);
end_that_request_last(set_up_req->req,0);
}
spin_unlock_irqrestore(q->queue_lock, flags);
}
This code works fine with most of the kernel versions, but fails on some
like , Linux 2.6.18-8.el5-xen
Please help me to find out where I'm going wrong?
Thanks in advance for an early reply.
Anil P.
--
View this message in context: http://www.nabble.com/problem-with-ending-requests-asynchronously-in-my-block-device-driver-tp14355076p14355076.html
Sent from the linux-kernel mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 7+ messages in thread* problem with ending requests asynchronously in my block device driver
@ 2007-12-15 20:52 a_kumar
2007-12-16 9:23 ` Jon Masters
0 siblings, 1 reply; 7+ messages in thread
From: a_kumar @ 2007-12-15 20:52 UTC (permalink / raw)
To: linux-kernel
Hi,
I've a block device driver which does the following,
Inside the request function I do something like this:
request(fn) {
while ((req = elv_next_request(q)) != NULL) {
....................set up the request;
spin_unlock_irq(q->queue_lock);
call the transfer(set_up_req) function;
spin_lock_irq(q->queue_lock);
}
spin_unlock_irq (q->queue_lock);
/* allow callback to execute as it needs the lock!!! */
spin_lock_irq (q->queue_lock);
}
and the transfer function calls the scsi_execute_asyn(....) with the
callback function doing the end request. So, the ending of the request is
done like below:
callback(fn) {
spin_lock_irqsave(q->queue_lock, flags);
if (!end_that_request_first(set_up_req->req, cmpstatus,
set_up_req->req->nr_sectors)) {
add_disk_randomness(...);
end_that_request_last(set_up_req->req,0);
}
spin_unlock_irqrestore(q->queue_lock, flags);
}
This code works fine with most of the kernel versions, but fails on some
like , Linux 2.6.18-8.el5-xen
Please help me to find out where I'm going wrong?
Thanks in advance for an early reply.
Anil P.
--
View this message in context: http://www.nabble.com/problem-with-ending-requests-asynchronously-in-my-block-device-driver-tp14354996p14354996.html
Sent from the linux-kernel mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: problem with ending requests asynchronously in my block device driver
2007-12-15 20:52 a_kumar
@ 2007-12-16 9:23 ` Jon Masters
0 siblings, 0 replies; 7+ messages in thread
From: Jon Masters @ 2007-12-16 9:23 UTC (permalink / raw)
To: a_kumar; +Cc: linux-kernel
On Sat, 2007-12-15 at 12:52 -0800, a_kumar wrote:
> I've a block device driver which does the following,
Why not send the actual code?
> This code works fine with most of the kernel versions, but fails on some
> like , Linux 2.6.18-8.el5-xen
You've provided no information. What we need:
*). A well formed report, complete with oops, panic, other output.
*). Description of how it "fails".
Note also that there is no upstream Linux "2.6.18-8.el5-xen" kernel.
There is a Red Hat Enterprise Linux kernel release with that revision
(this is the one that shipped in the GA RHEL5.0 kernel). You should
contact your vendor for support with their kernel if you are unable to
provide a well-formed bug report against an upstream kernel release.
Jon.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-12-17 20:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-17 19:50 problem with ending requests asynchronously in my block device driver cable_plug
-- strict thread matches above, loose matches on Subject: below --
2007-12-17 20:21 cable_plug
2007-12-17 15:52 a_kumar
2007-12-15 21:57 a_kumar
2007-12-15 21:07 a_kumar
2007-12-15 20:52 a_kumar
2007-12-16 9:23 ` Jon Masters
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox