# US 2014/0208318 A1 · Method and Apparatus for Adjusting I/O Channel on Virtual Platform

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2014/0208318 A1
- Document ID: US20140208318A1
- Status: Published application
- Kind: A1
- Application number: 14/108,804
- Filed: 2013-12-17
- Published: 2014-07-24
- Earliest claimed: 2013-01-24
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Jie Zhang; Xin Jin
- Web page: https://patentgrep.com/patent/US20140208318A1

## CPC

- G06F 9/45533: {Hypervisors; Virtual machine monitors}
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 3/0613: {in relation to throughput}
- G06F 3/0659: {Command handling arrangements, e.g. command buffers, queues, command scheduling}
- G06F 3/0662: {Virtualisation aspects}
- G06F 3/0673: {Single storage device}
- G06F 9/45529: {Embedded in an application, e.g. JavaScript in a Web browser}
- G06F 9/5066: {Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs (mappping at compile time, see G06F8/451)}
- G06F 9/5083: {Techniques for rebalancing the load in a distributed system}
- G06F 2009/45579: {I/O management, e.g. providing access to device drivers or storage}
- G06F 2209/5018: Thread allocation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and an apparatus for adjusting an input/output (I/O) channel on a virtual platform, and the method for adjusting an I/O channel includes: counting, by a host, current average I/O throughput of multiple virtual machines (VMs) operating on the host; increasing or decreasing, by the host, working threads for processing the VMs between front devices and back devices of the multiple VMs according to the current average I/O throughput; and adjusting, by the host, a mapping relationship between queues in the front device, queues in the back devices of the multiple VMs, and working threads for processing the VMs. According to the present invention, when the I/O throughput decreases, idle I/O channel resources are released, thereby avoiding a waste of the I/O channel resources; when the I/O throughput increases, the I/O channel resources are increased, resulting in an improved data transmission capability of the I/O channels.

## Claims

### Claim 1

A method for adjusting an input/output (I/O) channel on a virtual platform, comprising:
counting, by a host, a current average I/O throughput of a plurality of virtual machines (VMs) operating on the host;
increasing, by the host, working threads for processing VMs between a plurality of front devices and a plurality of back devices of the VMs when the current average I/O throughput is greater than a first threshold value, wherein the current average I/O throughput of the VMs is less than the first threshold value after the working threads are increased;
decreasing, by the host, working threads for processing the VMs between the front devices and back devices of the VMs when the current average I/O throughput is less than a second threshold value, wherein the current average I/O throughput of the VMs is greater than the second threshold value after the working threads are decreased, wherein the first threshold value is greater than the second threshold value; and
separately adjusting, by the host, according to working threads for processing the VMs after the increase or decrease, a mapping relationship between queues in the front devices of the VMs and working threads for processing the VMs, and a mapping relationship between queues in the back devices of the VMs and working threads for processing the VMs, wherein a plurality of data transmission channels are formed between the front devices and the back devices of the VMs.

### Claim 2 (depends on 1)

The method according to claim 1, wherein when the current average I/O throughput is greater than the first threshold value and before the increasing, by the host, a working thread for processing the VMs between the front devices and the back devices of the VMs, the method further comprises:
comparing, by the host, an increase in a central processing unit (CPU) utilization and an increase in an I/O throughput resulting from increasing working threads for processing the VMs between the front devices and the back devices of the VMs; and
executing the step of increasing, by the host, working threads for processing the VMs between the front devices and the back devices of the VMs when the increase in the I/O throughput is greater than the increase in CPU utilization.

### Claim 3 (depends on 1)

The method according to claim 1, wherein when the current average I/O throughput is less than the second threshold value and before the decreasing, by the host, working threads for processing the VMs between the front devices and the back devices of the VMs, the method further comprises:
determining, by the host, whether a decrease in a central processing unit (CPU) utilization resulting from decreasing working threads between the front devices and the back devices of the VMs leads to an inability to respond to the throughput of the VMs; and
executing the step of decreasing working threads between the front devices and the back devices of the VMs when the decrease in the CPU utilization resulting from decreasing working threads between the front devices and the back devices of the VMs does not lead to an inability to respond to the throughput of the VMs.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the separately adjusting, by the host, according to working threads for processing the VMs after the increase or decrease, a mapping relationship between queues in the front devices of the VMs and the working threads for processing the VMs, and between queues in the back devices of the VMs and the working threads for processing the VMs comprises:
mapping, by the host, each working thread to a queue in the front device of each VM and the queue in a back device of each VM when the number of working threads for processing VMs after the increase or decrease is less than a number of VMs operating on the host; and
mapping, by the host, an exclusive working thread to the queue in the front device and the queue in the back device of the VM, and mapping a shared working thread to queues, which are in the front devices and the back devices of at least two VMs and do not correspond to the exclusive working thread when the number of working threads for processing the VMs after the increase or decrease is greater than or equal to the number of VMs operating on the host, and
wherein the working threads for processing VMs comprise the exclusive working thread and the shared working thread.

### Claim 5 (depends on 1)

The method according to claim 1, wherein after the separately adjusting, by the host, according to working threads for processing the VMs after the increase or decrease, the mapping relationship between queues in the front devices of the VMs and the working threads for processing the VMs, and a mapping relationship between queues in the back devices of the VMs and working threads for processing the VMs, the method further comprises adjusting, by the host, a mapping relationship between queues in the back devices of the VMs and queues in a native device of the host, wherein a plurality of data transmission channels are formed between the back devices of the VMs and the Native Device.

### Claim 6

An apparatus for adjusting an input/output (I/O) channel on a virtual platform, comprising:
a counting module configured to count a current average I/O throughput of a plurality of virtual machines (VMs) operating on a host;
a processing module, which is connected to the counting module configured to:
increase working threads for processing VMs between front devices and back devices of the VMs when the current average I/O throughput counted by the counting module is greater than a first threshold value, wherein the current average I/O throughput of the VMs is less than the first threshold value after the working threads are increased; and
decrease working threads for processing the VMs between the front devices and the back devices of the VMs when the current average I/O throughput counted by the counting module is less than a second threshold value, wherein the current average I/O throughput of the VMs is greater than the second threshold value after the working threads are decreased, wherein the first threshold value is greater than the second threshold value; and
a first adjusting module, which is connected to the processing module configured to separately adjust, according to working threads for processing the VMs after the increase or decrease by the processing module, a mapping relationship between queues in the front devices of the VMs and working threads for processing the VMs, and a mapping relationship between queues in the back devices of the VMs and working threads for processing the VMs, wherein a plurality of data transmission channels are formed between the front devices and the back devices of the VMs.

### Claim 7 (depends on 6)

The adjusting apparatus according to claim 6, further comprising:
a determining module configured to compare an increase in a central processing unit (CPU) utilization and an increase in an I/O throughput resulting from increasing working threads for processing the VMs between the front devices and the back devices of the VMs when the current average I/O throughput counted by the counting module is greater than the first threshold value; wherein
the processing module is further configured to increase working threads for processing the VMs between the front devices and the back devices of the VMs when the determining module determines the increase in the I/O throughput is greater than the increase in CPU utilization, wherein the current average I/O throughput of the VMs is less than the first threshold after the working threads are increased.

### Claim 8 (depends on 6)

The adjusting apparatus according to claim 6, further comprising a determining module configured to determine whether a decrease in the CPU utilization resulting from decreasing working threads between the front devices and the back devices of the VMs leads to an inability to respond to the throughput of the VMs when the current average I/O throughput counted by the counting module is less than a second threshold value wherein the processing module is further configured to decrease working threads between the front devices and the back devices of the VMs when the determining module determines that the decrease in CPU utilization resulting from decreasing working threads between the front devices and the back devices of the VMs does not lead to an inability to respond to the throughput of the VMs, wherein the average I/O throughput of the VMs is greater than the second threshold value after the working threads are decreased.

### Claim 9 (depends on 6)

The adjusting apparatus according to claim 6, wherein the first adjusting module is configured to:
map each working thread to a queue in the front device of each of the VMs and a queue in the back device of each of the VMs when the number of working threads for processing the VMs after the increase or decrease is less than a number of VMs operating on the host; and
map an exclusive working thread to the queue in the front device and the queue in the back device of the VM, and map a shared working thread to the queues, which are in the front devices and the back devices of at least two VMs and do not correspond to the exclusive working thread when the number of working threads for processing the VMs after the increase or decrease is greater than or equal to the number of VMs operating on the host, and
wherein the working threads for processing the VMs comprise the exclusive working thread and the shared working thread.

### Claim 10 (depends on 6)

The adjusting apparatus according to claim 6, further comprising:
a second adjusting module configured to adjust a mapping relationship between queues in the back devices of the VMs and queues in a native device of the host, wherein a plurality of data transmission channels are formed between the back devices of the VMs and the Native Device.

### Claim 11

A host, comprising:
a native device;
a plurality of front devices and a plurality of back devices in a plurality of virtual machines (VMs) operating on the Native Device;
a data processing module between the front devices and the back devices of the multiple VMs; and
a bridge between the back devices of the multiple VMs and the Native Device;
wherein the data processing module is configured to:
count a current average I/O throughput of the VMs;
increase working threads for processing the VMs between the front devices and the back devices of the VMs when the current average I/O throughput is greater than a first threshold value, wherein the current average I/O throughput of the VMs is less than the first threshold value after the working threads are increased;
decrease working threads for processing the VMs between the front devices and the back devices of the VMs when the current average I/O throughput is less than a second threshold value, wherein the current average I/O throughput of the multiple VMs is greater than the second threshold value after the working threads are decreased, wherein the first threshold value is greater than the second threshold value; and
separately adjust a mapping relationship between queues in the front devices of the multiple VMs and working threads for processing the VMs, and a mapping relationship between the queues in the back devices of the multiple VMs and working threads for processing the VMs according to working threads for processing the VMs after the increase or decrease, wherein a plurality of data transmission channels are formed between the front devices and the back devices of the VMs.

### Claim 12 (depends on 11)

The host according to claim 11, wherein the data processing module is further configured to:
compare an increase in a central processing unit (CPU) utilization and an increase in an I/O throughput resulting from increasing working threads for processing the VMs between the front devices and the back devices of the VMs; and
increase working threads for processing the VMs between the front devices and the back devices of the multiple VMs when the determining module determines the increase in the I/O throughput is greater than the increase in the CPU utilization, wherein the current average I/O throughput of the VMs is less than the first threshold after the working threads are increased.

### Claim 13 (depends on 11)

The host according to claim 11, wherein the data processing module is further configured to:
determine whether a decrease in a central processing unit (CPU) utilization resulting from decreasing working threads between the front devices and the back devices of the VMs leads to an inability to respond to the throughput of the VMs; and
decrease working threads between the front devices and the back devices of the multiple VMs if the decrease in CPU utilization resulting from decreasing working threads between the front devices and the back devices of the multiple VMs does not lead to an inability to respond to the throughput of the VMs, wherein the current average I/O throughput of the multiple VMs is greater than the second threshold value after the working threads are decreased.
