Project

General

Profile

Bug #12806

Serial console polling burns CPU on VMware

Added by Gordon Ross about 2 months ago. Updated about 2 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

After doing some debugging with a serial console recently (in a VM) I noticed that when the guest stops in the loader prompt or in kmdb the fan on the laptop (VM host) turns on blowing out hot air. A quick look at the hypervisor stats show that, indeed, the guest is burning CPU.

I thought that odd, given that the serial configuration for the guest includes the special "yieldOnMsrRead" setting.
Here's the section of the guest's vmx file for the serial console:

serial0.fileType = "network" 
serial0.fileName = "telnet://10.1.2.3:5432" 
serial0.present = "TRUE" 
serial0.startConnected = "TRUE" 
serial0.yieldOnMsrRead = "TRUE" 

BTW, see helpful notes on this setup here:
https://github.com/jclulow/vmware-sercons

Investigation reveals that the "yieldOnMsrRead" feature depends upon the VM guest actually doing a read of the Modem Status Register (MSR) in polling loops where it waits for input. In short, our polling loops only read the Line Status Register (LSR) to find out if we can receive another character.
I found that simply inserting a read (actually, "inb()") of the MSR in those loops allows the VM guest to stop in these read loops without spinning up the fan in my laptop.

History

#1

Updated by Gordon Ross about 2 months ago

  • Category set to kernel
#2

Updated by Gordon Ross about 2 months ago

  • Subject changed from Serial console polling burns CPU to Serial console polling burns CPU on VMware

Also available in: Atom PDF