From: Tejun Heo <htejun@gmail.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Jens Axboe <axboe@suse.de>, Christoph Hellwig <hch@infradead.org>,
SCSI Mailing List <linux-scsi@vger.kernel.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH scsi-misc-2.6 02/07] scsi: make scsi_send_eh_cmnd use its own timer instead of scmd->eh_timeout
Date: Tue, 19 Apr 2005 08:25:22 +0900 [thread overview]
Message-ID: <426441E2.1010900@gmail.com> (raw)
In-Reply-To: <1113864917.4998.89.camel@mulgrave>
James Bottomley wrote:
> On Tue, 2005-04-19 at 07:31 +0900, Tejun Heo wrote:
>
>> The original code also uses timer pending status as a signal that
>>command completed normally in scsi_eh_done() function, and the same
>>race also exists in the original code, no matter what we do, unless we
>>make timer expiration and removal of the command atomic, there will be
>>a window in which command completes normally but considered to have
>>timed out as long as we use timer pending status as tie breaker.
>
>
> True enough; it's a race between the driver calling scsi_done() and the
> timer expiring. However, that's an acceptable race, since the timer
> values are usually in the order of a few seconds and the command usually
> completes in milliseconds. the done function is called in interrupt
> context after command completion, so it's as close as possible to the
> actual command completion
>
>
>> The patch moves the test out of scsi_eh_done() into
>>scsi_send_eh_cmnd() and this does widen the window by delaying removal
>>of timer until after the original thread gets scheduled, but usually
>>not by much and that's how timers are done in many cases (through out
>>the kernel, timer removals are done with intervening scheduling and no
>>one considers those incorrect). So...
>
>
> The time between a thread being marked ready to run and actually running
> has been measured in seconds on a heavily loaded system. That makes the
> race window potentially as wide as the timer, which is unacceptable.
Hmm, okay, agreed. I'll rework it. I think I can do it by just adding
a private struct scsi_eh_timer_arg to pass along the timer and the cmd
pointer. I'll repost the patchset soon.
Thanks a lot.
--
tejun
next prev parent reply other threads:[~2005-04-18 23:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-10 18:45 [PATCH scsi-misc-2.6 00/07] scsi: timer updates Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 01/07] scsi: make aic7xxx use its own timer instead of scmd->eh_timeout Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 02/07] scsi: make scsi_send_eh_cmnd " Tejun Heo
2005-04-18 15:33 ` James Bottomley
2005-04-18 22:31 ` Tejun Heo
2005-04-18 22:55 ` James Bottomley
2005-04-18 23:25 ` Tejun Heo [this message]
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 03/07] scsi: remove a timer race in scsi_queue_insert() Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 04/07] scsi: remove unnecessary scsi_delete_timer() call in scsi_reset_provider() Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 05/07] scsi: unexport scsi_{add|delete}_timer() Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 06/07] scsi: Delete scsi_{add|delete}_timer() from scsi_mid_low_api.txt Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 07/07] scsi: make reuse of SCSI cmd timer strict Tejun Heo
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=426441E2.1010900@gmail.com \
--to=htejun@gmail.com \
--cc=James.Bottomley@SteelEye.com \
--cc=axboe@suse.de \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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