From: Elias Oltmanns <eo@nebensachen.de>
To: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jeff@garzik.org>, linux-ide@vger.kernel.org
Subject: Re: [PATCH 2/2 v3] libata: Implement disk shock protection support
Date: Sun, 21 Sep 2008 11:51:56 +0200 [thread overview]
Message-ID: <871vzd6d37.fsf@denkblock.local> (raw)
In-Reply-To: 87abe37462.fsf@denkblock.local
Elias Oltmanns <eo@nebensachen.de> wrote:
> Tejun Heo <tj@kernel.org> wrote:
[...]
>>> +static ssize_t ata_scsi_park_store(struct device *device,
>>> + struct device_attribute *attr,
>>> + const char *buf, size_t len)
>>> +{
>> ...
>>> + complete_all(&ap->park_req_pending);
>>
>> Sorry to catching this this late but calling complete_all() twice will
>> overflow the done counter. I think complete() should just work here,
>> no?
[...]
> The reason why I'd like to call complete_all() rather than complete() is
> this: if two drives on seperate ports have been parked and userspace
> updates the timeout for one of them, then complete() will only wake up
> the thread that comes first in the wait queue park_req_pending.wait --
> please note that complete() and complete_all() pass different arguments
> to __wake_up_common().
What utter nonsense, I can't have been thinking straight here. Since we
have per-port completion structs park_req_pending and since there is
always at most a single EH thread per port, complete() is quite
sufficient. I even remember thinking about all this when I wrote this
code originally. Don't know why I forgot all about it later. Sorry for
causing this confusion and all the noise over the last two days.
I'll repost the exact same patch which you have acked except for the
change from complete_all() back to complete() again.
Thanks for your patience,
Elias
prev parent reply other threads:[~2008-09-21 9:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-19 21:41 Disk shock protection in libata Elias Oltmanns
2008-09-19 21:46 ` [PATCH 1/2 v3] Introduce ata_id_has_unload() Elias Oltmanns
2008-09-29 4:34 ` Jeff Garzik
2008-09-19 21:48 ` [PATCH 2/2 v3] libata: Implement disk shock protection support Elias Oltmanns
2008-09-20 4:47 ` Tejun Heo
2008-09-20 5:54 ` Elias Oltmanns
2008-09-20 11:12 ` Elias Oltmanns
2008-09-20 21:44 ` [PATCH 2/2 v4] " Elias Oltmanns
2008-09-20 23:55 ` Tejun Heo
2008-09-21 9:54 ` [PATCH 2/2 v5] " Elias Oltmanns
2008-09-21 9:58 ` Tejun Heo
2008-09-21 9:51 ` Elias Oltmanns [this message]
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=871vzd6d37.fsf@denkblock.local \
--to=eo@nebensachen.de \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=tj@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;
as well as URLs for NNTP newsgroup(s).