* [patch 1/8] irda/act200l-sir: replace schedule_timeout() with msleep() @ 2004-09-01 21:05 janitor 2004-09-01 21:09 ` Jean Tourrilhes 0 siblings, 1 reply; 6+ messages in thread From: janitor @ 2004-09-01 21:05 UTC (permalink / raw) To: netdev; +Cc: jgarzik, jt, janitor I would appreciate any comments from the janitor@sternweltens list. Description: Replace schedule_timeout() with msleep() to guarantee the task delays for the desired time. Signed-off-by: Nishanth Aravamudan <nacc@us•ibm.com> Signed-off-by: Maximilian Attems <janitor@sternwelten•at> --- linux-2.6.9-rc1-bk7-max/drivers/net/irda/act200l-sir.c | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) diff -puN drivers/net/irda/act200l-sir.c~msleep-drivers_net_irda_act200l-sir drivers/net/irda/act200l-sir.c --- linux-2.6.9-rc1-bk7/drivers/net/irda/act200l-sir.c~msleep-drivers_net_irda_act200l-sir 2004-09-01 19:35:31.000000000 +0200 +++ linux-2.6.9-rc1-bk7-max/drivers/net/irda/act200l-sir.c 2004-09-01 19:35:31.000000000 +0200 @@ -177,8 +177,7 @@ static int act200l_change_speed(struct s /* Write control bytes */ sirdev_raw_write(dev, control, 3); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(5)); + msleep(5); /* Go back to normal mode */ sirdev_set_dtr_rts(dev, TRUE, TRUE); _ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch 1/8] irda/act200l-sir: replace schedule_timeout() with msleep() 2004-09-01 21:05 [patch 1/8] irda/act200l-sir: replace schedule_timeout() with msleep() janitor @ 2004-09-01 21:09 ` Jean Tourrilhes 2004-09-01 21:40 ` [Kernel-janitors] " maximilian attems 0 siblings, 1 reply; 6+ messages in thread From: Jean Tourrilhes @ 2004-09-01 21:09 UTC (permalink / raw) To: janitor; +Cc: netdev, jgarzik On Wed, Sep 01, 2004 at 11:05:23PM +0200, janitor@sternwelten•at wrote: > > > > > > > I would appreciate any comments from the janitor@sternweltens list. I already commented that I don't like the confusing msleep() API and I prefer the more explicit schedule_timeout(). But that's only me... Jean ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Kernel-janitors] Re: [patch 1/8] irda/act200l-sir: replace schedule_timeout() with msleep() 2004-09-01 21:09 ` Jean Tourrilhes @ 2004-09-01 21:40 ` maximilian attems 2004-09-01 21:48 ` Jean Tourrilhes 0 siblings, 1 reply; 6+ messages in thread From: maximilian attems @ 2004-09-01 21:40 UTC (permalink / raw) To: jt; +Cc: kj, netdev, jgarzik [-- Attachment #1: Type: text/plain, Size: 666 bytes --] On Wed, 01 Sep 2004, Jean Tourrilhes wrote: > On Wed, Sep 01, 2004 at 11:05:23PM +0200, janitor@sternwelten•at wrote: > > I would appreciate any comments from the janitor@sternweltens list. uups mangled some text there sorry for this silly email. > > I already commented that I don't like the confusing msleep() > API and I prefer the more explicit schedule_timeout(). > But that's only me... > > Jean hmm we have still archs were HZ < 100. i find msleep use msecs units a lot more readable than schedule_timeout((HZ + 99) / 100); the schedule_timeout(HZ/100) gets safely converted with msleep. -- maks kernel janitor http://janitor.kernelnewbies.org/ [-- 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch 1/8] irda/act200l-sir: replace schedule_timeout() with msleep() 2004-09-01 21:40 ` [Kernel-janitors] " maximilian attems @ 2004-09-01 21:48 ` Jean Tourrilhes 2004-09-01 22:03 ` [Kernel-janitors] " Nishanth Aravamudan 2004-09-01 22:58 ` maximilian attems 0 siblings, 2 replies; 6+ messages in thread From: Jean Tourrilhes @ 2004-09-01 21:48 UTC (permalink / raw) To: netdev, jgarzik, kj On Wed, Sep 01, 2004 at 11:40:03PM +0200, maximilian attems wrote: > On Wed, 01 Sep 2004, Jean Tourrilhes wrote: > > > On Wed, Sep 01, 2004 at 11:05:23PM +0200, janitor@sternwelten•at wrote: > > > I would appreciate any comments from the janitor@sternweltens list. > uups mangled some text there sorry for this silly email. > > > > I already commented that I don't like the confusing msleep() > > API and I prefer the more explicit schedule_timeout(). > > But that's only me... > > > > Jean > > hmm we have still archs were HZ < 100. > i find msleep use msecs units a lot more readable than > schedule_timeout((HZ + 99) / 100); > > the schedule_timeout(HZ/100) gets safely converted with msleep. I don't have complain about converting the (HZ + 99) / 100 expressions to something saner. My beef is the fact that msleep hide the fact that a schedule might happen. This is important in the IrDA code. > maks Jean ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Kernel-janitors] Re: [patch 1/8] irda/act200l-sir: replace schedule_timeout() with msleep() 2004-09-01 21:48 ` Jean Tourrilhes @ 2004-09-01 22:03 ` Nishanth Aravamudan 2004-09-01 22:58 ` maximilian attems 1 sibling, 0 replies; 6+ messages in thread From: Nishanth Aravamudan @ 2004-09-01 22:03 UTC (permalink / raw) To: jt; +Cc: kj, netdev, jgarzik [-- Attachment #1: Type: text/plain, Size: 1508 bytes --] On Wed, Sep 01, 2004 at 02:48:15PM -0700, Jean Tourrilhes wrote: > On Wed, Sep 01, 2004 at 11:40:03PM +0200, maximilian attems wrote: > > On Wed, 01 Sep 2004, Jean Tourrilhes wrote: > > > > > On Wed, Sep 01, 2004 at 11:05:23PM +0200, janitor@sternwelten•at wrote: > > > > I would appreciate any comments from the janitor@sternweltens list. > > uups mangled some text there sorry for this silly email. > > > > > > I already commented that I don't like the confusing msleep() > > > API and I prefer the more explicit schedule_timeout(). > > > But that's only me... > > > > > > Jean > > > > hmm we have still archs were HZ < 100. > > i find msleep use msecs units a lot more readable than > > schedule_timeout((HZ + 99) / 100); > > > > the schedule_timeout(HZ/100) gets safely converted with msleep. > > I don't have complain about converting the (HZ + 99) / 100 > expressions to something saner. My beef is the fact that msleep hide > the fact that a schedule might happen. This is important in the IrDA > code. It *is* important for developers to realize that invoking msleep() may involve giving up the CPU (ie. eventually calling schedule()); however, I think my previous point, that the name itself (the "sleep" part, I mean) is a fair and clear indication of this behavior, is valid. In those cases where a busy-wait is desired, then mdelay() should be used, as indicated by "delay". I think with this in mind & with a quick glance at the source, if need be, the naming is quite safe. -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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Kernel-janitors] Re: [patch 1/8] irda/act200l-sir: replace schedule_timeout() with msleep() 2004-09-01 21:48 ` Jean Tourrilhes 2004-09-01 22:03 ` [Kernel-janitors] " Nishanth Aravamudan @ 2004-09-01 22:58 ` maximilian attems 1 sibling, 0 replies; 6+ messages in thread From: maximilian attems @ 2004-09-01 22:58 UTC (permalink / raw) To: jt; +Cc: kj, netdev, jgarzik [-- Attachment #1: Type: text/plain, Size: 737 bytes --] On Wed, 01 Sep 2004, Jean Tourrilhes wrote: > On Wed, Sep 01, 2004 at 11:40:03PM +0200, maximilian attems wrote: > > On Wed, 01 Sep 2004, Jean Tourrilhes wrote: .. > > > > hmm we have still archs were HZ < 100. > > i find msleep use msecs units a lot more readable than > > schedule_timeout((HZ + 99) / 100); > > > > the schedule_timeout(HZ/100) gets safely converted with msleep. > > I don't have complain about converting the (HZ + 99) / 100 > expressions to something saner. My beef is the fact that msleep hide > the fact that a schedule might happen. This is important in the IrDA > code. sorry my woding was confusing: (HZ + 99) / 100 is correct! as msleep(10) -- maks kernel janitor http://janitor.kernelnewbies.org/ [-- 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-09-01 22:58 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2004-09-01 21:05 [patch 1/8] irda/act200l-sir: replace schedule_timeout() with msleep() janitor 2004-09-01 21:09 ` Jean Tourrilhes 2004-09-01 21:40 ` [Kernel-janitors] " maximilian attems 2004-09-01 21:48 ` Jean Tourrilhes 2004-09-01 22:03 ` [Kernel-janitors] " Nishanth Aravamudan 2004-09-01 22:58 ` maximilian attems
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox