Skip to contentSkip to conversation

Replaces yield() with schedule_timeout()

Kernel-janitors Gustavo Franco 1 participant 4 messages Apr 29, 2004 – May 3, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I'm sending only this rediff now, if it's ok i'll send the three on my queue.

I want to say thank you for all the suggestions.

Hope that helps,
Gustavo Franco

cdrom/sonycd535.c 2004-04-28 20:50:55.000000000 -0300 renamed from cdrom/sonycd535.c.orig 2004-04-28 20:50:46.000000000 -0300 +2 -1
@@ -342,7 +342,8 @@
 sony_sleep(void)
 {
        if (sony535_irq_used <= 0) {    /* poll */
-               yield();
+               set_current_state(TASK_INTERRUPTIBLE);
+               schedule_timeout(1);
        } else {        /* Interrupt driven */
                DEFINE_WAIT(wait);
                                                                                                   

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

Hi,

It's the second REDIFF, and i've more two.

Hope that helps,
Gustavo Franco

cdrom/cdu31a.c 2004-04-28 20:44:55.000000000 -0300 renamed from cdrom/cdu31a.c.orig 2004-04-28 20:43:51.000000000 -0300 +2 -1
@@ -386,7 +386,8 @@
        unsigned long flags;
 
 
        if (cdu31a_irq <= 0) {
-               yield();
+               set_current_state(TASK_INTERRUPTIBLE);
+               schedule_timeout(1);
        } else {                /* Interrupt driven */
 
                save_flags(flags);

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to Gustavo Franco

Hi,

It's the third REDIFF, the last is coming...

Hope that helps,
Gustavo Franco

scsi/megaraid.c 2004-04-28 20:47:18.000000000 -0300 renamed from scsi/megaraid.c.orig 2004-04-28 20:46:06.000000000 -0300 +2 -1
@@ -1691,7 +1691,8 @@
        for (counter = 0; counter < 10000; counter++) {
                if (!mbox->m_in.busy)
                        return 0;
-               udelay(100); yield(1);
+               set_current_state(TASK_INTERRUPTIBLE);
+               schedule_timeout(1);
        }
        return -1;              /* give up after 1 second */
 }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#3 lore raw

[Kernel-janitors] [REDIFF] Replaces yield() with nicedelay() on

In reply to Gustavo Franco

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;
}

Hope that helps,
Gustavo Franco

net/sb1000.c 2004-04-28 20:49:10.000000000 -0300 renamed from net/sb1000.c.orig 2004-04-28 20:50:17.000000000 -0300 +1 -1
@@ -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
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors