public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Best way to busy-wait for a virtio queue?
@ 2013-03-29 23:12 H. Peter Anvin
  2013-04-01 16:07 ` Eric Northup
  0 siblings, 1 reply; 2+ messages in thread
From: H. Peter Anvin @ 2013-03-29 23:12 UTC (permalink / raw)
  To: KVM

Is there any preferred way to busy-wait on a virtio event?  As in: the
guest doesn't have anything useful to do until something is plopped down
on the virtio queue, but would like to proceed as quickly as possible
after that.  Passing through an interrupt handler seems like unnecessary
overhead.

Right now I have a poll loop looking like (pseudocode):

outw(0, trigger);
while (readl(ring->output pointer) != final output pointer)
	cpu_relax();		/* x86 PAUSE instruction */

... but I have no idea how much sense that makes.


	-hpa

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

end of thread, other threads:[~2013-04-01 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-29 23:12 Best way to busy-wait for a virtio queue? H. Peter Anvin
2013-04-01 16:07 ` Eric Northup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox