From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel@lists.sourceforge.net,
kj <kernel-janitors@lists.osdl.org>,
lkml <linux-kernel@vger.kernel.org>,
bcollins@debian.org
Subject: [KJ] Re: [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of
Date: Mon, 10 Jan 2005 17:39:45 +0000 [thread overview]
Message-ID: <20050110173945.GB3099@us.ibm.com> (raw)
In-Reply-To: <17a9eec54394ded0a28295a6548a5c65@localhost>
[-- Attachment #1: Type: text/plain, Size: 2085 bytes --]
On Sun, Jan 09, 2005 at 10:01:21AM +0100, Stefan Richter wrote:
> Nishanth Aravamudan wrote:
> >Description: Use ssleep() instead of schedule_timeout() to guarantee
> >the task
> >delays as expected. The existing code should not really need to run in
> >TASK_INTERRUPTIBLE, as there is no check for signals (or even an
> >early return
> >value whatsoever). ssleep() takes care of these issues.
>
> >--- 2.6.10-v/drivers/ieee1394/sbp2.c 2004-12-24 13:34:00.000000000
> >-0800
> >+++ 2.6.10/drivers/ieee1394/sbp2.c 2005-01-05 14:23:05.000000000 -0800
> >@@ -902,8 +902,7 @@ alloc_fail:
> > * connected to the sbp2 device being removed. That host would
> > * have a certain amount of time to relogin before the sbp2 device
> > * allows someone else to login instead. One second makes sense. */
> >- set_current_state(TASK_INTERRUPTIBLE);
> >- schedule_timeout(HZ);
> >+ ssleep(1);
>
> Maybe the current code is _deliberately_ accepting interruption by
> signals but trying to complete sbp2_probe() anyway. However it seems
> more plausible to me to abort the device probe, for example like this:
> if (msleep_interruptible(1000)) {
> sbp2_remove_device(scsi_id);
> return -EINTR;
> }
You might be right, but I'd like to get Ben's input on this, as I honeslty am
unsure. To be fair, I am trying to audit all usage of schedule_timeout() and the
semantic interpretation (to me) of using TASK_INTERRUPTIBLE is that you wish to
sleep a certain amount of time, but also are prepared for an early return on
either signals or wait-queue events. msleep_interruptible() cleanly removes this
second issue, but still requires the caller to respond appropriately if there is
a return value. Hence, I like your change. I think it makes the most sense.
Since I didn't/don't know how the device works, I was not able to make the
change myself. Thanks for your input!
> Anyway, signal handling does not appear to be critical there.
Just out of curiousity, doesn't that run the risk, though, of
signal_pending(current) being true for quite a bit of time following the
timeout?
Thanks,
Nish
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
WARNING: multiple messages have this Message-ID (diff)
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel@lists.sourceforge.net,
kj <kernel-janitors@lists.osdl.org>,
lkml <linux-kernel@vger.kernel.org>,
bcollins@debian.org
Subject: Re: [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of schedule_timeout()
Date: Mon, 10 Jan 2005 09:39:45 -0800 [thread overview]
Message-ID: <20050110173945.GB3099@us.ibm.com> (raw)
In-Reply-To: <17a9eec54394ded0a28295a6548a5c65@localhost>
On Sun, Jan 09, 2005 at 10:01:21AM +0100, Stefan Richter wrote:
> Nishanth Aravamudan wrote:
> >Description: Use ssleep() instead of schedule_timeout() to guarantee
> >the task
> >delays as expected. The existing code should not really need to run in
> >TASK_INTERRUPTIBLE, as there is no check for signals (or even an
> >early return
> >value whatsoever). ssleep() takes care of these issues.
>
> >--- 2.6.10-v/drivers/ieee1394/sbp2.c 2004-12-24 13:34:00.000000000
> >-0800
> >+++ 2.6.10/drivers/ieee1394/sbp2.c 2005-01-05 14:23:05.000000000 -0800
> >@@ -902,8 +902,7 @@ alloc_fail:
> > * connected to the sbp2 device being removed. That host would
> > * have a certain amount of time to relogin before the sbp2 device
> > * allows someone else to login instead. One second makes sense. */
> >- set_current_state(TASK_INTERRUPTIBLE);
> >- schedule_timeout(HZ);
> >+ ssleep(1);
>
> Maybe the current code is _deliberately_ accepting interruption by
> signals but trying to complete sbp2_probe() anyway. However it seems
> more plausible to me to abort the device probe, for example like this:
> if (msleep_interruptible(1000)) {
> sbp2_remove_device(scsi_id);
> return -EINTR;
> }
You might be right, but I'd like to get Ben's input on this, as I honeslty am
unsure. To be fair, I am trying to audit all usage of schedule_timeout() and the
semantic interpretation (to me) of using TASK_INTERRUPTIBLE is that you wish to
sleep a certain amount of time, but also are prepared for an early return on
either signals or wait-queue events. msleep_interruptible() cleanly removes this
second issue, but still requires the caller to respond appropriately if there is
a return value. Hence, I like your change. I think it makes the most sense.
Since I didn't/don't know how the device works, I was not able to make the
change myself. Thanks for your input!
> Anyway, signal handling does not appear to be critical there.
Just out of curiousity, doesn't that run the risk, though, of
signal_pending(current) being true for quite a bit of time following the
timeout?
Thanks,
Nish
next prev parent reply other threads:[~2005-01-10 17:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-25 0:48 [KJ] [announce] 2.6.10-kj Domen Puncer
2004-12-25 0:48 ` Domen Puncer
2005-01-07 19:33 ` [KJ] [UPDATE PATCH] atm/ambassador: use msleep() instead of Nishanth Aravamudan
2005-01-07 19:33 ` [UPDATE PATCH] atm/ambassador: use msleep() instead of schedule_timeout() Nishanth Aravamudan
2005-01-07 19:40 ` [KJ] [UPDATE PATCH] ide/ide-cd: use ssleep() instead of Nishanth Aravamudan
2005-01-07 19:40 ` [UPDATE PATCH] ide/ide-cd: use ssleep() instead of schedule_timeout() Nishanth Aravamudan
2005-01-07 19:47 ` [KJ] Re: [UPDATE PATCH] ide/ide-cd: use ssleep() instead of Jens Axboe
2005-01-07 19:47 ` [UPDATE PATCH] ide/ide-cd: use ssleep() instead of schedule_timeout() Jens Axboe
2005-01-15 0:58 ` [KJ] Re: [UPDATE PATCH] ide/ide-cd: use ssleep() instead of Bartlomiej Zolnierkiewicz
2005-01-15 0:58 ` [UPDATE PATCH] ide/ide-cd: use ssleep() instead of schedule_timeout() Bartlomiej Zolnierkiewicz
2005-01-07 21:34 ` [KJ] [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of Nishanth Aravamudan
2005-01-07 21:34 ` [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of schedule_timeout() Nishanth Aravamudan
2005-01-09 9:01 ` [KJ] Re: [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of Stefan Richter
2005-01-09 9:01 ` [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of schedule_timeout() Stefan Richter
2005-01-10 17:39 ` Nishanth Aravamudan [this message]
2005-01-10 17:39 ` Nishanth Aravamudan
2005-01-14 4:52 ` [KJ] Re: [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of Dan Dennedy
2005-01-14 4:52 ` [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of schedule_timeout() Dan Dennedy
2005-01-14 11:16 ` [KJ] Re: [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead Stefan Richter
2005-01-14 11:16 ` [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of schedule_timeout() Stefan Richter
2005-01-19 6:27 ` [KJ] Re: [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of Nish Aravamudan
2005-01-19 6:27 ` [KJ] Re: [UPDATE PATCH] ieee1394/sbp2: use ssleep() instead of schedule_timeout() Nish Aravamudan
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=20050110173945.GB3099@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=bcollins@debian.org \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=stefanr@s5r6.in-berlin.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.