KVM: use heuristic for fast VCPU lookup by id
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Thu, 5 Nov 2015 08:55:08 +0000 (09:55 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Mon, 30 Nov 2015 11:47:04 +0000 (12:47 +0100)
commitc896939f7cff767091b5d84587cd144e5d3613b7
tree33dedfeaca80a17888e1c3bf06a010cadf2ea759
parente09fefdeeb517ff653516dea8a882ce001e99237
KVM: use heuristic for fast VCPU lookup by id

Usually, VCPU ids match the array index. So let's try a fast
lookup first before falling back to the slow iteration.

Suggested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
include/linux/kvm_host.h