* [Kernel-janitors] Re: Replaces yield() with nicedelay() on
@ 2004-05-24 13:24 Domen Puncer
2004-05-24 14:31 ` Greg KH
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Domen Puncer @ 2004-05-24 13:24 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]
On 02/05/04 22:24 -0300, Gustavo Franco wrote:
> Hi,
>
> It's the last REDIFF, but i'm not replacing yield() with
> schedule_timeout() because there's a nicedelay() (maybe the
> usecs need to be tuned below) there:
>
>
> static inline void nicedelay(unsigned long usecs)
> {
> current->state = TASK_INTERRUPTIBLE;
> schedule_timeout(HZ);
> return;
> }
And usecs stands for??
Funny thing is that there are actualy uses of this function.
Also, please make -p1 applyable patches.
>
> Hope that helps,
> Gustavo Franco
>
> --- drivers/net/sb1000.c.orig 2004-04-28 20:50:17.000000000 -0300
> +++ drivers/net/sb1000.c 2004-04-28 20:49:10.000000000 -0300
> @@ -271,7 +271,7 @@
> timeout = jiffies + TimeOutJiffies;
> while (a & 0x80 || a & 0x40) {
> /* a little sleep */
> - yield();
> + nicedelay(10000);
>
>
> a = inb(ioaddr[0] + 7);
> if (time_after_eq(jiffies, timeout)) {
> @@ -295,7 +295,7 @@
> timeout = jiffies + TimeOutJiffies;
> while (a & 0x80 || !(a & 0x40)) {
> /* a little sleep */
> - yield();
> + nicedelay(10000);
>
>
> a = inb(ioaddr[1] + 6);
> if (time_after_eq(jiffies, timeout)) {
>
>
>
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> http://lists.osdl.org/mailman/listinfo/kernel-janitors
[-- 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] 5+ messages in thread* Re: [Kernel-janitors] Re: Replaces yield() with nicedelay() on
2004-05-24 13:24 [Kernel-janitors] Re: Replaces yield() with nicedelay() on Domen Puncer
@ 2004-05-24 14:31 ` Greg KH
2004-05-25 0:47 ` Gustavo Franco
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2004-05-24 14:31 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 666 bytes --]
On Mon, May 24, 2004 at 03:24:40PM +0200, Domen Puncer wrote:
> On 02/05/04 22:24 -0300, Gustavo Franco wrote:
> > Hi,
> >
> > It's the last REDIFF, but i'm not replacing yield() with
> > schedule_timeout() because there's a nicedelay() (maybe the
> > usecs need to be tuned below) there:
> >
> >
> > static inline void nicedelay(unsigned long usecs)
> > {
> > current->state = TASK_INTERRUPTIBLE;
> > schedule_timeout(HZ);
> > return;
> > }
>
> And usecs stands for??
> Funny thing is that there are actualy uses of this function.
Heh, also look at using the msleep function instead of redefining your
own function.
thanks,
greg k-h
[-- 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] 5+ messages in thread* Re: [Kernel-janitors] Re: Replaces yield() with nicedelay() on
2004-05-24 13:24 [Kernel-janitors] Re: Replaces yield() with nicedelay() on Domen Puncer
2004-05-24 14:31 ` Greg KH
@ 2004-05-25 0:47 ` Gustavo Franco
2004-05-25 0:49 ` Gustavo Franco
2004-05-25 11:28 ` Domen Puncer
3 siblings, 0 replies; 5+ messages in thread
From: Gustavo Franco @ 2004-05-25 0:47 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 835 bytes --]
Greg KH wrote:
> On Mon, May 24, 2004 at 03:24:40PM +0200, Domen Puncer wrote:
>
>>On 02/05/04 22:24 -0300, Gustavo Franco wrote:
>>
>>>Hi,
>>>
>>>It's the last REDIFF, but i'm not replacing yield() with
>>>schedule_timeout() because there's a nicedelay() (maybe the
>>>usecs need to be tuned below) there:
>>>
>>>
>>>static inline void nicedelay(unsigned long usecs)
>>>{
>>> current->state = TASK_INTERRUPTIBLE;
>>> schedule_timeout(HZ);
>>> return;
>>>}
>>
>>And usecs stands for??
>>Funny thing is that there are actualy uses of this function.
Yes, it's not my piece of code.
> Heh, also look at using the msleep function instead of redefining your
> own function.
>
Are you recommending to use msleep() instead schedule_timeout() to
replace yield() ? Only in some cases? What?
Thanks,
Gustavo Franco
[-- 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] 5+ messages in thread* [Kernel-janitors] Re: Replaces yield() with nicedelay() on
2004-05-24 13:24 [Kernel-janitors] Re: Replaces yield() with nicedelay() on Domen Puncer
2004-05-24 14:31 ` Greg KH
2004-05-25 0:47 ` Gustavo Franco
@ 2004-05-25 0:49 ` Gustavo Franco
2004-05-25 11:28 ` Domen Puncer
3 siblings, 0 replies; 5+ messages in thread
From: Gustavo Franco @ 2004-05-25 0:49 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 817 bytes --]
Domen Puncer wrote:
> On 02/05/04 22:24 -0300, Gustavo Franco wrote:
>
>>Hi,
>>
>>It's the last REDIFF, but i'm not replacing yield() with
>>schedule_timeout() because there's a nicedelay() (maybe the
>>usecs need to be tuned below) there:
>>
>>
>>static inline void nicedelay(unsigned long usecs)
>>{
>> current->state = TASK_INTERRUPTIBLE;
>> schedule_timeout(HZ);
>> return;
>>}
>
>
> And usecs stands for??
> Funny thing is that there are actualy uses of this function.
What do you think about msleep() as greg said?
> Also, please make -p1 applyable patches.
I'm preparing my travel to debconf4, i'll be back on 30 May.In
early June i'll send rediffied patches.As i said in a previous
post it was my error.I was still considering the "old" SubmittingPatches.
Thanks,
Gustavo Franco
[-- 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] 5+ messages in thread* [Kernel-janitors] Re: Replaces yield() with nicedelay() on
2004-05-24 13:24 [Kernel-janitors] Re: Replaces yield() with nicedelay() on Domen Puncer
` (2 preceding siblings ...)
2004-05-25 0:49 ` Gustavo Franco
@ 2004-05-25 11:28 ` Domen Puncer
3 siblings, 0 replies; 5+ messages in thread
From: Domen Puncer @ 2004-05-25 11:28 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1179 bytes --]
On 24/05/04 21:49 -0300, Gustavo Franco wrote:
> Domen Puncer wrote:
> >On 02/05/04 22:24 -0300, Gustavo Franco wrote:
> >
> >>Hi,
> >>
> >>It's the last REDIFF, but i'm not replacing yield() with
> >>schedule_timeout() because there's a nicedelay() (maybe the
> >>usecs need to be tuned below) there:
> >>
> >>
> >>static inline void nicedelay(unsigned long usecs)
> >>{
> >> current->state = TASK_INTERRUPTIBLE;
> >> schedule_timeout(HZ);
> >> return;
> >>}
> >
> >
> >And usecs stands for??
> >Funny thing is that there are actualy uses of this function.
>
> What do you think about msleep() as greg said?
msleep is definitely the way to go, it includes set_current_state, and
is more readable.
> >Also, please make -p1 applyable patches.
>
> I'm preparing my travel to debconf4, i'll be back on 30 May.In
> early June i'll send rediffied patches.As i said in a previous
> post it was my error.I was still considering the "old" SubmittingPatches.
>
>
> Thanks,
> Gustavo Franco
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> http://lists.osdl.org/mailman/listinfo/kernel-janitors
[-- 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] 5+ messages in thread
end of thread, other threads:[~2004-05-25 11:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-24 13:24 [Kernel-janitors] Re: Replaces yield() with nicedelay() on Domen Puncer
2004-05-24 14:31 ` Greg KH
2004-05-25 0:47 ` Gustavo Franco
2004-05-25 0:49 ` Gustavo Franco
2004-05-25 11:28 ` Domen Puncer
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.