Skip to contentSkip to conversation

Project TO DO

Kernel-janitors Fabiano Pallonetto 2 participants 2 messages Jan 16, 2004 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Hi, I'm a student of Computer Science and I've to develop a little project in OS. I thought to do this:

" From: Matthew Wilcox
Subject: Calling yield() Considered Harmful

In 2.6, the semantics of calling yield() changed from "sleep for a bit" to "I really don't want to run for a while". This matches POSIX better, but there's a lot of drivers still using yield() when they mean cond_resched(), schedule() or even schedule_timeout().

Here's a list:

$ find drivers/ -type f |xargs grep 'yield[^a-z]*('
drivers/cdrom/cdu31a.c:         yield();
drivers/cdrom/sonycd535.c:              yield();
drivers/macintosh/adb.c:                        yield();
drivers/message/i2o/i2o_core.c:         yield();
drivers/message/i2o/i2o_core.c:         yield();
drivers/mtd/chips/cfi_cmdset_0002.c:                    yield();
drivers/mtd/nand/nand.c:                yield ();
drivers/net/depca.c:                    yield();
drivers/net/sb1000.c:           yield();
drivers/net/sb1000.c:           yield();
drivers/net/sis900.c:                   yield();
drivers/net/e100/e100_eeprom.c:                 yield();
drivers/net/e100/e100_eeprom.c:                 yield();
drivers/net/e100/e100_main.c:                   yield();
drivers/net/e100/e100_phy.c:                    yield();
drivers/net/e100/e100_phy.c:                            yield();
drivers/net/e100/e100_test.c:                   yield();
drivers/scsi/NCR5380.c:                 yield();
drivers/scsi/ibmmca.c:          yield();
drivers/scsi/ibmmca.c:          yield();
drivers/scsi/megaraid.c:                udelay(100); yield();
drivers/usb/core/message.c:                     yield ();

As always, this isn't a search-and-replace type of job. Let's take the first one as an example:

static inline void sony_sleep(void)

{
        unsigned long flags;

        if (cdu31a_irq <= 0) {
                yield();
        } else {                /* Interrupt driven */
                save_flags(flags);
                cli();
                enable_interrupts();
                interruptible_sleep_on(&cdu31a_irq_wait);
                restore_flags(flags);
        }
}

If you look at how sony_sleep() is typically used, what you really want to do is schedule_timeout(1). But someone needs to look at all these cases.. do I hear a volunteer?"

Has anyone smenthing intersting to suggest me? You know, I'm a newbie than I cannot face a too big one, especially in one semester. Thank you very much!

Signature · 6 lines
Fabiano Pallonetto <[email protected]>

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
#1 lore raw
Quoted 2 lines · Fabiano Pallonetto

[..]
drivers/net/sis900.c: yield();

if you want i can test this one on my laptop

Quoted 3 lines

Has anyone smenthing intersting to suggest me? You know, I'm a newbie than I cannot face a too big one, especially in one semester. Thank you very much!

until now i haven't heard of any volounteer, so go one, but please send to the list _one_ patch per file! then you' ll probably get more feedback ;-)

a++
maks

Signature · 4 lines
sidenote on stoned beavers out of detox aka linux-2.6.0:
"Linus Torvalds doesn't believe in kernel preemption. [..]
Avoiding kernel preemption makes the kernel simpler and more robust."
Moshe Bar - Linux Internals 2000

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