[Top] [All Lists]

WAIT vs. tickless kernel

Subject: WAIT vs. tickless kernel
From: Atsushi Nemoto <>
Date: Thu, 01 Nov 2007 00:49:06 +0900 (JST)
Original-recipient: rfc822;
On some CPUs, there is a small window in the idle task which might
cause a large latency to wakeup a process.

This can be avoided on some CPUs which can use xxx_wait_irqoff(), but
still there are many CPUs out of luck.

And now we have dyntick/tickless kernel.  On tickless kernel the
problem might become more serious.  We cannot know the worst latency
time.  Theoretically a task can lose wakeup-event forever.

Of course "nowait" kernel option will help, but are there any other
good solutions?

Just an idea: If we put an WAIT in hazard area of the MTC0 which
enables interrupts, can we accomplish something like
atomic-test-and-wait operation?

void r4k_wait_bulletproof(void)
        if (!need_resched())
                "       .set    push            \n"
                "       .set    mips3           \n"
                "       .set    noat            \n"
                "       .align  4               \n" /* avoid stall on wait */
                "       mfc0    $1, $12         \n"
                "       ori     $1, 1           \n"
                "       mtc0    $1, $12         \n"
                "       wait                    \n"
                "       xori    $1, 1           \n"
                "       mtc0    $1, $12         \n"
                "       .set    pop             \n");

If this work as expected?  Comments from pipeline gurus are welcome ;)

Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>