All of lore.kernel.org
 help / color / mirror / Atom feed
* WAIT vs. tickless kernel
@ 2007-10-31 15:49 Atsushi Nemoto
  2007-10-31 16:13 ` Ralf Baechle
  0 siblings, 1 reply; 10+ messages in thread
From: Atsushi Nemoto @ 2007-10-31 15:49 UTC (permalink / raw)
  To: linux-mips

On some CPUs, there is a small window in the idle task which might
cause a large latency to wakeup a process.

http://www.linux-mips.org/archives/linux-mips/2005-11/msg00114.html

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)
{
	local_irq_disable();
	if (!need_resched())
		__asm__(
		"	.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");
	local_irq_enable();
}

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

---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-11-11 17:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-31 15:49 WAIT vs. tickless kernel Atsushi Nemoto
2007-10-31 16:13 ` Ralf Baechle
2007-10-31 16:31   ` Atsushi Nemoto
2007-10-31 16:39     ` Ralf Baechle
2007-11-02 16:46       ` Atsushi Nemoto
2007-11-06 15:39         ` Atsushi Nemoto
2007-11-06 15:58           ` David Daney
2007-11-06 16:02             ` Atsushi Nemoto
2007-11-07 14:23           ` Atsushi Nemoto
2007-11-11 17:05           ` Atsushi Nemoto

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.