发明名称 |
Method for Mapping Between Virtual CPU and Physical CPU and Electronic Device |
摘要 |
A method for mapping between a virtual central processing unit (CPU) and a physical CPU. The method includes obtaining, by a virtual machine manager, a set of to-be-mapped first virtual CPUs in a current time period and a first physical CPU that has fewest to-be-run tasks, obtaining, by the virtual machine manager, a first characteristic value of each first virtual CPU in the set of first virtual CPUs and a second characteristic value of the first physical CPU, obtaining, by the virtual machine manager from all the first characteristic values, a target characteristic value that matches the second characteristic value, and mapping a target virtual CPU corresponding to the target characteristic value to the first physical CPU for running. By means of the foregoing technical solutions, resource contention and a decrease in overall system performance are avoided when mapping a virtual CPU to a physical CPU. |
申请公布号 |
US2017090962(A1) |
申请公布日期 |
2017.03.30 |
申请号 |
US201615375919 |
申请日期 |
2016.12.12 |
申请人 |
Huawei Technologies Co., Ltd. |
发明人 |
Li Jian;Guan Haibing;Gu Qiang |
分类号 |
G06F9/455;G06F13/42 |
主分类号 |
G06F9/455 |
代理机构 |
|
代理人 |
|
主权项 |
1. A method for mapping between a virtual central processing unit (CPU) and a physical CPU, wherein the method is applied to a multi-core system, wherein the multi-core system comprises at least two physical CPUs, a virtual machine manager, and at least one virtual machine, wherein the at least one virtual machine comprises at least two virtual CPUs, wherein the method comprises:
obtaining, by the virtual machine manager, a set of to-be-mapped first virtual CPUs from the at least two virtual CPUs in a current time period; obtaining, from the at least two physical CPUs, a first physical CPU that has fewest to-be-run tasks; obtaining, by the virtual machine manager, a first characteristic value of each first virtual CPU in the set of first virtual CPUs and a second characteristic value of the first physical CPU, wherein the first characteristic value of each first virtual CPU represents a characteristic of a physical CPU to which the first virtual CPU is mapped in a previous time period, and wherein the second characteristic value represents a characteristic of the first physical CPU in the previous time period; obtaining, by the virtual machine manager from all the first characteristic values, a target characteristic value that matches the second characteristic value; and mapping a target virtual CPU corresponding to the target characteristic value to the first physical CPU for running. |
地址 |
Shenzhen CN |