CN105389133B - A kind of driving method and driver of virtual memory - Google Patents
A kind of driving method and driver of virtual memory Download PDFInfo
- Publication number
- CN105389133B CN105389133B CN201510872174.1A CN201510872174A CN105389133B CN 105389133 B CN105389133 B CN 105389133B CN 201510872174 A CN201510872174 A CN 201510872174A CN 105389133 B CN105389133 B CN 105389133B
- Authority
- CN
- China
- Prior art keywords
- memory sharing
- region
- driver
- sharing region
- request
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Multi Processors (AREA)
Abstract
The present invention provides a kind of driving method and driver of virtual memory, is related to computer realm, can improve the read or write speed of virtual machine.Concrete scheme is:Back driver reads I/O Request from the first memory sharing region, and the I/O Request is the I/O Request that FED(front end driver) is stored in first memory sharing region;The I/O Request is sent to primary driver, and receives the IO responses that the primary driver returns;The clear position that the IO is responded to the second memory sharing region of deposit, in order to which the FED(front end driver) reads the IO responses from second memory sharing region.The present invention is for driving virtual memory.
Description
Technical field
The present invention relates to the driving methods and driver of computer realm more particularly to a kind of virtual memory.
Background technology
Virtual machine monitor (full name in English:Virtual Machine Monitor, English abbreviation:VMM it) and is referred to as
For virtual machine supervisory process (full name in English:Hypervisor), by being virtualized to computer hardware resource, allow one
Create multiple virtual machines on platform physical computer, be separately operable multiple and different or identical operating system, each operating system it
The upper respective application program of independent operating.
Existing VMM provides the read-write service to physical storage usually by way of event notice to virtual machine.With
For Xen virtual machine monitors, the FED(front end driver) (full name in English of virtual machine:Front-end driver) it will be to virtually depositing
Input/output (the full name in English of reservoir:Input Output, English abbreviation:IO) request deposit FED(front end driver) and rear end are driven
Dynamic device (full name in English:Back-end driver) shared drive, then call Hypercall Service Notification back drivers,
Back driver is asked to handle I/O Request.Back driver reads I/O Request from shared drive, passes through the primary of physical storage
Driver (full name in English:Native driver) to physical storage be written and read operation after obtain IO response.Back driver
IO is responded into deposit shared drive, Hypercall Service Notifications FED(front end driver) is then called to read IO responses from shared drive.
I/O Request is sent out to the time interval for receiving IO responses from virtual machine, represents the read or write speed of virtual machine, it should
Time interval is shorter to indicate that the read or write speed of virtual machine is faster.As physical storage performance constantly improves, at physical storage
The speed for managing I/O Request is continuously improved, therefore the read or write speed of virtual machine is also improved.However, in FED(front end driver) with after
During holding driver to carry out data interaction, the time for calling Event Notification Service itself spent is but that restriction is virtual always
The bottleneck of machine-readable writing rate.
Invention content
The application provides a kind of driving method and driver of virtual memory, can improve the read-write speed of virtual machine
Degree.
In order to achieve the above objectives, the application adopts the following technical scheme that:
In a first aspect, the application provides a kind of driving method of virtual memory, FED(front end driver) and back driver
Shared data ring (full name in English:Ring) include the first memory sharing region and the second memory sharing region.Wherein, the first memory
Shared region is for storing I/O Request, and the second memory sharing region is for storing IO responses.FED(front end driver) is from virtual machine operations
After system receives I/O Request, I/O Request is stored in the clear position in the first memory sharing region.Back driver is from first
I/O Request is read in memory sharing region, and I/O Request is sent to primary driver, and receives the IO responses that primary driver returns.
Back driver determines the whether available free position in the second memory sharing region, when determining the second available free position in memory sharing region
When, IO is responded to the clear position in the second memory sharing region of deposit, FED(front end driver) reads IO from the second memory sharing region
Response.
First memory sharing region is stored in I/O Request for storing I/O Request, FED(front end driver) to the first memory sharing region
Afterwards, back driver actively reads I/O Request from the first memory sharing region.Second memory sharing region is responded for storing IO,
After back driver is responded to the second memory sharing region deposit IO, FED(front end driver) is actively read from the second memory sharing region
IO is responded.Event notice is needed not move through between FED(front end driver) and back driver, data exchange process can be completed, eliminate
The time spent by Event Notification Service is called, the read or write speed of virtual machine is which thereby enhanced.
With reference to first aspect, in the first realization method, the first memory sharing of back driver cycle detection region
Occupancy situation, when the first memory sharing region is in busy state, i.e., once there is I/O Request to be stored in the first memory sharing area
When domain, back driver reads I/O Request from the first memory sharing region.Back driver is by way of cycle detection, actively
The I/O Request being stored in the first memory sharing region is read, because carrying out event notice without FED(front end driver).
The first realization method with reference to first aspect, in second of realization method, FED(front end driver) cycle detection
The occupancy situation in two memory sharing regions, when the second memory sharing region is in busy state, from the second memory sharing area
Read IO responses in domain.FED(front end driver) is actively read and is stored in the second memory sharing region by way of cycle detection
IO is responded, because carrying out event notice without back driver.
With reference to first aspect to second of realization method of first aspect, in the third realization method, back driver
Or one of FED(front end driver) sends the second instruction message to other side, by the second instruction message into other side's instruction first
Deposit the address range of shared region and the second memory sharing region.Therefore back driver and FED(front end driver) can be through consultation
Mode determine the first memory sharing region and the second memory sharing regional location and size.Further, back driver
It can be by repeatedly sending second instruction message pair the first memory sharing region and the second memory sharing region with FED(front end driver)
Address range carry out dynamic configuration.
Second aspect, a kind of FED(front end driver) of the application offer and back driver, are carried for executing first aspect
The driving method of the virtual memory of confession.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, embodiment will be described below
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description be only the present invention some
Embodiment for those of ordinary skill in the art without creative efforts, can also be attached according to these
Figure obtains other attached drawings.
Fig. 1 is the configuration diagram of the virtual machine system based on VMM;
A kind of driving method flow chart for virtual memory that Fig. 2 is provided by the embodiment of the present invention;
Fig. 3 is the configuration diagram of virtual domain system under Xen platforms;
Fig. 4 is the schematic diagram of data exchange process between FED(front end driver) and back driver in the prior art;
Fig. 5 is the schematic diagram of data exchange process between FED(front end driver) and back driver in the embodiment of the present invention;
A kind of structural schematic diagram for back driver that Fig. 6 is provided by the embodiment of the present invention;
The structural schematic diagram for another back driver that Fig. 7 is provided by the embodiment of the present invention;
A kind of structural schematic diagram for FED(front end driver) that Fig. 8 is provided by the embodiment of the present invention;
The structural schematic diagram for another FED(front end driver) that Fig. 9 is provided by the embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
For the ease of clearly describing the technical solution of the embodiment of the present invention, in an embodiment of the present invention, use " the
One ", the printed words such as " second " distinguish function and the essentially identical identical entry of effect or similar item, and those skilled in the art can
To understand that the printed words such as " first ", " second " are not to be defined to quantity and execution order.
The embodiment of the present invention provides a kind of driving method and driver of virtual memory, is applied to as shown in Figure 1
Virtual machine system in, virtual machine system includes computer hardware platforms, VMM and establishes an at least void on VMM
Quasi- machine (full name in English:Virtual Machine, English abbreviation:VM).
Wherein, computer hardware platforms include processor, memory, can further include the objects such as input-output equipment
Manage resource.
VMM is to operate in the management program virtualized to hardware resource in computer hardware platforms, usually also referred to as
Virtual machine supervisory process (full name in English:Hypervisor).VMM is virtualized by the resource to computer hardware platforms,
Permission creates an at least virtual machine in computer hardware platforms.
VMM includes primary driver (full name in English:Native driver) and back driver (full name in English:
Back-end driver), virtual machine includes FED(front end driver).
FED(front end driver) is the driver of itself virtual resource of the operating system access virtual machine of virtual machine, primary driver
For the driving of computer hardware resource, back driver provides the interface for accessing primary driver for FED(front end driver).It is different
Virtual machine can only access respective virtual resource, when the virtual resource of the operating system access of virtual machine virtual machine
When, the FED(front end driver) of the virtual machine asks primary driver to access computer hardware resource by back driver.
VMM allows more virtual machines to be communicated with back driver by respective FED(front end driver), and back driver is asked again
Primary driver is asked to access computer hardware resource, to achieve the purpose that more virtual machine Sharing computer hardware resources.
Virtual machine includes operating system and application program.The operating system of different virtual machine can be different, can also phase
Together.When the operating system of virtual machine accesses its virtual memory by its FED(front end driver), FED(front end driver) sends I/O Request
To back driver, back driver accesses physical storage by primary driver, and forward end driver returns to IO responses.
In the embodiment of the present invention, the driving method and driver of virtual memory are illustrated in conjunction with Xen platforms.
Certainly, this is not offered as the driving method for the virtual memory that the embodiment of the present invention is provided and driver is only applicable to
Xen platforms.The present invention does not limit specific VMM types.
Embodiment
The embodiment of the present invention provides a kind of driving method of virtual memory, with reference to shown in Fig. 2, includes the following steps:
201, FED(front end driver) receives I/O Request.
In conjunction with shown in Fig. 3, the virtual machine in Xen platforms is known as virtual Domain (English name:Domain), wherein virtual Domain 0
Equipment driving domain, for providing the management function to computer hardware resource, virtual Domain 0 includes that primary driver and rear end drive
Device, virtual Domain 0 have the direct access right to computer hardware resource.The common virtual domain of user usually only includes front-end driven
Device, virtual Domain 1 as shown in Figure 3.Common virtual domain cannot directly access computer hardware resource, the behaviour in common virtual domain
When making the virtual resource in system access domain, operating system forward end driver sends the request for accessing virtual resource, and front end is driven
Back driver in dynamic device request virtual Domain 0 accesses computer hardware resource.
In the embodiment of the present invention, FED(front end driver) is specifically as follows the front-end driven in the common virtual domain of Xen platforms
Device, back driver are the back driver in the equipment driving domain of Xen platforms.
When virtual memory in common virtual domain browsing domain, forward end driver sends I/O Request.FED(front end driver) institute
The I/O Request received can be that I/O Request that the application program in virtual Domain is sent out or virtual Domain operating system are sent out
The I/O Request gone out.
202, I/O Request is stored in the clear position in the first memory sharing region by FED(front end driver).
FED(front end driver) and back driver carry out the process of data interaction as shown in figure 4, shared data in the prior art
Ring (English name:Ring) 401 shared drive between FED(front end driver) and back driver.It drives the front end in common virtual domain
Then I/O Request deposit shared data ring 401 is called Hypercall Service Notifications No. 0 virtual Domain of back driver by dynamic device
Back driver, request back driver handle I/O Request.Back driver reads I/O Request from shared data ring 401, passes through
Primary driver (full name in English:Native driver) to physical storage be written and read operation after obtain IO response.It drives rear end
IO is responded deposit shared data ring 401 by dynamic device, then calls the FED(front end driver) in Hypercall Service Notification common virtuals domain
IO responses are read from shared data ring 401.
In the embodiment of the present invention, shared data ring includes the first memory sharing region 501 and the second memory sharing region
502.Wherein the first memory sharing region 501 is the memory block for storing I/O Request, the second memory sharing in shared data ring
Region 502 is the memory block for storing IO responses in shared data ring.
Optionally, the first memory sharing region 501 and the second memory sharing region 502 can be to FED(front end driver) and after
The shared data ring of end driver divide obtained two shared regions, in the first memory sharing region 501 and second
The size for depositing shared region 502 can be preset value, such as respectively account for the half of shared data ring size.First memory sharing region
After being determined by FED(front end driver) or back driver with the address range in the second memory sharing region, notified to other side.
For example, back driver divides the capacity of shared data ring according to presetting ratio, by the first memory sharing region
FED(front end driver) is sent to by the first instruction message with the address range in the second memory sharing region.Or FED(front end driver) pair
The capacity of shared data ring is divided, and the address range in the first memory sharing region and the second memory sharing region is passed through
Two instruction messages are sent to FED(front end driver).
Preferably, in conjunction with shown in Fig. 5, the first memory sharing region 501 and the second memory sharing region 502 can be will be preceding
End driver and the shared data ring of back driver carry out splitting obtained two independent shared data rings.It is driven by front end
Dynamic device or back driver are completed after splitting, and are notified to other side, and it is in first that instruction, which splits one of gained data ring,
Shared region 501 is deposited, another data ring is the second memory sharing region 502.
After FED(front end driver) receives I/O Request, I/O Request is stored in the clear position in the first memory sharing region 501.
Optionally, the occupancy situation in the first memory sharing of FED(front end driver) pair region 501 carries out continuing monitoring, when receiving
When I/O Request, however, it is determined that 501 available free position of the first memory sharing region, i.e. the first memory sharing region 501 be not complete
It occupies, then I/O Request is stored in the clear position in the first memory sharing region 501.
Or FED(front end driver) carries out the occupancy situation in the first memory sharing region 501 after receiving I/O Request
I/O Request is stored in the free time in the first memory sharing region 501 by detection if 501 available free position of the first memory sharing region
Position.
First memory sharing region 501 can store multiple I/O Requests, incomplete in the first memory sharing region 501
In the case of occupancy, more than one I/O Request received can be stored in the first memory sharing region 501 by FED(front end driver)
Clear position.
203, back driver reads I/O Request from the first memory sharing region.
The occupancy situation in the first memory sharing of back driver cycle detection region 501, when the first memory sharing region 501
When in busy state, i.e., when thering is I/O Request to be stored in the first memory sharing region 501, just from the first memory sharing region
501 read I/O Request.Back driver is after reading I/O Request, by the I/O Request read from the first memory sharing region
501 delete.
FED(front end driver) is constantly stored in I/O Request to the clear position in the first memory sharing region 501, and back driver is not
It is disconnected to read I/O Request from the first memory sharing region 501, and the I/O Request read is deleted from the first memory sharing region 501
It removes, the occupied space dynamic change in the first memory sharing region 501.
In conjunction with step 202, in the case that the first memory sharing region 501 is otherwise fully engaged, FED(front end driver) determines first
Memory sharing region 501 does not have clear position, then waits for when the first 501 available free position of memory sharing region, then by IO
Request deposit clear position.
204, I/O Request is sent to primary driver by back driver, and receives the IO responses that primary driver returns.
Primary driver is the driver for directly accessing computer hardware resource, and IO is sent to primary drive by back driver
Dynamic device, primary driver are written and read operation to physical storage, and rear end driver returns to IO responses.Wherein, physical store
Device can be magnetic media memory or solid state disk etc..
205, IO is responded the clear position in the second memory sharing region of deposit by back driver.
Optionally, the occupancy situation in the second memory sharing of back driver pair region 502 carries out continuing monitoring, when from primary
When driver receives IO responses, if 502 available free position of the second memory sharing region, i.e. the second memory sharing region 502 do not have
It is otherwise fully engaged, then IO is responded to the clear position in the second memory sharing region 502 of deposit.
Or back driver from primary driver receive IO response after, to accounting for for the second memory sharing region 502
It is detected with situation, if 502 available free position of the second memory sharing region, IO is responded into the second memory sharing region of deposit
502 clear position.
Second memory sharing region 502 can store multiple IO responses, incomplete in the second memory sharing region 502
In the case of occupancy, more than one IO received can be responded the second memory sharing region 502 of deposit by back driver
Clear position.
206, FED(front end driver) reads IO responses from the second memory sharing region.
The occupancy situation in the second memory sharing of FED(front end driver) cycle detection region 502, when the second memory sharing region 502
When in busy state, i.e., when having response the second memory sharing regions 502 of deposit IO, just from the second memory sharing region
502 read IO responses.FED(front end driver) responds the IO read from the second memory sharing region after reading IO responses
502 delete.
In conjunction with step 202-205, the I/O Request that FED(front end driver) is stored in the first memory sharing region includes that request identifies,
The IO responses that back driver is stored in the second memory sharing region include response identification.FED(front end driver) and back driver are logical
Cross the one-to-one relationship for asking mark and response identification to determine between I/O Request and IO responses.
Optionally, request mark and response identification are specifically as follows sequence number.FED(front end driver) is an I/O Request point
With sequence number, the I/O Request including sequence number is stored in the first memory sharing region.Back driver will include identical sequence
The second memory sharing region of IO response deposits of column number determines IO after FED(front end driver) reads IO responses according to sequential labeling
The corresponding I/O Request of response.
Alternatively, request mark and response identification can also be memory address.For example, FED(front end driver) is by the complete of I/O Request
Memory is written in content, and memory address is stored in the first memory sharing region.Back driver reads I/O Request according to memory address
Complete content, and the complete content of IO responses is stored in identical memory address, then the memory address is stored in second
Deposit shared region.FED(front end driver) reads memory address from the second memory sharing region, reads what IO was responded from the memory address
Complete content.
Back driver is constantly to the deposit IO responses of the clear position in the second memory sharing region 502, and FED(front end driver) is not
It is disconnected to read IO responses from the second memory sharing region 502, and the IO read is responded from the second memory sharing region 502 and is deleted
It removes, the occupied space dynamic change in the second memory sharing region 502.
In conjunction with step 205, in the case that the second memory sharing region 502 is otherwise fully engaged, back driver determines second
Memory sharing region 501 does not have clear position, then waits for when the second 502 available free position of memory sharing region, then by IO
Response deposit clear position.
The driving method for the virtual memory that the embodiment of the present invention is provided, FED(front end driver) and back driver are total to
It includes the first memory sharing region and the second memory sharing region to enjoy data ring.Wherein, the first memory sharing region is for storing
I/O Request, the second memory sharing region is for storing IO responses.The I/O Request queue received is constantly stored in by FED(front end driver)
The clear position in the first memory sharing region, back driver constantly read I/O Request from the first memory sharing region, and will
The I/O Request of reading is deleted from the first memory sharing region.Back driver rings IO after primary driver obtains IO responses
Queue is answered constantly to be stored in the clear position in the second memory sharing region, FED(front end driver) is constantly read from the second memory sharing region
IO is responded, and the IO read responses are deleted from the second memory sharing region.Nothing between FED(front end driver) and back driver
Event notice need to be passed through, data exchange process can be completed, eliminated the time called spent by Event Notification Service, thus carry
The high read or write speed of virtual machine.
The driving method of the virtual memory provided based on the embodiment of the present invention, the embodiment of the present invention also provide one
Kind back driver, with reference to shown in Fig. 6, back driver 60 includes:
Reading unit 601, for reading input and output I/O Request from the first memory sharing region.Wherein, the first memory is total
It is back driver 60 and the storage region for storing I/O Request in the shared data ring of FED(front end driver), I/O Request to enjoy region
The I/O Request in the first memory sharing region is stored in for FED(front end driver).
Rear end interactive unit 602, the I/O Request for reading reading unit 601 from the first memory sharing region are sent to
Primary driver, and receive the IO responses that primary driver returns.Wherein, IO responses are the response to I/O Request.
Writing unit 603, the IO responses for receiving rear end interactive unit 602 are stored in the second memory sharing region
Clear position, in order to which FED(front end driver) reads IO responses from the second memory sharing region.Wherein, the second memory sharing region is
Storage region in shared data ring for storing IO responses.
Optionally, reading unit 601 are specifically used for the occupancy situation in the first memory sharing of cycle detection region, when first
When memory sharing region is in busy state, I/O Request is read from the first memory sharing region.
Optionally, reading unit 601 are additionally operable to delete I/O Request from the first memory sharing region.
Optionally, writing unit 603 are specifically used for the occupancy situation in the second memory sharing region of detection, when determining second
When the available free position in memory sharing region, IO is responded to the clear position in the second memory sharing region of deposit.
Optionally, back driver 60 further includes:
Shared region allocation unit 604 sends the first instruction message for forward end driver, and the first instruction message is used for
Indicate the address range in the first memory sharing region and the second memory sharing region.
Embodiment in conjunction with corresponding to Fig. 6, the embodiment of the present invention provides another back driver, with reference to shown in Fig. 7,
Back driver 70 includes processor 701, memory 702, bus 703, transmitter 704 and receiver 705.Processor 701 is deposited
Reservoir 702, transmitter 704 and receiver 705 are connected by bus 703 and complete mutual communication.
Program code for executing the present invention program is stored in memory 702, and is held by processor 701 to control
Row.
Memory 702 may include volatile memory (English:Volatile memory), such as random access memory
Device (English:Random-access memory, abbreviation:RAM).Memory can also include nonvolatile memory (English:
Non-volatile memory), such as read-only memory (English:Read-only memory, abbreviation:ROM), flash
Device (English:Flash memory), hard disk (English:Hard disk drive, abbreviation:HDD) or solid state disk is (English:
Solid-state drive, abbreviation:SSD).Memory 702 can also include the combination of the memory of mentioned kind.
Processor 701 can be central processing unit (full name:Central Processing Unit, referred to as:CPU), or
The combination of CPU and hardware chip.Above-mentioned hardware chip can be network processing unit (English:Network processor, abbreviation:
NP), application-specific integrated circuit (English:
Application-specific integrated circuit, abbreviation:ASIC), programmable logic device (English
Text:Programmable logic device, abbreviation:PLD) or it is arbitrarily combined.Above-mentioned PLD can be that complex programmable is patrolled
Collect device (English:Complex programmable logic device, abbreviation:CPLD), field programmable gate array
(English:Field-programmable gate array, abbreviation:FPGA), Universal Array Logic (English:generic
Array logic, abbreviation:GAL) or it is arbitrarily combined.
Processor 701 completes rear end in the corresponding embodiments of above-mentioned Fig. 2 for calling the program code in memory 702
The function of driver is specifically described with reference to the corresponding embodiments of Fig. 2, and details are not described herein again.
The driving method of the virtual memory provided based on the embodiment of the present invention, the embodiment of the present invention also provide one
Kind FED(front end driver), with reference to shown in Fig. 8, FED(front end driver) 80 includes:
Receiving unit 801, for receiving input and output I/O Request.
Writing unit 802, the I/O Request for receiving receiving unit 801 are stored in the free time in the first memory sharing region
Position, so that back driver reads I/O Request from the first memory sharing region.Wherein, the first memory sharing region is driven for front end
Dynamic device 80 and the storage region for storing I/O Request in the shared data ring of back driver.
Reading unit 803, for reading IO responses from the second memory sharing region.Wherein, the second memory sharing region is
It is used to store the storage region of IO responses in shared data ring, the IO responses in the second memory sharing region, to be driven by rear end
Device is stored in the second memory sharing region, the response to I/O Request.
Optionally, writing unit 802 are specifically used for the occupancy situation in the first memory sharing region of detection, when determining first
When the available free position in memory sharing region, I/O Request is stored in the clear position in the first memory sharing region.
Optionally, reading unit 803 are specifically used for the occupancy situation in the second memory sharing of cycle detection region, when second
When memory sharing region is in busy state, IO responses are read from the second memory sharing region.
Optionally, reading unit 803 are additionally operable to delete IO responses from the second memory sharing region.
Optionally, FED(front end driver) 80 further includes:
Shared region allocation unit 804 sends the second instruction message for rear end driver, and the second instruction message is used for
Indicate the address range in the first memory sharing region and the second memory sharing region.
Embodiment in conjunction with corresponding to Fig. 8, the embodiment of the present invention provides another FED(front end driver), with reference to shown in Fig. 9,
FED(front end driver) 90 includes processor 901, memory 902, bus 903, transmitter 904 and receiver 905.Processor 901 is deposited
Reservoir 902, transmitter 904 and receiver 905 are connected by bus 903 and complete mutual communication.
Program code for executing the present invention program is stored in memory 902, and is held by processor 901 to control
Row.
Memory 902 may include volatile memory (English:Volatile memory), such as random access memory
Device (English:Random-access memory, abbreviation:RAM).Memory can also include nonvolatile memory (English:
Non-volatile memory), such as read-only memory (English:Read-only memory, abbreviation:ROM), flash
Device (English:Flash memory), hard disk (English:Hard disk drive, abbreviation:HDD) or solid state disk is (English:
Solid-state drive, abbreviation:SSD).Memory 902 can also include the combination of the memory of mentioned kind.
Processor 901 can be central processing unit (full name:Central Processing Unit, referred to as:CPU), or
The combination of CPU and hardware chip.Above-mentioned hardware chip can be network processing unit (English:Network processor, abbreviation:
NP), application-specific integrated circuit (English:Application-specific integrated circuit, abbreviation:ASIC), can compile
Journey logical device (English:Programmable logic device, abbreviation:PLD) or it is arbitrarily combined.Above-mentioned PLD can be
Complex Programmable Logic Devices (English:Complex programmable logic device, abbreviation:CPLD), scene can compile
Journey logic gate array (English:Field-programmable gate array, abbreviation:FPGA), Universal Array Logic (English:
Generic array logic, abbreviation:GAL) or it is arbitrarily combined.
Processor 901 completes rear end in the corresponding embodiments of above-mentioned Fig. 2 for calling the program code in memory 902
The function of driver is specifically described with reference to the corresponding embodiments of Fig. 2, and details are not described herein again.
The back driver and FED(front end driver) that the embodiment of the present invention is provided, the shared data ring of the two include the
One memory sharing region and the second memory sharing region.Wherein, the first memory sharing region is for storing I/O Request, the second memory
Shared region is for storing IO responses.The I/O Request queue received is constantly stored in the first memory sharing region by FED(front end driver)
Clear position, back driver constantly reads I/O Request from the first memory sharing region, and by the I/O Request read from the
It deletes in one memory sharing region.Back driver is after primary driver obtains IO responses, by the constantly deposit the of IO response queues
The clear position in two memory sharing regions, FED(front end driver) constantly reads IO responses from the second memory sharing region, and will read
The IO responses taken are deleted from the second memory sharing region.Event notice is needed not move through between FED(front end driver) and back driver i.e.
Data exchange process can be completed, the time called spent by Event Notification Service is eliminated, which thereby enhances the read-write of virtual machine
Speed.
Through the above description of the embodiments, it is apparent to those skilled in the art that, when using soft
When part realizes the driving method of virtual memory provided by the present invention, can by for executing the above method instruction or code
Storage is transmitted in computer-readable medium or by computer-readable medium.Computer-readable medium includes that computer is deposited
Storage media and communication media, wherein communication media include convenient for transmitting appointing for computer program from a place to another place
What medium.Storage medium can be any usable medium that computer can access.As example but it is not limited to:It is computer-readable
Medium may include RAM, ROM, Electrically Erasable Programmable Read-Only Memory (full name:electrically erasable
Programmable read-only memory, referred to as:EEPROM), CD, disk or other magnetic storage apparatus or energy
Be enough in carrying or storage with instruction or data structure form desired program code and can by computer access times
What his medium.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (22)
1. a kind of driving method of virtual memory is applied to back driver, which is characterized in that the method includes:
Input and output I/O Request is read from the first memory sharing region;Wherein, first memory sharing region is the rear end
Storage region in the shared data ring of driver and FED(front end driver) for storing I/O Request, the I/O Request are the front end
Driver is stored in the I/O Request in first memory sharing region;
The I/O Request is sent to primary driver, and receives the IO responses that the primary driver returns;Wherein, the IO
Response is the response to the I/O Request;
The clear position that the IO is responded to the second memory sharing region of deposit, in order to which the FED(front end driver) is from described second
Read the IO responses in memory sharing region;Wherein, second memory sharing region is in the shared data ring for depositing
Store up the storage region of IO responses.
2. according to the method described in claim 1, it is characterized in that, described read I/O Request, packet from the first memory sharing region
It includes:
The occupancy situation in the first memory sharing region described in cycle detection, when first memory sharing region is in busy shape
When state, the I/O Request is read from first memory sharing region.
3. according to the method described in claim 1, it is characterized in that, it is described from the first memory sharing region read I/O Request it
Afterwards, the method further includes:
The I/O Request is deleted from first memory sharing region.
4. according to the method described in claim 1, it is characterized in that, described respond the second memory sharing region of deposit by the IO
Clear position, including:
The occupancy situation for detecting second memory sharing region, when determining the available free position in second memory sharing region
When, the IO is responded to the clear position for being stored in second memory sharing region.
5. according to claim 1-4 any one of them methods, which is characterized in that the method further includes:
The first instruction message is sent to the FED(front end driver), first instruction message is used to indicate first memory sharing
The address range in region and second memory sharing region.
6. according to claim 1-4 any one of them methods, which is characterized in that
The back driver is the back driver in the equipment driving domain of Xen platforms.
7. a kind of driving method of virtual memory is applied to FED(front end driver), which is characterized in that the method includes:
Receive input and output I/O Request;
The I/O Request is stored in the clear position in the first memory sharing region, so that back driver is total from first memory
It enjoys region and reads the I/O Request;Wherein, first memory sharing region is that the FED(front end driver) drives with the rear end
Storage region in the shared data ring of device for storing I/O Request;
IO responses are read from the second memory sharing region;Wherein, second memory sharing region is in the shared data ring
Storage region for storing IO responses, the IO responses in second memory sharing region, to be deposited by the back driver
Enter second memory sharing region, the response to the I/O Request.
8. the method according to the description of claim 7 is characterized in that described be stored in the first memory sharing region by the I/O Request
Clear position, including:
The occupancy situation for detecting first memory sharing region, when determining the available free position in first memory sharing region
When, the I/O Request is stored in the clear position in first memory sharing region.
9. the method according to the description of claim 7 is characterized in that described read IO responses, packet from the second memory sharing region
It includes:
The occupancy situation in the second memory sharing region described in cycle detection, when second memory sharing region is in busy shape
When state, the IO responses are read from second memory sharing region.
10. the method according to the description of claim 7 is characterized in that described respond it from the second memory sharing region reading IO
Afterwards, the method further includes:
IO responses are deleted from second memory sharing region.
11. according to claim 7-10 any one of them methods, which is characterized in that the method further includes:
The second instruction message is sent to the back driver, second instruction message is used to indicate first memory sharing
The address range in region and second memory sharing region.
12. according to claim 7-10 any one of them methods, which is characterized in that
The FED(front end driver) is the FED(front end driver) in the common virtual domain of Xen platforms.
13. a kind of back driver, which is characterized in that including:
Reading unit, for reading input and output I/O Request from the first memory sharing region;Wherein, first memory sharing area
Domain is that the storage region for storing I/O Request, the IO are asked in the shared data ring of the back driver and FED(front end driver)
Seek the I/O Request that first memory sharing region is stored in for the FED(front end driver);
Rear end interactive unit, the I/O Request for reading the reading unit from first memory sharing region are sent
To primary driver, and receive the IO responses that the primary driver returns;Wherein, the IO responses is to the I/O Requests
Response;
Writing unit, the sky in the second memory sharing region of IO response deposits for receiving the rear end interactive unit
Not busy position, in order to which the FED(front end driver) reads the IO responses from second memory sharing region;Wherein, described second
Memory sharing region is the storage region for storing IO responses in the shared data ring.
14. back driver according to claim 13, which is characterized in that
The reading unit is specifically used for the occupancy situation in the first memory sharing region described in cycle detection, in described first
When depositing shared region and being in busy state, the I/O Request is read from first memory sharing region.
15. back driver according to claim 13, which is characterized in that
The reading unit is additionally operable to delete the I/O Request from first memory sharing region.
16. back driver according to claim 13,
Said write unit is specifically used for detecting the occupancy situation in second memory sharing region, when determining in described second
When depositing the available free position of shared region, the IO is responded to the clear position for being stored in second memory sharing region.
17. according to claim 13-16 any one of them back drivers, which is characterized in that the back driver is also wrapped
It includes:
Shared region allocation unit, for sending the first instruction message to the FED(front end driver), first instruction message is used
Address range in instruction first memory sharing region and second memory sharing region.
18. a kind of FED(front end driver), which is characterized in that the FED(front end driver) includes:
Receiving unit, for receiving input and output I/O Request;
Writing unit, the I/O Request for receiving the receiving unit are stored in the spare bits in the first memory sharing region
It sets, so that back driver reads the I/O Request from first memory sharing region;Wherein, first memory sharing area
Domain is the FED(front end driver) and the storage region for storing I/O Request in the shared data ring of the back driver;
Reading unit, for reading IO responses from the second memory sharing region;Wherein, second memory sharing region is described
It is used to store the storage region of IO responses in shared data ring, the IO responses in second memory sharing region, for by described
Back driver is stored in second memory sharing region, the response to the I/O Request.
19. FED(front end driver) according to claim 18, which is characterized in that
Said write unit is specifically used for detecting the occupancy situation in first memory sharing region, when determining in described first
When depositing the available free position of shared region, the I/O Request is stored in the clear position in first memory sharing region.
20. FED(front end driver) according to claim 18, which is characterized in that
The reading unit is specifically used for the occupancy situation in the second memory sharing region described in cycle detection, in described second
When depositing shared region and being in busy state, the IO responses are read from second memory sharing region.
21. FED(front end driver) according to claim 18, which is characterized in that
The reading unit is additionally operable to delete IO responses from second memory sharing region.
22. according to claim 18-21 any one of them FED(front end driver)s, which is characterized in that the FED(front end driver) also wraps
It includes:
Shared region allocation unit, for sending the second instruction message to the back driver, second instruction message is used
Address range in instruction first memory sharing region and second memory sharing region.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510872174.1A CN105389133B (en) | 2015-12-02 | 2015-12-02 | A kind of driving method and driver of virtual memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510872174.1A CN105389133B (en) | 2015-12-02 | 2015-12-02 | A kind of driving method and driver of virtual memory |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105389133A CN105389133A (en) | 2016-03-09 |
CN105389133B true CN105389133B (en) | 2018-10-12 |
Family
ID=55421452
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510872174.1A Active CN105389133B (en) | 2015-12-02 | 2015-12-02 | A kind of driving method and driver of virtual memory |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105389133B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101335694A (en) * | 2007-06-29 | 2008-12-31 | 联想(北京)有限公司 | Interrupt handling method and system |
CN102129531A (en) * | 2011-03-22 | 2011-07-20 | 北京工业大学 | Xen-based active defense method |
CN102759979A (en) * | 2011-04-29 | 2012-10-31 | 国际商业机器公司 | Method and device for estimating energy consumption of virtual machine |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010009396A (en) * | 2008-06-27 | 2010-01-14 | Toshiba Corp | Computer system, and device control method for the same |
-
2015
- 2015-12-02 CN CN201510872174.1A patent/CN105389133B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101335694A (en) * | 2007-06-29 | 2008-12-31 | 联想(北京)有限公司 | Interrupt handling method and system |
CN102129531A (en) * | 2011-03-22 | 2011-07-20 | 北京工业大学 | Xen-based active defense method |
CN102759979A (en) * | 2011-04-29 | 2012-10-31 | 国际商业机器公司 | Method and device for estimating energy consumption of virtual machine |
Also Published As
Publication number | Publication date |
---|---|
CN105389133A (en) | 2016-03-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5510556B2 (en) | Method and system for managing virtual machine storage space and physical hosts | |
US10860493B2 (en) | Method and apparatus for data storage system | |
CN104503708B (en) | The method and device of data hash storage | |
US9229751B2 (en) | Apparatus and method for managing virtual memory | |
CN108008911A (en) | Read-write requests processing method and processing device | |
JP2012142012A5 (en) | ||
JP7026216B2 (en) | Virtual machine management | |
CN105190567A (en) | System and method for managing storage system snapshots | |
CN106817388B (en) | Method and device for acquiring data by virtual machine and host machine and system for accessing data | |
CN107678835A (en) | A kind of data transmission method and system | |
CN107278292B (en) | Mapping method and device for memory of virtual machine and data transmission equipment | |
CN108959118B (en) | Data writing method and device | |
US10579299B2 (en) | Method, apparatus, server and storage medium of erasing cloud host in cloud-computing environment | |
EP4027240A1 (en) | Cloud system resource set recommendation method and apparatus, and computing device cluster | |
CN110162396A (en) | Method for recovering internal storage, device, system and storage medium | |
CN105630576A (en) | Data processing method and apparatus in virtualization platform | |
CN104517067B (en) | Access the method, apparatus and system of data | |
CN114281252A (en) | Virtualization method and device for NVMe (network video recorder) device of nonvolatile high-speed transmission bus | |
CN106569874A (en) | Operation method of storage device and physical server | |
CN107453845B (en) | Response confirmation method and device | |
CN109062671A (en) | A kind of high-performance interconnection network software virtual method of lightweight | |
CN105389133B (en) | A kind of driving method and driver of virtual memory | |
CN111126604B (en) | Model training method, device, server and storage medium | |
CN112596669A (en) | Data processing method and device based on distributed storage | |
CN109634721B (en) | Method and related device for starting communication between virtual machine and host |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |