Re: [patch 2/2] QEMU: decrease console "refresh rate" with -nographic

Marcelo Tosatti
2008-04-15T15:12:02Z

On Tue, Apr 15, 2008 at 08:40:09AM -0500, Anthony Liguori wrote:
> Avi Kivity wrote:
> >Anthony Liguori wrote:
> >>
> >>BTW, when we set O_ASYNC on the tap fd, we're eliminating
> >>O_NONBLOCK. This means that we have to poll loop select() when
> >>readv()'ing packets instead of just reading until hitting AGAIN.
> >>This means at least an extra syscall per packet.

Yeah, I noticed that problem too.

> >
> >I didn't know that O_ASYNC and O_NONBLOCK were mutually exclusive.
> >Can you point me at the relevant documentation?
>
> I don't know that they are, but we're doing an:
>
> fcntl(fd, F_SETFL, O_ASYNC);
>
> F_SETFL is not additive so the previous O_NONBLOCK gets dropped.

Fortunately read() will only be issued for the tap fd when select()
returns with its fd set.

And when that happens there is always a packet available for reading...