Prechádzať zdrojové kódy

KVM: cpu_relax() during spin waiting for reboot

It doesn't really matter, but if we spin, we should spin in a more relaxed
manner.  This way, if something goes wrong at least it won't contribute to
global warming.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Avi Kivity 14 rokov pred
rodič
commit
624d84cfe6
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      virt/kvm/kvm_main.c

+ 1 - 1
virt/kvm/kvm_main.c

@@ -2022,7 +2022,7 @@ asmlinkage void kvm_handle_fault_on_reboot(void)
 		/* spin while reset goes on */
 		local_irq_enable();
 		while (true)
-			;
+			cpu_relax();
 	}
 	/* Fault while not rebooting.  We want the trace. */
 	BUG();