IP Library › Granted Patent US 10,997,099
Granted Patent B2
US 10,997,099 · App. 16/167,197 · Granted May 4, 2021

I/O request processing method in virtual machine, device and computer readable medium

Inventors: Rui Zhao (Beijing, CN); Xun Ni (Beijing, CN); Yongji Xie (Beijing, CN)
Assignee: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD.
G06F13/20G06F9/4555G06F9/45558G06F2009/45579G06F2009/45583
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,997,099
App. No.
16/167,197
Granted
May 4, 2021
Kind
B2
Abstract

An I/O request processing method in a virtual machine, a device and a computer readable medium are provided. When a backend device of a Guest kernel begins to process an I/O request chain submitted by a frontend device of the Guest kernel into a shared I/O processing memory, the method obtains a starting position of the I/O request chain in the I/O processing memory; according to the starting position of the I/O request chain, sets an element corresponding to the starting position of the I/O request chain in an I/O state array as a value different from initial values of all positions; and upon finishing processing the I/O request chain, sets an element corresponding to the starting position of the I/O request chain in an I/O request state array as a value identical with initial values.

Claims (51)

1. An I/O request processing method in a virtual machine, wherein the method comprises:

when a backend device of a Guest kernel begins to process an I/O request chain submitted by a frontend device of the Guest kernel into a shared I/O processing memory, obtaining a starting position of the I/O request chain in the shared I/O processing memory;

according to the starting position of the I/O request chain, setting an element corresponding to the starting position of the I/O request chain in an I/O state array as a value different from initial values of all positions;

upon finishing processing the I/O request chain, setting the element corresponding to the starting position of the I/O request chain in the I/O state array as a value identical with initial values,

wherein after the step of, according to the starting position of the I/O request chain, setting an element corresponding to the starting position of the I/O request chain in an I/O state array as a value different from initial values of remaining positions, and before finishing processing the I/O request chain, the method further comprises:

after abnormality of the backend device of the Guest kernel suspends, and the backend device restarts and reconnects with the intermediate software layer Hypervisor, remapping an address space of the I/O state array and an address space of the I/O processing memory, to share the memory of the I/O state array with the intermediate software layer Hypervisor, and share the I/O processing memory with the frontend device of the Guest kernel;

obtaining, from the I/O request state array, the starting position of the I/O request chain processed when the abnormity suspends to re-process the I/O request chain in the I/O processing memory according to the starting position of the I/O request chain, and

wherein after obtaining, from the I/O request state array, the starting position of the I/O request chain processed when the abnormity suspends to re-process the I/O request chain in the I/O processing memory according to the starting position of the I/O request chain, the method further comprises:

obtaining, from the I/O processing memory, an index tag of a first already-completed I/O request chain;

according to the index tag of the first already-completed I/O request chain, resetting the index tag of the I/O request chain already submitted locally and an index tag of a second already-completed I/O request chain, to ensure normal processing of subsequent I/O request chain.

2. The method according to claim 1 , further comprises:

interacting with an intermediate software layer Hypervisor, and obtaining a handle of an I/O state array applied for by the intermediate software layer Hypervisor and a length of the I/O state array before setting an element corresponding to the starting position of I/O state array as a value different from initial values of all positions according to the starting position of the I/O request chain;

according to the handle of the applied-for I/O state array memory and the length of the I/O state array, mapping an address space of the I/O state array, to share a memory of the I/O state array with the intermediate software layer Hypervisor.

3. The method according to claim 1 , further comprises:

interacting with the intermediate software layer Hypervisor, and obtaining a handle of an I/O processing memory that is applied for by the intermediate software layer Hypervisor, a length of the I/O processing memory and a starting position of a virtual request queue in the I/O processing memory before the backend device of the Guest kernel beginning to process an I/O request chain submitted by a frontend device of the Guest kernel into a shared I/O processing memory;

according to the handle of the applied-for I/O processing memory, the length of the I/O processing memory and the starting position of the virtual request queue in the I/O processing memory, mapping an address space of the I/O processing memory to share the I/O processing memory of the frontend device of the Guest kernel.

4. A computer device, wherein the computer device comprises:

one or more processors,

a storage for storing one or more programs,

the one or more programs, when executed by said one or more processors, enable said one or more processors to implement an I/O request processing method in a virtual machine, wherein the I/O request processing method comprises:

when a backend device of a Guest kernel begins to process an I/O request chain submitted by a frontend device of the Guest kernel into a shared I/O processing memory, obtaining a starting position of the I/O request chain in the I/O processing memory;

according to the starting position of the I/O request chain, setting an element corresponding to the starting position of the I/O request chain in an I/O state array as a value different from initial values of all positions;

upon finishing processing the I/O request chain, setting the element corresponding to the starting position of the I/O request chain in the I/O state array as a value identical with initial values,

wherein after the step of, according to the starting position of the I/O request chain, setting an element corresponding to the starting position of the I/O request chain in an I/O state array as a value different from initial values of remaining positions, and before finishing processing the I/O request chain, the method further comprises:

after abnormality of the backend device of the Guest kernel suspends, and the backend device restarts and reconnects with the intermediate software layer Hypervisor, remapping an address space of the I/O state array and an address space of the I/O processing memory, to share the memory of the I/O state array with the intermediate software layer Hypervisor, and share the I/O processing memory with the frontend device of the Guest kernel;

obtaining, from the I/O request state array, the starting position of the I/O request chain processed when the abnormity suspends to re-process the I/O request chain in the I/O processing memory according to the starting position of the I/O request chain, and

wherein after obtaining, from the I/O request state array, the starting position of the I/O request chain processed when the abnormity suspends to re-process the I/O request chain in the I/O processing memory according to the starting position of the I/O request chain, the method further comprises:

obtaining, from the I/O processing memory, an index tag of a first already-completed I/O request chain;

according to the index tag of the first already-completed I/O request chain, resetting the index tag of the I/O request chain already submitted locally and an index tag of a second already-completed I/O request chain, to ensure normal processing of subsequent I/O request chain.

5. The computer device according to claim 4 , the I/O request processing method further comprises:

interacting with an intermediate software layer Hypervisor, and obtaining a handle of an I/O state array applied for by the intermediate software layer Hypervisor and a length of the I/O state array before the step of, according to the starting position of the I/O request chain, setting an element corresponding to the starting position of the I/O request chain in an I/O state array as a value different from initial values of all positions;

according to the handle of the applied-for I/O state array memory and the length of the I/O state array, mapping an address space of the I/O state array, to share a memory of the I/O state array with the intermediate software layer Hypervisor.

6. The computer device according to 4 , the I/O request processing method further comprises:

interacting with the intermediate software layer Hypervisor, and obtaining a handle of an I/O processing memory that is applied for by the intermediate software layer Hypervisor, a length of the I/O processing memory and a starting position of a virtual request queue in the I/O processing memory before the backend device of the Guest kernel beginning to process an I/O request chain submitted by a frontend device of the Guest kernel into a shared I/O processing memory;

according to the handle of the applied-for I/O processing memory, the length of the I/O processing memory and the starting position of the virtual request queue in the I/O processing memory, mapping an address space of the I/O processing memory to share the I/O processing memory of the frontend device of the Guest kernel.

7. A non-transitory computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements an I/O request processing method in a virtual machine, wherein the I/O request processing method comprises:

when a backend device of a Guest kernel begins to process an I/O request chain submitted by a frontend device of the Guest kernel into a shared I/O processing memory, obtaining a starting position of the I/O request chain in the I/O processing memory;

according to the starting position of the I/O request chain, setting an element corresponding to the starting position of the I/O request chain in an I/O state array as a value different from initial values of all positions;

upon finishing processing the I/O request chain, setting the element corresponding to the starting position of the I/O request chain in the I/O state array as a value identical with initial values,

wherein after the step of, according to the starting position of the I/O request chain, setting an element corresponding to the starting position of the I/O request chain in an I/O state array as a value different from initial values of remaining positions, and before finishing processing the I/O request chain, the method further comprises:

after abnormality of the backend device of the Guest kernel suspends, and the backend device restarts and reconnects with the intermediate software layer Hypervisor, remapping an address space of the I/O state array and an address space of the I/O processing memory, to share the memory of the I/O state array with the intermediate software layer Hypervisor, and share the I/O processing memory with the frontend device of the Guest kernel;

obtaining, from the I/O request state array, the starting position of the I/O request chain processed when the abnormity suspends to re-process the I/O request chain in the I/O processing memory according to the starting position of the I/O request chain, and

wherein after obtaining, from the I/O request state array, the starting position of the I/O request chain processed when the abnormity suspends to re-process the I/O request chain in the I/O processing memory according to the starting position of the I/O request chain, the method further comprises:

obtaining, from the I/O processing memory, an index tag of a first already-completed I/O request chain;

according to the index tag of the first already-completed I/O request chain, resetting the index tag of the I/O request chain already submitted locally and an index tag of a second already-completed I/O request chain, to ensure normal processing of subsequent I/O request chain.

8. The non-transitory computer readable medium according to claim 7 , the I/O request processing method further comprises:

interacting with an intermediate software layer Hypervisor, and obtaining a handle of an I/O state array applied for by the intermediate software layer Hypervisor and a length of the I/O state array according to the starting position of the I/O request chain, setting an element corresponding to the starting position of the I/O request chain in an I/O state array as a value different from initial values of all positions;

according to the handle of the applied-for I/O state array memory and the length of the I/O state array, mapping an address space of the I/O state array, to share a memory of the I/O state array with the intermediate software layer Hypervisor.

9. The non-transitory computer device according to 7 , the I/O request processing method further comprises:

interacting with the intermediate software layer Hypervisor, and obtaining a handle of an I/O processing memory that is applied for by the intermediate software layer Hypervisor, a length of the I/O processing memory and a starting position of a virtual request queue in the I/O processing memory before the backend device of the Guest kernel beginning to process an I/O request chain submitted by a frontend device of the Guest kernel into a shared I/O processing memory;

according to the handle of the applied-for I/O processing memory, the length of the I/O processing memory and the starting position of the virtual request queue in the I/O processing memory, mapping an address space of the I/O processing memory to share the I/O processing memory of the frontend device of the Guest kernel.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 24, 2021
From: ZHAO, RUI; NI, XUN; XIE, YONGJI
To: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD.
Reel/Frame 055703/0459 →
Priority Claims (1)
CN 201711018956.4 · Oct 26, 2017 · national
Continuity (1)
Related Publication 20190129873A1 · May 2, 2019
Cited By (1)
US 12,346,718