Description of problem: From xen tools/xenfb/sdlfb.c: + /* + * We need to wait for fds becoming ready or SDL events to + * arrive. We time out the select after 10ms to poll for SDL + * events. Clunky, but works. Could avoid the clunkiness + * with a separate thread. + */ + for (;;) { + FD_ZERO(&readfds); + nfds = xenfb_select_fds(xenfb, &readfds); + tv = (struct timeval){0, 10000}; + + if (select(nfds, &readfds, NULL, NULL, &tv) < 0) { + if (errno == EINTR) + continue; + fprintf(stderr, + "Can't select() on event channel (%s)\n", + strerror(errno)); + break; + } while (SDL_PollEvent(&event)) { This leaves us polling things every 10ms, forever, even on idle guests. It's not too hard to create a helper thread to wait on non-selectable event sources, and to pass events back via a pipe; longer term, we should make sure we fix sdlfb in such a way.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
This request was previously evaluated by Red Hat Product Management for inclusion in the current Red Hat Enterprise Linux release, but Red Hat was unable to resolve it in time. This request will be reviewed for a future Red Hat Enterprise Linux release.
Created attachment 217981 [details] Patch to convert the sdlfb busy looping with a thread implementation This is a patch to replace the busy loop in sdlfb with a thread and a pipe. I might have been a little pedantic on the locking in here; I wasn't quite sure if xenfb could be changed by both threads at the same time, so I went very cautiously and locked every time I accessed it. I'll have to look into it a little more, and possibly take some of the locking away (or remove it altogether if I can convince myself the two threads don't change the same part of the xenfb structure). Chris Lalancette
The consensus on virtualist seems to be that this is not worth pursuing; few customers are using SDL, even fewer would even notice the busy wait, and upstream is going to be getting rid of sdlfb in favor of a merged Qemu solution. I'm going to close this as WONTFIX. Chris Lalancette