CN116204271A - Virtual input/output (virtIO) optimization method and system in virtual environment - Google Patents

Virtual input/output (virtIO) optimization method and system in virtual environment Download PDF

Info

Publication number
CN116204271A
CN116204271A CN202211524933.1A CN202211524933A CN116204271A CN 116204271 A CN116204271 A CN 116204271A CN 202211524933 A CN202211524933 A CN 202211524933A CN 116204271 A CN116204271 A CN 116204271A
Authority
CN
China
Prior art keywords
consumer
producer
model
notification
mode
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.)
Pending
Application number
CN202211524933.1A
Other languages
Chinese (zh)
Inventor
王峣川
李明
金伟毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Sicui Industrial Internet Technology Research Institute Co ltd
Original Assignee
Suzhou Sicui Industrial Internet Technology Research Institute Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou Sicui Industrial Internet Technology Research Institute Co ltd filed Critical Suzhou Sicui Industrial Internet Technology Research Institute Co ltd
Priority to CN202211524933.1A priority Critical patent/CN116204271A/en
Publication of CN116204271A publication Critical patent/CN116204271A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method and a system for optimizing virtIO in a virtual environment, which belong to the technical field of virtualized networks and aim to solve the technical problem of optimizing virtIO in a virtual machine environment under the condition that throughput, benefit and delay requirements are dynamically met. The method comprises the following steps: acquiring notification rates of a producer and a consumer in the system I/O model, and judging the type of the system I/O model through comparison results of the notification rates of the producer and the consumer, wherein the type of the system I/O model comprises two types of a quick producer and a quick consumer; and acquiring throughput parameters, benefit parameters and delay parameters in the system I/O model, and adjusting the synchronization mode of the system I/O model according to the throughput parameters, the benefit parameters and the delay parameters.

Description

Virtual input/output (virtIO) optimization method and system in virtual environment
Technical Field
The invention relates to the technical field of virtualized networks, in particular to a virtIO optimization method and a virtIO optimization system in a virtual environment.
Background
Computer systems have many components that need to exchange data and synchronize with each other to determine when new data can be sent or received. The same is true in the virtual machine environment, and running processes in the virtual machine perform I/O data throughput and communicate with a hypervisor implementing the corresponding virtual I/O device. Synchronization may be implicit, for example, given a fixed response time of the hardware; or may be explicit, relying on polling (i.e., repeated reading of memory or I/O registers) or asynchronous notification, such as an interrupt. The synchronized resource occupation is often difficult to control and sometimes even larger than the resource occupation of the data processing. While throughput of giga-seconds and millions of I/O operations per second can be achieved when the type of I/O is a network, there are difficulties in limiting the delay to the microsecond level. The optimization of the problems can obviously improve the performance of virtualized I/O data exchange, and has wide application scenes in common virtualized management software.
Virtoio is a widely used standard and API for virtualized I/O, most virtualization management software (QEMU, virtualBox, xen, etc.) and operating system (Linux, windows) are rapidly moving towards virtoio as the default I/O infrastructure for virtual machines. VirtIO is an API of the producer/consumer model that allows a virtual machine to exchange data with its hypervisor, and provides an API on the virtual machine side and an API on the hypervisor side for accessing the VirtIO data structures, respectively. The main data structure is a virtual queue, which is implemented in the shared memory of the virtual machine and the hypervisor, and comprises two sets of loop-back arrays, namely an available array and an used array. The virtual machine driver inserts buffers into the available array of virtual queues, which the hypervisor can fetch in FIFO order. Once the hypervisor consumes a buffer, it pushes it to the used array, at which point the virtual machine can restore them. Each virtual queue has a mechanism for the virtual machine to send notifications to the hypervisor and vice versa. A virto device may consist of one or more virtual queues, e.g., a virto network device has at least one virtual queue for packet transmission and another for packet reception.
The I/O message synchronization is usually carried out by adopting methods such as interrupt or thread scheduling when the input traffic is to be processed, and the output traffic is usually carried out by adopting system call or I/O register access and the like. These operations all occupy certain resources and correspondingly reduce the I/O data throughput. Batch packet synchronization can increase I/O throughput but can cause significant delay problems; while application busy-waiting will reduce consumption of asynchronous notifications and make the delay controllable, however, the resource occupation is larger due to continuous occupation of cpu; the use of short-term sleep mechanisms at this time may be useful to reduce resource occupancy while maintaining I/O throughput.
Ideally, the system can process the information at a speed set by the slowest of the two parties and minimize the delay and resource usage of each piece of information.
How to realize the optimization of virtuo in the virtual machine environment under the condition of dynamically meeting the requirements of throughput, benefit and delay is a technical problem to be solved.
Disclosure of Invention
The technical task of the invention is to provide a virtuo optimization system and a virtuo optimization method in a virtual environment aiming at the defects, so as to solve the technical problem of how to realize virtuo optimization in the virtual machine environment under the condition of dynamically meeting throughput, benefit and delay requirements.
In a first aspect, the present invention is a method for optimizing virtuo in a virtual environment, for implementing message synchronization between a producer and a consumer in an I/O model, where the producer sends a message to the consumer through a shared FIFO queue, and the producer and the consumer work simultaneously, where the work includes message processing, sending and receiving notifications, sleeping, and waking up;
the method comprises the following steps:
acquiring notification rates of a producer and a consumer in the system I/O model, and judging the type of the system I/O model through comparison results of the notification rates of the producer and the consumer, wherein the type of the system I/O model comprises two types of a quick producer and a quick consumer;
acquiring throughput parameters, benefit parameters and delay parameters in the system I/O model, and adjusting the synchronization mode of the system I/O model according to the throughput parameters, the benefit parameters and the delay parameters;
wherein the throughput parameter is an average time between messages;
the benefit parameter is the total benefit of each piece of information;
the delay parameter is the upper bound of the delay of any request;
the three synchronization modes are respectively as follows:
the busy-wait mode is understood as polling in the busy-wait mode, and continuously checking the state of a queue between a producer and a consumer in an I/O model of the system, wherein the CPU is continuously occupied;
sleep mode, which is understood to be polling by sleeping for a predetermined time;
the blocking notification mode is understood to be a mode of transferring CPU resources to other tasks and requiring the other party to send notification.
Preferably, the system I/O model has the following working modes:
after finishing the processing of the last message in the FIFO queue, the consumer checks whether a new message exists in the FIFO queue, and if so, processes the new message in the FIFO queue;
after the producer produces new information, checking whether a storage space exists in the FIFO queue, and pushing the produced new information to the FIFO queue if the storage space exists.
Preferably, the type of the system I/O model is judged through the comparison result of the notification rates of the producer and the consumer, and the corresponding judgment rule is as follows:
if the notification rate of the producer generated message is faster than the notification rate of the consumer consumed message, the type of the system I/O model is determined to be a fast producer;
if the notification rate of the producer generated messages is slower than the notification rate of the consumer consumed messages, the type of system I/O model is determined to be a fast consumer.
Preferably, for the system I/O model, the following parameters are defined:
message queue length L;
workload W of the producer to produce an enqueued message P
Workload W for consumer to process an outgoing message C
Threshold k for the producer to notify the consumer P The threshold value k P The method is as follows: when the consumer is blocked and the producer enqueues a message, when the FIFO queue reaches k P Notification of message time is notifiedEmitting;
threshold k for consumer notification to producer C The threshold value k C The method is as follows: when the consumer has k C A notification is sent when the spare processing capacity of the bar message;
sleep interval Y of consumer C
Sleep interval Y of producer P
Workload Y of sleep operations E
Workload N for a producer to notify a consumer of a change in queue status P
Workload N for consumer to notify producer of queue status change C
The producer receives the customer notice and then starts the working amount S P
The consumer receives the work S started after the notification of the producer C
Based on the parameters, a throughput parameter T is calculated by x And benefit parameter E x
For busy-wait mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T BW =max{W P ,W C }
E BW =2T BW =W P +W C +|W C -W P |
for sleep mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T S =W P
Figure SMS_1
for the blocking notification mode, the throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T n =(W P +W C +N P +N C +S P +S C )/L
E n =W P +W C +(N P +N C +S P +S C )/L。
preferably, the synchronization mode of the system I/O model is adjusted according to the throughput parameter, the benefit parameter and the delay parameter, and the method comprises the following steps:
if the type of system I/O model is a fast producer, a sleep mode will be applied at the consumer side, at which time Y C Or Y P Will not exceed the delay parameter D x Is calculated by calculating the threshold value of (2)
Figure SMS_2
Wherein W is T x I.e. W P And W is equal to C Maximum value of (2) in comparison with Y max And Y is equal to E If the sleep mode is larger than the busy waiting mode, the sleep mode is applied, and if the sleep mode is smaller than the busy waiting mode, the busy waiting mode is applied;
if the type of system I/O model is a fast consumer, the blocking notification mode will be applied, at which time a relatively large k is set C The value may be such that consumer to producer notifications are processed in batches; at this time only k C Greater than a threshold or k P If the threshold value is smaller than the threshold value, both the sleep mode and the blocking notification mode are feasible; if the delay parameter D is not satisfied at this time x The length L of the message queue is reduced.
In a second aspect, the present invention is a virtuo optimization system in a virtual environment, configured to implement message synchronization between a producer and a consumer in an I/O model, where the producer sends a message to the consumer through a shared FIFO queue, and the producer and the consumer work simultaneously, where the work includes message processing, sending and receiving notifications, sleeping, and waking up;
the system comprises:
a type determination module for performing: acquiring notification rates of a producer and a consumer in the system I/O model, and judging the type of the system I/O model through comparison results of the notification rates of the producer and the consumer, wherein the type of the system I/O model comprises two types of a quick producer and a quick consumer;
the synchronization mode adjustment module is used for executing: acquiring throughput parameters, benefit parameters and delay parameters in the system I/O model, and adjusting the synchronization mode of the system I/O model according to the throughput parameters, the benefit parameters and the delay parameters;
wherein the throughput parameter is an average time between messages;
the benefit parameter is the total benefit of each piece of information;
the delay parameter is the upper bound of the delay of any request;
the three synchronization modes are respectively as follows:
the busy-wait mode is understood as polling in the busy-wait mode, and continuously checking the state of a queue between a producer and a consumer in an I/O model of the system, wherein the CPU is continuously occupied;
sleep mode, which is understood to be polling by sleeping for a predetermined time;
the blocking notification mode is understood to be a mode of transferring CPU resources to other tasks and requiring the other party to send notification.
Preferably, the system I/O model operates in the following modes:
after finishing the processing of the last message in the FIFO queue, the consumer checks whether a new message exists in the FIFO queue, and if so, processes the new message in the FIFO queue;
after the producer produces new information, checking whether a storage space exists in the FIFO queue, and pushing the produced new information to the FIFO queue if the storage space exists.
Preferably, the type determining module is configured to execute the following determining rule to determine the type of the system I/O model according to the comparison result of the notification rates of the producer and the consumer:
if the notification rate of the producer generated message is faster than the notification rate of the consumer consumed message, the type of the system I/O model is determined to be a fast producer;
if the notification rate of the producer generated messages is slower than the notification rate of the consumer consumed messages, the type of system I/O model is determined to be a fast consumer.
Preferably, for the system I/O model, the synchronization pattern adjustment module is configured to define the following parameters:
message queue length L;
workload W of the producer to produce an enqueued message P
Workload W for consumer to process an outgoing message C
Threshold k for the producer to notify the consumer P The threshold value k P The method is as follows: when the consumer is blocked and the producer enqueues a message, when the FIFO queue reaches k P A notification is sent when a message is sent;
threshold k for consumer notification to producer C The threshold value k C The method is as follows: when the consumer has k C A notification is sent when the spare processing capacity of the bar message;
sleep interval Y of consumer C
Sleep interval Y of producer P
Workload Y of sleep operations E
Workload N for a producer to notify a consumer of a change in queue status P
Workload N for consumer to notify producer of queue status change C
The producer receives the customer notice and then starts the working amount S P
The consumer receives the work S started after the notification of the producer C
Based on the parameters, the synchronization mode adjustment module is used for calculating a throughput parameter T by the following method x And benefit parameter E x
For busy-wait mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T BW =max{W P ,W C }
E BW =2T BW =W P +W C +|W C -W P |
for sleep mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T S =W P
Figure SMS_3
for the blocking notification mode, the throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T n =(W P +W C +N P +N C +S P +S C )/L
E n =W P +W C +(N P +N C +S P +S C )/L。
preferably, the synchronization mode adjustment module is configured to perform the following:
if the type of system I/O model is a fast producer, a sleep mode will be applied at the consumer side, at which time Y C Or Y P Will not exceed the delay parameter D x Is calculated by calculating the threshold value of (2)
Figure SMS_4
Wherein W is T x I.e. W P And W is equal to C Maximum value of (2) in comparison with Y max And Y is equal to E If the sleep mode is larger than the busy waiting mode, the sleep mode is applied, and if the sleep mode is smaller than the busy waiting mode, the busy waiting mode is applied;
if the type of system I/O model is a fast consumer, the blocking notification mode will be applied, at which time a relatively large k is set C The value may be such that consumer to producer notifications are processed in batches; at this time only k C Greater than a threshold or k P If the threshold value is smaller than the threshold value, both the sleep mode and the blocking notification mode are feasible; if the delay parameter D is not satisfied at this time x The length L of the message queue is reduced.
The virtIO optimizing system and method in the virtual environment have the following advantages: the synchronization mode is adjusted according to the type of the system I/O model, so that a flexible synchronization mode is provided, and throughput, benefit and delay requirements are dynamically met.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
The invention is further described below with reference to the accompanying drawings.
FIG. 1 is a schematic diagram of a system I/O model architecture;
fig. 2 is a flow chart of a virtoio optimization method in the virtual environment of embodiment 1.
Detailed Description
The invention will be further described with reference to the accompanying drawings and specific examples, so that those skilled in the art can better understand the invention and implement it, but the examples are not meant to limit the invention, and the technical features of the embodiments of the invention and the examples can be combined with each other without conflict.
The embodiment of the invention provides a method and a system for optimizing virtIO in a virtual environment, which are used for solving the technical problem of optimizing virtIO in a virtual machine environment under the condition of dynamically meeting throughput, benefit and delay requirements.
Example 1:
the optimization method of virtuo in the virtual machine environment is used for realizing the message synchronization between the producer and the consumer in the I/O model. For the system I/O model, the communication ends are producer P and consumer C, with P sending messages to C through a shared FIFO queue, as shown in FIG. 1. P and C work simultaneously, including message processing, sending and receiving notifications, sleeping, waking up, etc. When C finishes processing the last message in the queue, it can check the queue again and immediately see if there is a new message and process it immediately. Likewise, whenever P completes the production of a message, it can check if C vacates some space during this period, enabling P to produce more messages. Each message generated by P will cause C to continue to be active for some time, which in turn gives P more time to generate more messages.
However, if the speeds of the two parties do not match, the faster party has to wait for the slower party after the completion of the job. If C finds that the queue is empty after the last message is consumed, it cannot continue. Also, if P finds that the queue is full, it cannot continue to produce new messages. In these cases, both parties must take synchronization measures to clear when their process can continue.
Based on the synchronous requirement of the system I/O model, the optimization method of the embodiment comprises the following steps:
step S100, acquiring notification rates of a producer and a consumer in the system I/O model, and judging the type of the system I/O model through comparison results of the notification rates of the producer and the consumer, wherein the type of the system I/O model comprises two types of a quick producer and a quick consumer;
step S200, obtaining throughput parameter T in system I/O model x Benefit parameter E x Delay parameter D x And adjusting the synchronous mode of the system I/O model according to the throughput parameter, the benefit parameter and the delay parameter.
Wherein the throughput parameter is an average time between messages; the benefit parameter is the total benefit of each piece of information; the delay parameter is the upper bound of the delay of any request.
In this embodiment, three synchronization methods are respectively a busy waiting method, a sleep method, and a blocking notification method.
The busy-wait mode is understood to be a polling mode that continuously checks the status of queues between the producer and consumer in the system I/O model, continuously occupying the CPU.
Sleep mode is understood to mean polling by sleeping for a predetermined time.
The blocking notification mode is understood to be a mode in which the CPU resource is transferred to another task and the other party is required to issue a notification.
In step S100, the system I/O type is determined according to the mutual notification rate, and the method is as follows: I/O types are classified into fast producers and fast consumers, the former P-side message rate is faster than the C-side, and the latter is vice versa. Fast consumer types have relatively more P-to-C notifications, while the number of C-to-P notifications is smaller, and fast producer types are the opposite. Therefore, judging the mutual notification rate size is one method to roughly distinguish between the two types.
In step S200 of this embodiment, for the system I/O model, the following parameters are defined:
message queue length L;
workload W of the producer to produce an enqueued message P
Workload W for consumer to process an outgoing message C
Threshold k for the producer to notify the consumer P The threshold value k P The method is as follows: when the consumer is blocked and the producer enqueues a message, when the FIFO queue reaches k P A notification is sent when a message is sent;
threshold k for consumer notification to producer C The threshold value k C The method is as follows: when the consumer has k C A notification is sent when the spare processing capacity of the bar message;
sleep interval Y of consumer C
Sleep interval Y of producer P
Workload Y of sleep operations E
Workload N for a producer to notify a consumer of a change in queue status P
Workload N for consumer to notify producer of queue status change C
The producer receives the customer notice and then starts the working amount S P
The consumer receives the work S started after the notification of the producer C
Based on the parameters, a throughput parameter T is calculated by x And benefit parameter E x
For busy-wait mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T BW =max{W P ,W C }
E BW =2T BW =W P +W C +|W C -W P |
for sleep mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T S =W P
Figure SMS_5
for the blocking notification mode, the throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T n =(W P +W C +N P +N C +S P +S C )/L
E n =W P +W C +(N P +N C +S P +S C )/L。
by referring to the I/O type, throughput parameters, benefit parameters and delay parameters of the system, the I/O synchronization mode is adjusted by the following modes:
(1) If the I/O type is a fast producer, a sleep mode will be applied at the C-terminal to avoid a large number of notifications, at which time Y C Or Y P Will not exceed the delay parameter D x Is calculated by calculating the threshold value of (2)
Figure SMS_6
Wherein W is T x I.e. W P And W is equal to C Is the maximum value of (a). Comparison Y max And Y is equal to E If the sleep mode is larger than the busy waiting mode, the sleep mode is applied, and if the sleep mode is smaller than the busy waiting mode, the busy waiting mode is applied;
(2) If the I/O type is fast consumer, the blocking notification mode will be applied, at which time a relatively large k is set C The value may be such that the notification of C to P is processed in batches. At this time only k C Large enough or k P The device is small enough, and both a sleep mode and a blocking notification mode are feasible; if the delay parameter D is not satisfied at this time x The length L of the message queue is reduced appropriately.
The I/O message synchronization is usually carried out by adopting methods such as interrupt or thread scheduling when the input traffic is to be processed, and the output traffic is usually carried out by adopting system call or I/O register access and the like. These operations all occupy certain resources and correspondingly reduce the I/O data throughput. Batch packet synchronization can increase I/O throughput but can cause significant delay problems; while application busy-waiting will reduce consumption of asynchronous notifications and make the delay controllable, however, the resource occupation is larger due to continuous occupation of cpu; the use of short-term sleep mechanisms at this time may be useful to reduce resource occupancy while maintaining I/O throughput.
The present embodiment provides a flexible synchronization method to dynamically meet throughput, benefit and delay requirements.
Example 2:
the invention relates to a virtuo optimizing system in virtual environment, which comprises a type judging module and a synchronous mode adjusting module, wherein the system is used for realizing the message synchronization between a producer and a consumer in an I/O model, the producer sends messages to the consumer through a shared FIFO queue in the I/O model, and the producer and the consumer work simultaneously, the work comprises message processing, sending and receiving notification, sleeping and waking,
the working mode of the system I/O model is as follows: after finishing the processing of the last message in the FIFO queue, the consumer checks whether a new message exists in the FIFO queue, and if so, processes the new message in the FIFO queue; after the producer produces new information, checking whether a storage space exists in the FIFO queue, and pushing the produced new information to the FIFO queue if the storage space exists.
For the synchronization of the system I/O model, the type determination module is configured to perform: and acquiring notification rates of the producer and the consumer in the system I/O model, and judging the type of the system I/O model through comparison results of the notification rates of the producer and the consumer, wherein the type of the system I/O model comprises two types of a quick producer and a quick consumer.
Wherein, the throughput parameter is average time between messages, and the benefit parameter is total benefit of each piece of information; the delay parameter is the upper bound of the delay of any request.
The synchronization modes are a busy waiting mode, a sleep mode and a blocking notification mode respectively.
The busy waiting mode is understood as polling in the busy waiting mode, and continuously checking the state of a queue between a producer and a consumer in an I/O model of the system, wherein the CPU is continuously occupied;
sleep mode is understood as polling by sleeping for a predetermined time;
the blocking notification mode is understood to be a mode in which the CPU resource is transferred to another task and the other party is required to issue a notification.
In this embodiment, the type determining module is configured to execute the following determining rule to determine the type of the I/O model of the system according to the comparison result of the notification rates of the producer and the consumer:
(1) If the notification rate of the producer generated message is faster than the notification rate of the consumer consumed message, the type of the system I/O model is determined to be a fast producer;
(2) If the notification rate of the producer generated messages is slower than the notification rate of the consumer consumed messages, the type of system I/O model is determined to be a fast consumer.
The synchronization mode adjustment module is used for executing: and acquiring throughput parameters, benefit parameters and delay parameters in the system I/O model, and adjusting the synchronization mode of the system I/O model according to the throughput parameters, the benefit parameters and the delay parameters.
For the system I/O model, the synchronous mode adjustment module is used for defining the following parameters:
message queue length L;
the producer producing an enqueued messageWorkload W P
Workload W for consumer to process an outgoing message C
Threshold k for the producer to notify the consumer P The threshold value k P The method is as follows: when the consumer is blocked and the producer enqueues a message, when the FIFO queue reaches k P A notification is sent when a message is sent;
threshold k for consumer notification to producer C The threshold value k C The method is as follows: when the consumer has k C A notification is sent when the spare processing capacity of the bar message;
sleep interval Y of consumer C
Sleep interval Y of producer P
Workload Y of sleep operations E
Workload N for a producer to notify a consumer of a change in queue status P
Workload N for consumer to notify producer of queue status change C
The producer receives the customer notice and then starts the working amount S P
The consumer receives the work S started after the notification of the producer C
Based on the parameters, the synchronization mode adjustment module is used for calculating a throughput parameter T by the following method x And benefit parameter E x
For busy-wait mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T BW =max{W P ,W C }
E BW =2T BW =W P +W C +|W C -W P |
for sleep mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T S =W P
Figure SMS_7
for the blocking notification mode, the throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T n =(W P +W C +N P +N C +S P +S C )/L
E n =W P +W C +(N P +N C +S P +S C )/L。
the synchronization mode adjustment module is used for executing the following steps:
if the type of system I/O model is a fast producer, a sleep mode will be applied at the consumer side, at which time Y C Or Y P Will not exceed the delay parameter D x Is calculated by calculating the threshold value of (2)
Figure SMS_8
Wherein W is T x I.e. W P And W is equal to C Maximum value of (2) in comparison with Y max And Y is equal to E If the sleep mode is larger than the busy waiting mode, the sleep mode is applied, and if the sleep mode is smaller than the busy waiting mode, the busy waiting mode is applied;
if the type of system I/O model is a fast consumer, the blocking notification mode will be applied, at which time a relatively large k is set C The value may be such that consumer to producer notifications are processed in batches; at this time only k C Greater than a threshold or k P If the threshold value is smaller than the threshold value, both the sleep mode and the blocking notification mode are feasible; if the delay parameter D is not satisfied at this time x The length L of the message queue is reduced.
While the invention has been illustrated and described in detail in the drawings and in the preferred embodiments, the invention is not limited to the disclosed embodiments, and it will be appreciated by those skilled in the art that the code audits of the various embodiments described above may be combined to produce further embodiments of the invention, which are also within the scope of the invention.

Claims (10)

1. The optimization method of virtuo in the virtual environment is characterized by being used for realizing the message synchronization between a producer and a consumer in an I/O model, wherein the producer sends a message to the consumer through a shared FIFO queue in the I/O model, and the producer and the consumer work simultaneously, and the work comprises message processing, sending and receiving notification, sleeping and waking;
the method comprises the following steps:
acquiring notification rates of a producer and a consumer in the system I/O model, and judging the type of the system I/O model through comparison results of the notification rates of the producer and the consumer, wherein the type of the system I/O model comprises two types of a quick producer and a quick consumer;
acquiring throughput parameters, benefit parameters and delay parameters in the system I/O model, and adjusting the synchronization mode of the system I/O model according to the throughput parameters, the benefit parameters and the delay parameters;
wherein the throughput parameter is an average time between messages;
the benefit parameter is the total benefit of each piece of information;
the delay parameter is the upper bound of the delay of any request;
the three synchronization modes are respectively as follows:
the busy-wait mode is understood as polling in the busy-wait mode, and continuously checking the state of a queue between a producer and a consumer in an I/O model of the system, wherein the CPU is continuously occupied;
sleep mode, which is understood to be polling by sleeping for a predetermined time;
the blocking notification mode is understood to be a mode of transferring CPU resources to other tasks and requiring the other party to send notification.
2. The method for optimizing virtuo in a virtual environment according to claim 1, wherein the system I/O model has a working mode of:
after finishing the processing of the last message in the FIFO queue, the consumer checks whether a new message exists in the FIFO queue, and if so, processes the new message in the FIFO queue;
after the producer produces new information, checking whether a storage space exists in the FIFO queue, and pushing the produced new information to the FIFO queue if the storage space exists.
3. The optimization method of virtuo in a virtual environment according to claim 1, wherein the type of the system I/O model is determined by comparing notification rates at both ends of the producer and the consumer, and the corresponding determination rule is:
if the notification rate of the producer generated message is faster than the notification rate of the consumer consumed message, the type of the system I/O model is determined to be a fast producer;
if the notification rate of the producer generated messages is slower than the notification rate of the consumer consumed messages, the type of system I/O model is determined to be a fast consumer.
4. A method of optimizing virtIO in a virtual environment according to any one of claims 1-3, wherein for a system I/O model, the following parameters are defined:
message queue length L;
workload W of the producer to produce an enqueued message P
Workload W for consumer to process an outgoing message C
Threshold k for the producer to notify the consumer P The threshold value k P The method is as follows: when the consumer is blocked and the producer enqueues a message, when the FIFO queue reaches k P A notification is sent when a message is sent;
threshold k for consumer notification to producer C The threshold value k C The method is as follows: when the consumer has k C A notification is sent when the spare processing capacity of the bar message;
sleep interval Y of consumer C
Sleep interval Y of producer P
Workload Y of sleep operations E
Workload N for a producer to notify a consumer of a change in queue status P
Workload N for consumer to notify producer of queue status change C
The producer receives the customer notice and then starts the working amount S P
The consumer receives the work S started after the notification of the producer C
Based on the parameters, a throughput parameter T is calculated by x And benefit parameter E x
For busy-wait mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T BW =max{W P ,W C }
E BW =2T BW =W P +W C +|W C -W P |
for sleep mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T S =W P
Figure QLYQS_1
for the blocking notification mode, the throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T n =(W P +W C +N P +N C +S P +S C )/L
E n =W P +W C +(N P +N C +S P +S C )/L。
5. the method for optimizing virtuo in a virtual environment according to claim 4, wherein the synchronization of the system I/O model is adjusted according to the throughput parameter, the benefit parameter and the delay parameter, comprising the steps of:
if the type of system I/O model is a fast producer, a sleep mode will be applied at the consumer side, at which time Y C Or Y P Will not exceed the delay parameter D x Is calculated by calculating the threshold value of (2)
Figure QLYQS_2
Wherein W is T x I.e. W P And W is equal to C Maximum value of (2) in comparison with Y max And Y is equal to E If the sleep mode is larger than the busy waiting mode, the sleep mode is applied, and if the sleep mode is smaller than the busy waiting mode, the busy waiting mode is applied;
if the type of system I/O model is a fast consumer, the blocking notification mode will be applied, at which time a relatively large k is set C The value may be such that consumer to producer notifications are processed in batches; at this time only k C Greater than a threshold or k P If the threshold value is smaller than the threshold value, both the sleep mode and the blocking notification mode are feasible; if the delay parameter D is not satisfied at this time x The length L of the message queue is reduced.
6. The optimizing system of virtuo in the virtual environment is characterized by being used for realizing the message synchronization between a producer and a consumer in an I/O model, wherein the producer sends a message to the consumer through a shared FIFO queue in the I/O model, and the producer and the consumer work simultaneously, and the work comprises message processing, sending and receiving notification, sleeping and waking;
the system comprises:
a type determination module for performing: acquiring notification rates of a producer and a consumer in the system I/O model, and judging the type of the system I/O model through comparison results of the notification rates of the producer and the consumer, wherein the type of the system I/O model comprises two types of a quick producer and a quick consumer;
the synchronization mode adjustment module is used for executing: acquiring throughput parameters, benefit parameters and delay parameters in the system I/O model, and adjusting the synchronization mode of the system I/O model according to the throughput parameters, the benefit parameters and the delay parameters;
wherein the throughput parameter is an average time between messages;
the benefit parameter is the total benefit of each piece of information;
the delay parameter is the upper bound of the delay of any request;
the three synchronization modes are respectively as follows:
the busy-wait mode is understood as polling in the busy-wait mode, and continuously checking the state of a queue between a producer and a consumer in an I/O model of the system, wherein the CPU is continuously occupied;
sleep mode, which is understood to be polling by sleeping for a predetermined time;
the blocking notification mode is understood to be a mode of transferring CPU resources to other tasks and requiring the other party to send notification.
7. The optimization system of virtuo in a virtual environment of claim 6, wherein the system I/O model operates in a mode of:
after finishing the processing of the last message in the FIFO queue, the consumer checks whether a new message exists in the FIFO queue, and if so, processes the new message in the FIFO queue;
after the producer produces new information, checking whether a storage space exists in the FIFO queue, and pushing the produced new information to the FIFO queue if the storage space exists.
8. The optimization system of virtuo in a virtual environment according to claim 6, wherein the type determining module is configured to execute the following determining rule to determine the type of the system I/O model according to a comparison result of notification rates of both the producer and the consumer:
if the notification rate of the producer generated message is faster than the notification rate of the consumer consumed message, the type of the system I/O model is determined to be a fast producer;
if the notification rate of the producer generated messages is slower than the notification rate of the consumer consumed messages, the type of system I/O model is determined to be a fast consumer.
9. The optimization system of virtuo in a virtual environment according to any one of claims 6-8, wherein for a system I/O model, the synchronization pattern adjustment module is configured to define the following parameters:
message queue length L;
workload W of the producer to produce an enqueued message P
Workload W for consumer to process an outgoing message C
Threshold k for the producer to notify the consumer P The threshold value k P The method is as follows: when the consumer is blocked and the producer enqueues a message, when the FIFO queue reaches k P A notification is sent when a message is sent;
threshold k for consumer notification to producer C The threshold value k C The method is as follows: when the consumer has k C A notification is sent when the spare processing capacity of the bar message;
sleep interval Y of consumer C
Sleep interval Y of producer P
Workload Y of sleep operations E
Workload N for a producer to notify a consumer of a change in queue status P
Workload N for consumer to notify producer of queue status change C
The producer receives the customer notice and then starts the working amount S P
The consumer receives the work S started after the notification of the producer C
Based on the parameters, the synchronization mode adjustment module is used for calculating a throughput parameter T by the following method x And benefit parameter E x
For busy-wait mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T BW =max{W P ,W C }
E BW =2T BW =W P +W C +|W C -W P |
for sleep mode, throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T S =W P
Figure QLYQS_3
for the blocking notification mode, the throughput parameter T BW And benefit parameter E BW The calculation formulas of (a) are respectively as follows:
T n =(W P +W C +N P +N C +S P +S C )/L
E n =W P +W C +(N P +N C +S P +S C )/L。
10. the optimization system of virtoio in a virtual environment according to claim 9, wherein the synchronization pattern adjustment module is configured to perform the following:
if the type of system I/O model is a fast producer, a sleep mode will be applied at the consumer side, at which time Y C Or Y P Will not exceed the delay parameter D x Is calculated by calculating the threshold value of (2)
Figure QLYQS_4
Wherein W is T x I.e. W P And W is equal to C Maximum value of (2) in comparison with Y max And Y is equal to E If the sleep mode is larger than the busy waiting mode, the sleep mode is applied, and if the sleep mode is smaller than the busy waiting mode, the busy waiting mode is applied;
if the type of system I/O model is a fast consumer, the blocking notification mode will be applied, at which time a relatively large k is set C The value may be such that consumer to producer notifications are processed in batches; at this time only k C Greater than a threshold or k P Less than a threshold, sleep mode and blocking notificationThe modes are all feasible; if the delay parameter D is not satisfied at this time x The length L of the message queue is reduced.
CN202211524933.1A 2022-12-01 2022-12-01 Virtual input/output (virtIO) optimization method and system in virtual environment Pending CN116204271A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211524933.1A CN116204271A (en) 2022-12-01 2022-12-01 Virtual input/output (virtIO) optimization method and system in virtual environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211524933.1A CN116204271A (en) 2022-12-01 2022-12-01 Virtual input/output (virtIO) optimization method and system in virtual environment

Publications (1)

Publication Number Publication Date
CN116204271A true CN116204271A (en) 2023-06-02

Family

ID=86515260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211524933.1A Pending CN116204271A (en) 2022-12-01 2022-12-01 Virtual input/output (virtIO) optimization method and system in virtual environment

Country Status (1)

Country Link
CN (1) CN116204271A (en)

Similar Documents

Publication Publication Date Title
US8812639B2 (en) Job managing device, job managing method and job managing program
US8266232B2 (en) Hardware processing of commands within virtual client computing environment
US8478926B1 (en) Co-processing acceleration method, apparatus, and system
US5875329A (en) Intelligent batching of distributed messages
CN109697122B (en) Task processing method, device and computer storage medium
US6715008B2 (en) Method and system for over-run protection in a message passing multi-processor computer system using a credit-based protocol
US20120297216A1 (en) Dynamically selecting active polling or timed waits
US5682480A (en) Parallel computer system for performing barrier synchronization by transferring the synchronization packet through a path which bypasses the packet buffer in response to an interrupt
US6256660B1 (en) Method and program product for allowing application programs to avoid unnecessary packet arrival interrupts
US6012121A (en) Apparatus for flexible control of interrupts in multiprocessor systems
CN112445735A (en) Method, computer equipment, system and storage medium for transmitting federated learning data
US20190171489A1 (en) Method of managing dedicated processing resources, server system and computer program product
US7007138B2 (en) Apparatus, method, and computer program for resource request arbitration
JP4659008B2 (en) Peripheral circuit with host load adjustment function
US20210311773A1 (en) Efficient Condition Variables via Delegated Condition Evaluation
Sha et al. Real-time scheduling support in Futurebus+
JP2002024195A (en) Parallel processor and parallel process method
US9298652B2 (en) Moderated completion signaling
CN116204271A (en) Virtual input/output (virtIO) optimization method and system in virtual environment
JP2010134698A (en) Information processing system
US20080082708A1 (en) Token hold off for chipset communication
Golchin et al. Tuned pipes: end-to-end throughput and delay guarantees for USB devices
US20080189719A1 (en) Operation processor apparatus
CN112114967B (en) GPU resource reservation method based on service priority
Coulson et al. Supporting continuous media applications in a micro-kernel environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination