CN110188026A - The determination method and device of fast table default parameters - Google Patents

The determination method and device of fast table default parameters Download PDF

Info

Publication number
CN110188026A
CN110188026A CN201910473368.2A CN201910473368A CN110188026A CN 110188026 A CN110188026 A CN 110188026A CN 201910473368 A CN201910473368 A CN 201910473368A CN 110188026 A CN110188026 A CN 110188026A
Authority
CN
China
Prior art keywords
default parameters
host
fast table
operation duration
virtual machine
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.)
Granted
Application number
CN201910473368.2A
Other languages
Chinese (zh)
Other versions
CN110188026B (en
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.)
Loongson Technology Corp Ltd
Original Assignee
Loongson Technology Corp 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 Loongson Technology Corp Ltd filed Critical Loongson Technology Corp Ltd
Priority to CN201910473368.2A priority Critical patent/CN110188026B/en
Publication of CN110188026A publication Critical patent/CN110188026A/en
Application granted granted Critical
Publication of CN110188026B publication Critical patent/CN110188026B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1027Address translation using associative or pseudo-associative address translation means, e.g. translation look-aside buffer [TLB]
    • G06F12/1036Address translation using associative or pseudo-associative address translation means, e.g. translation look-aside buffer [TLB] for multiple virtual address spaces, e.g. segmentation
    • 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 present invention provides a kind of determination method and devices of fast table default parameters, the method is applied to field of computer technology, the described method includes: executing the first test program on virtual machine and corresponding host respectively, the first operation duration and the second operation duration are obtained, first test program includes that the first circulation code for leading to fast table missing is performed a plurality of times;Determine the corresponding fast table default parameters of the host;The corresponding fast table default parameters of the virtual machine are determined according to first operation duration, second operation duration, the execution number of the first circulation code and the corresponding fast watch default parameters of the host.The above method can determine the fast table default parameters for the virtual machine for not supporting PERF tool under MIPS framework, and test itself can't introduce fast table missing, help to improve test result.And the test is not limited under MIPS framework, can be used under X86 and ARM framework, has versatility.

Description

The determination method and device of fast table default parameters
Technical field
The present embodiments relate to field of computer technology more particularly to a kind of the determination methods and dress of fast table default parameters It sets.
Background technique
In KVM (Kernel-based Virtual Machine, Kernel virtual machine), fast table is transition detection buffering The abbreviation in area (TLB, Translation Lookaside Buffer), as memory management unit, for improving virtual address To physical address translations speed.The expense of fast table missing accounts for very big specific gravity in virtual machine expense.Especially MIPS Under (Microprocessor without Interlocked Piped Stages, the microprocessor of no interlocking pipeline) framework, Virtual machine hardware after fast table missing is only responsible for exiting user model, and remaining work is completed by software, and fast table is caused to lack The expense of mistake is bigger, affects the performance of virtualization.
In the prior art, usual passage capacity analysis tool, typical performance evaluation work are tested to the expense of fast table missing Tool is PERF (PERFormance profiling, Properties Analysis) tool, it can recorde kernel and process in operating system Various performance events, when such as process switching number, CPU (Central Processing Unit, central processing unit) processing Between, TLB missing times etc..
It has been investigated that the number of the usually fast table missing of PERF statistics, rather than overhead cycles;Under MIPS framework Virtual machine does not support PERF tool, and PERF process itself also has an impact to fast table missing, and test result is caused to be inaccurate.
Summary of the invention
The present invention provides a kind of determination method and device of fast table default parameters, counts fast table missing ginseng to solve PERF Several above problems.
In order to solve the above-mentioned technical problem, the present invention is implemented as follows:
In a first aspect, the embodiment of the invention provides a kind of determination method of fast table default parameters, this method may include:
The first test program is executed on virtual machine and corresponding host respectively, obtains the first operation duration and the second operation Duration, first test program include that the first circulation code for leading to fast table missing is performed a plurality of times;
Determine the corresponding fast table default parameters of the host;
According to first operation duration, second operation duration, the first circulation code execution number and The corresponding fast watch default parameters of the host determine the corresponding fast table default parameters of the virtual machine.
Second aspect, the embodiment of the invention provides a kind of determining device of fast table default parameters, the apparatus may include:
First test program execution module, for executing the first test program on virtual machine and corresponding host respectively, The first operation duration and the second operation duration are obtained, first test program includes being performed a plurality of times lead to fast table missing first Loop code;
The fast table default parameters determining module of host, for determining the corresponding fast table default parameters of the host;
The fast table default parameters determining module of virtual machine, for according to first operation duration, second operation duration, The corresponding fast table default parameters of the execution number and the host of the first circulation code determine that the virtual machine is corresponding Fast table default parameters.
The third aspect the embodiment of the invention provides a kind of electronic equipment, including processor, memory and is stored in described It is real when the computer program is executed by the processor on memory and the computer program that can run on the processor Now the step of determination method of fast table default parameters as described in relation to the first aspect.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storage Computer program is stored on medium, and fast table missing as described in relation to the first aspect is realized when the computer program is executed by processor The step of determination method for parameter.
In embodiments of the present invention, the first test program is executed on virtual machine and corresponding host respectively, obtains first Operation duration and the second operation duration, first test program include that the first circulation generation for leading to fast table missing is performed a plurality of times Code;Determine the corresponding fast table default parameters of the host;According to first operation duration, second operation duration, described The corresponding fast watch default parameters of the execution number and the host of first circulation code determine the corresponding fast table of the virtual machine Default parameters.The above method can determine the fast table default parameters for the virtual machine for not supporting PERF tool under MIPS framework, and survey Examination itself can't introduce fast table missing, help to improve test result.And the test is not limited under MIPS framework, it can also be with For under X86 and ARM framework, to there is versatility.
Detailed description of the invention
Fig. 1 is one of the flow chart of the determination method of fast table default parameters provided in an embodiment of the present invention;
Fig. 2 is the two of the flow chart of the determination method of fast table default parameters provided in an embodiment of the present invention;
Fig. 3 is one of the structural block diagram of determining device of fast table default parameters provided in an embodiment of the present invention;
Fig. 4 is the two of the structural block diagram of the determining device of fast table default parameters provided in an embodiment of the present invention;
A kind of hardware structural diagram of Fig. 5 mobile terminal of each embodiment to realize the present invention.
Specific embodiment
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 description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
Fig. 1 is one of the flow chart of the determination method of fast table default parameters provided in an embodiment of the present invention, as shown in Figure 1, This method may include:
Step 101, execute the first test program on virtual machine and corresponding host respectively, obtain the first operation duration and Second operation duration, first test program include that the first circulation code for leading to fast table missing is performed a plurality of times.
Wherein, the first operation duration is that virtual machine executes the time required for the first test program, and the second operation duration is Host executes the time required for the first test program.
Host is the computer of physical presence, and virtual machine is the virtual machine of Intrusion Detection based on host creation, is typically carried on host, And data are handled using configurations such as processor, the memories of host.
First test program can be the code write in advance, and the execution of the first test program will lead to repeatedly fast table and lack It loses, so as to test to obtain fast table default parameters.In embodiments of the present invention, for simplicity, first circulation code can Think that accessing operation, accessing operation can introduce fast table missing.
It will be appreciated, of course, that any operation that can be introduced into fast table missing can be used as the in the first test program One loop code.
In addition, the execution number of first circulation code is more, accuracy is higher, in practical applications, will usually execute secondary Higher value, such as 1,000,000,000 times or more are arranged in number.
Step 102, the corresponding fast table default parameters of the host are determined.
The thought objective of the embodiment of the present invention is that the fast watch default parameters of Intrusion Detection based on host determine the fast table missing ginseng of virtual machine Number, since virtual machine is when handling data, needs host to be managed it, to need to consume more times, so that fastly Table default parameters are bigger.
In embodiments of the present invention, the processor operation time that fast watch default parameters can be corresponding for fast table missing every time Number, fast table default parameters are bigger, and it is bigger to represent every time the corresponding time overhead of fast table missing;Fast table default parameters are smaller, represent It is smaller to lack corresponding time overhead for fast table every time.It is appreciated that processor frequencies are different for different processors.
In embodiments of the present invention, due under MIPS framework host support PERF tool to count fast table missing, but virtual machine PERF tool is not supported to count fast table missing, so that the corresponding fast table default parameters of host can unite by existing PERF tool Meter, can also test to obtain by other test programs.
Step 103, according to the execution of first operation duration, second operation duration, the first circulation code Number and the corresponding fast watch default parameters of the host determine the corresponding fast table default parameters of the virtual machine.
Specifically, the difference of the first operation duration and the second operation duration is bigger, represents for identical fast table missing time Number, the processing time of virtual machine are more;The difference of first operation duration and the second operation duration is smaller, represents for identical fast The processing time of table missing times, virtual machine is fewer.
For identical first operation duration and the second operation duration, represent virtual machine relative to host it is not additional when Between expense, so that virtual machine is identical with the fast table default parameters of host.
The corresponding fast table missing of host is more, then the corresponding fast table missing of virtual machine is more;The corresponding fast table missing of host Fewer, then the corresponding fast table missing of virtual machine is fewer, it is believed that the fast table that the fast watch missing times of virtual machine are equal to host lacks Number is lost, but the two causes the time of identical fast table missing times different, so that fast table default parameters are different.
In embodiments of the present invention, the fast watch default parameters of host can lack corresponding processor with the fast table of host single Operation times indicate that the fast watch default parameters of virtual machine can lack corresponding processor operation time with the fast table of virtual machine single Number is to indicate, and single executes first circulation code and introduces the fast table missing of single.
Specifically, in an embodiment of the present invention, the above-mentioned fast table default parameters for calculating virtual machine, may include as Lower sub-step 1031 to 1034:
Sub-step 1031 calculates virtual machine according to first operation duration, the execution number of the first circulation code Duration needed for single executes the first circulation code obtains the first single duration, and, when according to the described second operation The execution number of long, the described first circulation code, duration needed for calculating main frame single executes the first circulation code, obtains Second single duration.
Specifically, the first single duration can be the ratio of the first operation duration and the execution number of first circulation code, Second single duration can be the ratio of the second operation duration and the execution number of first circulation code.
Sub-step 1032 calculates the difference that the first single duration subtracts the second single duration, when obtaining single Length is poor.
It is appreciated that single duration difference is that virtual machine single executes first circulation code than host single execution first circulation The time overhead that code is had more.
Sub-step 1033 calculates virtual machine single and holds according to the processor frequencies of the single duration difference and the host The processor operation times that the row first circulation code is additionally required, it is poor to obtain fast table default parameters.
Specifically, the calculation formula of fast table default parameters difference is the product of the processor frequencies of single duration difference and host, Fast watch default parameters difference is the difference of the fast table default parameters of virtual machine and host.
Sub-step 1034, according to the corresponding fast table default parameters determination of the fast watch default parameters difference and the host The corresponding fast table default parameters of virtual machine.
Wherein, the corresponding fast watch default parameters of virtual machine are fast watch default parameters difference and the corresponding fast table default parameters of host Sum.
Specifically, in an embodiment of the present invention, the above-mentioned fast table default parameters for calculating virtual machine, may include as Lower sub-step 1035 to 1038:
Sub-step 1035 calculates virtual machine according to first operation duration, the execution number of the first circulation code Duration needed for single executes the first circulation code obtains the first single duration, and, when according to the described second operation The execution number of long, the described first circulation code, duration needed for calculating main frame single executes the first circulation code, obtains Second single duration.
The step is identical as sub-step 1031.
Sub-step 1036 calculates virtual machine single according to the processor frequencies of the first single duration and the host The corresponding processor operation times of the first circulation code are executed, the first operation times are obtained, and, it is single according to described second The processor frequencies of secondary duration and the host, calculating main frame single execute the corresponding processor operation of the first circulation code Number obtains the second operation times.
Specifically, the first operation times can be the product of the first single duration and the processor frequencies of host, the second fortune Calculating number can be the product of the second single duration and the processor frequencies of host.
Sub-step 1037 calculates the difference that first operation times subtract second operation times, obtains fast table and lacks Lose parameter difference.
The calculating process sequence of the calculating process and sub-step 1032 to 1033 that are appreciated that sub-step 1036 to 1037 is not Together, essence is identical.
Sub-step 1038, according to the corresponding fast table default parameters determination of the fast watch default parameters difference and the host The corresponding fast table default parameters of virtual machine.
The step is identical as sub-step 1034.
It is appreciated that can also adjust computation sequence according to above-mentioned Computing Principle, the embodiment of the present invention is lacked to fast table is calculated The intermediate sequence for losing parameter is without restriction.
In conclusion in embodiments of the present invention, the first test program is executed on virtual machine and corresponding host respectively, The first operation duration and the second operation duration are obtained, first test program includes being performed a plurality of times lead to fast table missing first Loop code;Determine the corresponding fast table default parameters of the host;When according to first operation duration, second operation The corresponding fast table default parameters of the execution number and the host of long, the described first circulation code determine that the virtual machine is corresponding Fast table default parameters.The above method, which can determine, does not support the fast table of the virtual machine of PERF tool to lack ginseng under MIPS framework Number, and test itself can't introduce fast table missing, help to improve test result.And the test is not limited to MIPS framework Under, it can be used under X86 and ARM framework, there is versatility.
Fig. 2 is the two of the flow chart of the determination method of fast table default parameters provided in an embodiment of the present invention, as shown in Fig. 2, This method may include:
Step 201, execute the first test program on virtual machine and corresponding host respectively, obtain the first operation duration and Second operation duration, first test program include that the first circulation code for leading to fast table missing is performed a plurality of times, and described first The number of pages mesh that data volume that the execution number of loop code includes by preset loop number, every page, each fast table are loaded determines.
Wherein, preset loop number can be set according to practical application scene, and the embodiment of the present invention is without restriction to its.
Every page of data volume for including can be by every page of size divided by the occupancy size of data type, it will be understood that In operating system, data according to page size carry out paging processing, every page of page size be it is fixed, page size can use bit number It indicating, the occupancy size of data type can also be indicated with bit number, but since the occupancy of different types of data is of different sizes, from And even if every page of page size is identical, every page of data volume for including is different.
The bit number and every page of occupied bit number that the number of pages mesh that each fast watch is loaded can occupy for each fast table Ratio.
In embodiments of the present invention, the execution number of first circulation code can include by preset loop number, every page The number of pages mesh that data volume, each fast table are loaded determines, for example, for the first following test program:
In above-mentioned first test program, OVER1 is preset loop number, and DATAMAX is every page of data volume for including, PAGESUM1 is determined according to the number of pages mesh that each fast table is loaded, and is usually arranged as 2 times of number of pages purpose that each fast table is loaded More than, first circulation code is p [i] [j]=i^j (calculating of the exclusive or of i and j), and too many calculating complexity will not be introduced by calculating Degree, thus the execution number LOOP of first circulation code1For OVER1*DATAMAX*PAGESUM1.
Step 202, the corresponding fast table default parameters of the host are determined.
The step is referred to the detailed description of step 102, and details are not described herein.
Optionally, in another embodiment of the invention, step 202 includes sub-step A1 to A2:
Sub-step A1 executes the second test program on the host, obtains third operation duration, the second test journey Sequence includes that the second circulation code for leading to cache miss is performed a plurality of times, and the execution number of the second circulation code is by preset loop The number of pages mesh that number, every page of data volume for including, each L2 cache are loaded determines.
Wherein, preset loop number can be set according to practical application scene, and the embodiment of the present invention is without restriction to its.
Every page of data volume for including is referred to the explanation in step 201, and details are not described herein.
The number of pages mesh that each L2 cache is loaded be each L2 cache size and page size ratio, so as to Guarantee that the second test program only triggers cache miss without triggering fast table missing.
In embodiments of the present invention, the execution number of second circulation code can include by preset loop number, every page The number of pages mesh that data volume, each L2 cache are loaded determines, for example, for the second following test program:
In above-mentioned second test program, OVER2 is preset loop number, can be identical or different with OVER1, DATAMAX is every page of data volume for including, and the number of pages mesh that PAGESUM2 is loaded according to each L2 cache is usually arranged as every The number of pages purpose 2 times or more that a L2 cache is loaded, second circulation code are p [i] [j]=i^j (calculating of the exclusive or of i and j), Its calculating will not introduce too many computation complexity, thus the execution number L O of second circulation code2O is POVER2* DATAMAX*PAGESUM2。
Sub-step A2, according to the third operation duration, second operation duration and the second circulation code It executes number and calculates the corresponding fast table default parameters of the host.
Specifically, the difference between third operation duration and the second operation duration can represent the number of fast table missing, In the embodiment of the present invention, in order to which fast table default parameters corresponding with virtual machine are consistent, place corresponding with the fast table missing of single Managing device operation times indicates fast table default parameters, has carried out turn to the difference between third operation duration and the second operation duration It changes.
Optionally, in another embodiment of the invention, sub-step A2 includes sub-step A21 to A22:
Sub-step A21, according to the execution time of the third operation duration, the second operation duration, the second circulation code The execution number of the several and described first circulation code generated for the second operation time difference, and the second operation time difference is host single The operation duration and host single that execute the first circulation code execute the difference between the second circulation code operation duration Value.
Specifically, the second operation time difference TDIFF2Following formula is referred to be calculated:
Wherein, T2For the second operation duration, LOOP1For the execution number of first circulation code, it is specifically referred to step Detailed description in 201.
T3For third operation duration, LOOP2For the execution number of second circulation code, specifically it is referred in sub-step A1 Detailed description.
The host pair is calculated according to the processor frequencies of the second operation time difference, the host in sub-step A22 The fast table default parameters answered.
Specifically, the corresponding fast table default parameters TLBM1 of host is referred to following formula and is calculated:
Wherein, FRQ is the processor frequencies of host.
Optionally, in another embodiment of the invention, step 202 includes sub-step A3:
Sub-step A3, using the corresponding fast table default parameters of host described in counters count.
In embodiments of the present invention, it for the framework such as MIPS of support counter, can be counted using counter PERF The corresponding fast table default parameters of host.
It should be noted that for PERF count as a result, if being unsatisfactory for demand of the invention, i.e., be not fast with single The fast table default parameters that the corresponding processor operation times of watch missing indicate, can also convert it.
Step 203, the difference that first operation duration subtracts second operation duration is calculated, when obtaining the first operation Difference.
Specifically, the first operation time difference TDIFF1Following formula is referred to be calculated:
TDIFF1=T1-T2 (3)
Wherein, T1For the first operation duration, T2For the second operation duration, T1> T2
It is appreciated that the first operation time difference TDIFF1The overhead time is lacked than the fast table that host has more for virtual machine.
Step 204, when calculating the described first operation according to the processor frequencies of the first operation time difference and the host The corresponding processor operation times of difference.
Specifically, processor operation times NPO is referred to following formula and is calculated:
NPO=TDIFF1FRQ=(T1-T2)·FRQ (4)
Wherein, FRQ is the processor frequencies of host, it will be understood that processor frequencies can processing as unit of in the time Device operation times, thus, it is corresponding that processor operation times NPO can lack the overhead time than the fast table that host has more for virtual machine Processor operation times, i.e., the fast table missing expense that virtual machine has more than host can be indicated with processor operation times, be located Reason device operation times are more, then it is bigger than the fast table missing expense that host has more to represent virtual machine;Processor operation times are fewer, It is more smaller than the fast table missing expense that host has more then to represent virtual machine.
Step 205, virtual machine is calculated according to the execution number of the processor operation times and the first circulation code Single executes the processor operation times that the first circulation code is additionally required, and it is poor to obtain fast table default parameters.
Specifically, fast table default parameters difference NPOP is referred to following formula and is calculated:
Wherein, LOOP1For the execution number of first circulation code, it is specifically referred to the detailed description of step 201, herein It repeats no more.
It is appreciated that fast table default parameters difference is to execute the corresponding processing of the first circulation code relative to host single Device operation times, virtual machine single execute the processor operation times that the first circulation code is additionally required.
Step 206, the void is determined according to the corresponding fast table default parameters of the fast watch default parameters difference and the host The quasi- corresponding fast table default parameters of machine.
Specifically, the corresponding fast table default parameters TLBM2 of virtual machine is referred to following formula and is calculated:
Wherein, TLBM1 is the fast table default parameters for the host that step 202 obtains, it will be understood that the fast table of host lacks ginseng Several fast watch default parameters with virtual machine are indicated with the corresponding processor operation times of the fast table missing of single, if step 201 Obtained fast watch default parameters are not that the corresponding processor operation times of the fast table missing of single indicate, then are converted, For example, needing if the fast watch default parameters that step 201 obtains are the corresponding time overhead of the fast table missing of single multiplied by host Processor frequencies obtain the corresponding processor operation times of single fast table missing.
In conclusion in embodiments of the present invention, the first test program is executed on virtual machine and corresponding host respectively, The first operation duration and the second operation duration are obtained, first test program includes being performed a plurality of times lead to fast table missing first Loop code;Determine the corresponding fast table default parameters of the host;When according to first operation duration, second operation The corresponding fast table default parameters of the execution number and the host of long, the described first circulation code determine that the virtual machine is corresponding Fast table default parameters.The above method, which can determine, does not support the fast table of the virtual machine of PERF tool to lack ginseng under MIPS framework Number, and test itself can't introduce fast table missing, help to improve test result.And the test is not limited to MIPS framework Under, it can be used under X86 and ARM framework, there is versatility.
In addition, the above method can also by the execution duration of the second test program, the fast table default parameters of calculating main frame, Or the fast table default parameters of counters count host are directly used, so that the fast table default parameters of host have certain statistics flexible Property.
Fig. 3 is a kind of one of the structural block diagram of determining device of fast table default parameters provided in an embodiment of the present invention, such as Fig. 3 Shown, the determining device 300 of the fast table default parameters may include:
First test program execution module 301, for executing the first test journey on virtual machine and corresponding host respectively Sequence, obtains the first operation duration and the second operation duration, and first test program includes being performed a plurality of times that fast table is caused to lack First circulation code.
The fast table default parameters determining module 302 of host, for determining the corresponding fast table default parameters of the host.
The fast table default parameters determining module 303 of virtual machine, when for according to first operation duration, second operation The corresponding fast table default parameters of the execution number and the host of long, the described first circulation code determine that the virtual machine is corresponding Fast table default parameters.
In conclusion the method that the determining device of fast table default parameters provided in an embodiment of the present invention can be realized Fig. 1 is real Each process in example is applied, to avoid repeating, which is not described herein again.In embodiments of the present invention, respectively in virtual machine and correspondence Host on execute the first test program, obtain the first operation duration and the second operation duration, first test program includes The first circulation code for leading to fast table missing is performed a plurality of times;Determine the corresponding fast table default parameters of the host;According to described One operation duration, second operation duration, the execution number of the first circulation code and the corresponding fast table of the host Default parameters determine the corresponding fast table default parameters of the virtual machine.The above method, which can determine, does not support PERF under MIPS framework The fast table default parameters of the virtual machine of tool, and test itself can't introduce fast table missing, help to improve test result.And The test is not limited under MIPS framework, can be used under X86 and ARM framework, has versatility.
Optionally, referring to Fig. 4, on the basis of above-mentioned Fig. 3, the determining device of another fast table default parameters is shown Structural block diagram.Wherein, described device 400 can also include:
First test program execution module 401, for executing the first test journey on virtual machine and corresponding host respectively Sequence, obtains the first operation duration and the second operation duration, and first test program includes being performed a plurality of times that fast table is caused to lack First circulation code, it is data volume that the execution number of the first circulation code includes by preset loop number, every page, each fast The number of pages mesh that table is loaded determines.
The fast table default parameters determining module 402 of host, for determining the corresponding fast table default parameters of the host.
The fast table default parameters determining module 403 of virtual machine, when for according to first operation duration, second operation The corresponding fast table default parameters of the execution number and the host of long, the described first circulation code determine that the virtual machine is corresponding Fast table default parameters;Optionally, in another embodiment of the invention, the fast table default parameters determining module of the virtual machine 403, comprising:
First operation time difference computational submodule 4031, when subtracting the described second operation for calculating first operation duration Long difference obtained for the first operation time difference.
Processor operation times computational submodule 4032, for the processing according to the first operation time difference and the host Device frequency calculates the first operation time difference corresponding processor operation times.
Fast table default parameters difference computational submodule 4033, for according to the processor operation times and the first circulation The execution number of code calculates virtual machine single and executes the processor operation times that the first circulation code is additionally required, and obtains Fast table default parameters are poor.
The fast table default parameters computational submodule 4034 of virtual machine, for according to the fast table default parameters difference and the host Corresponding fast watch default parameters determine the corresponding fast table default parameters of the virtual machine.
Optionally, in another embodiment of the invention, the fast table default parameters determining module 402 of the host, comprising:
Second test program implementation sub-module obtains third operation for executing the second test program on the host Duration, second test program include that the second circulation code for leading to cache miss is performed a plurality of times, the second circulation code The execution number data volume that includes by preset loop number, every page, the number of pages mesh that is loaded of each L2 cache determines.
The fast table default parameters of host determine submodule, for according to the third operation duration, second operation duration And the execution number of the second circulation code calculates the corresponding fast table default parameters of the host.
Optionally, in another embodiment of the invention, the fast table default parameters of the host determine submodule, comprising:
Second operation time difference computing unit, for being followed according to the third operation duration, the second operation duration, described second The execution number for executing number and the first circulation code of ring code generates the second operation time difference, second operation The time difference is that host single executes the operation duration of the first circulation code and host single executes the second circulation code and transports Difference between row duration.
The fast table default parameters determination unit of host, for the processor frequency according to the second operation time difference, the host The corresponding fast table default parameters of the host are calculated in rate.
Optionally, in another embodiment of the invention, the fast table default parameters determining module 402 of the host, comprising:
The fast table default parameters statistic submodule of host, for using the corresponding fast table missing ginseng of host described in counters count Number.
In conclusion the method that the determining device of fast table default parameters provided in an embodiment of the present invention can be realized Fig. 2 is real Each process in example is applied, to avoid repeating, which is not described herein again.
The determining device of fast table default parameters provided in an embodiment of the present invention is joined except having fast table shown in Fig. 3 to lack Outside beneficial effect possessed by several determining devices, can also by the execution duration of the second test program, calculating main frame it is fast Table default parameters, or the fast table default parameters of counters count host are directly used, so that the fast table default parameters of host have one Fixed statistics flexibility.
Embodiment of the disclosure additionally provides a kind of electronic equipment, referring to Fig. 5, comprising: processor 501, memory 502 with And it is stored in the computer program 5021 that can be run on the memory 502 and on the processor, the processor 501 is held The personalized recommendation method of previous embodiment is realized when row described program.
Embodiment of the disclosure additionally provides a kind of readable storage medium storing program for executing, when the instruction in the storage medium is set by electronics When standby processor executes, so that electronic equipment is able to carry out the personalized recommendation method of previous embodiment.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple Place illustrates referring to the part of embodiment of the method.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein. Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system Structure be obvious.In addition, embodiment of the disclosure is also not for any particular programming language.It should be understood that can be with The content of embodiment of the disclosure described herein is realized using various programming languages, and is retouched above to what language-specific was done Stating is preferred forms in order to disclose embodiment of the disclosure.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the disclosure The embodiment of example can be practiced without these specific details.In some instances, it is not been shown in detail well known Methods, structures and technologies, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, Above in the description of the exemplary embodiment of embodiment of the disclosure, each feature of embodiment of the disclosure is sometimes by together It is grouped into single embodiment, figure or descriptions thereof.However, it is as follows that the method for the disclosure should not be construed to reflection Be intended to: embodiment of the disclosure i.e. claimed requires more more than feature expressly recited in each claim Feature.More precisely, as reflected in the following claims, inventive aspect is single less than disclosed above All features of embodiment.Therefore, it then follows thus claims of specific embodiment are expressly incorporated in the specific embodiment party Formula, wherein separate embodiments of each claim as embodiment of the disclosure itself.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose It replaces.
The various component embodiments of embodiment of the disclosure can be implemented in hardware, or in one or more processing The software module run on device is realized, or is implemented in a combination thereof.It will be understood by those of skill in the art that can be in reality It tramples and middle realizes that personalized recommendation according to an embodiment of the present disclosure is set using microprocessor or digital signal processor (DSP) The some or all functions of some or all components in standby.Embodiment of the disclosure is also implemented as executing this In described method some or all device or device programs.Such journey for realizing embodiment of the disclosure Sequence can store on a computer-readable medium, or may be in the form of one or more signals.Such signal can To download from internet website, perhaps it is provided on the carrier signal or is provided in any other form.
It should be noted that above-described embodiment illustrates rather than to embodiment of the disclosure embodiment of the disclosure It is limited, and those skilled in the art can be designed replacement without departing from the scope of the appended claims and implement Example.In the claims, any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of element or step not listed in the claims.Word "a" or "an" located in front of the element is not There are multiple such elements for exclusion.Embodiment of the disclosure can be by means of including the hardware of several different elements and borrowing Help properly programmed computer to realize.In the unit claims listing several devices, several in these devices A can be is embodied by the same item of hardware.The use of word first, second, and third does not indicate any suitable Sequence.These words can be construed to title.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
The foregoing is merely the preferred embodiments of embodiment of the disclosure, not to limit the implementation of the disclosure Example, all made any modifications, equivalent replacements, and improvements etc. within the spirit and principle of embodiment of the disclosure should all include Within the protection scope of embodiment of the disclosure.
The above, the only specific embodiment of embodiment of the disclosure, but the protection scope of embodiment of the disclosure It is not limited thereto, anyone skilled in the art, can in the technical scope that embodiment of the disclosure discloses Change or replacement are readily occurred in, should all be covered within the protection scope of embodiment of the disclosure.Therefore, embodiment of the disclosure Protection scope should be subject to the protection scope in claims.

Claims (10)

1. a kind of determination method of fast table default parameters, which is characterized in that the described method includes:
The first test program is executed on virtual machine and corresponding host respectively, when obtaining the first operation duration and the second operation Long, first test program includes that the first circulation code for leading to fast table missing is performed a plurality of times;
Determine the corresponding fast table default parameters of the host;
According to first operation duration, second operation duration, the execution number of the first circulation code and described The corresponding fast watch default parameters of host determine the corresponding fast table default parameters of the virtual machine.
2. the method according to claim 1, wherein it is described according to first operation duration, it is described second fortune Row duration, the execution number of the first circulation code and the corresponding fast table default parameters of the host determine the virtual machine Corresponding fast table default parameters, comprising:
The difference that first operation duration subtracts second operation duration is calculated, obtained for the first operation time difference;
According to first operation time difference processing corresponding with the processor frequencies of the host calculating first operation time difference Device operation times;
According to the calculating virtual machine single execution of the execution number of the processor operation times and the first circulation code It is poor to obtain fast table default parameters for the processor operation times that first circulation code is additionally required;
Determine that the virtual machine is corresponding fast according to the corresponding fast watch default parameters of the fast watch default parameters difference and the host Table default parameters.
3. the method according to claim 1, wherein the corresponding fast table default parameters of the determination host, Include:
The second test program is executed on the host, obtains third operation duration, and second test program includes repeatedly holding Row leads to the second circulation code of cache miss;
Institute is calculated according to the execution number of the third operation duration, second operation duration and the second circulation code State the corresponding fast table default parameters of host.
4. according to the method described in claim 3, it is characterized in that, it is described according to the third operation duration, it is described second fortune The execution number of row duration and the second circulation code calculates the corresponding fast table default parameters of the host, comprising:
According to the third operation duration, the second operation duration, the execution number of the second circulation code and described first The execution number of loop code generated for the second operation time difference, and the second operation time difference is that host single execution described first follows The operation duration and host single of ring code execute the difference between the second circulation code operation duration;
The corresponding fast table missing ginseng of the host is calculated according to the processor frequencies of the second operation time difference, the host Number.
5. the method according to claim 1, wherein the corresponding fast table default parameters of the determination host, Include:
Using the corresponding fast table default parameters of host described in counters count.
6. the method according to any of claims 1 to 5, which is characterized in that the execution of the first circulation code The number of pages mesh that data volume that number includes by preset loop number, every page, each fast table are loaded determines.
7. the method according to claim 3 or 4, which is characterized in that the execution number of the second circulation code is by presetting The number of pages mesh that cycle-index, every page of data volume for including, each L2 cache are loaded determines.
8. a kind of determining device of fast table default parameters, which is characterized in that the described method includes:
First test program execution module is obtained for executing the first test program on virtual machine and corresponding host respectively First operation duration and the second operation duration, first test program include that the first circulation for leading to fast table missing is performed a plurality of times Code;
The fast table default parameters determining module of host, for determining the corresponding fast table default parameters of the host;
The fast table default parameters determining module of virtual machine, for according to first operation duration, second operation duration, described The corresponding fast watch default parameters of the execution number and the host of first circulation code determine the corresponding fast table of the virtual machine Default parameters.
9. a kind of electronic equipment, which is characterized in that including processor, memory and be stored on the memory and can be described The computer program run on processor realizes such as claim 1 to 7 times when the computer program is executed by the processor The determination method of fast table default parameters described in one.
10. a kind of computer readable storage medium, which is characterized in that store computer journey on the computer readable storage medium Sequence realizes the determination of the fast table default parameters as described in claim 1 to 7 is any when the computer program is executed by processor Method.
CN201910473368.2A 2019-05-31 2019-05-31 Method and device for determining missing parameters of fast table Active CN110188026B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910473368.2A CN110188026B (en) 2019-05-31 2019-05-31 Method and device for determining missing parameters of fast table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910473368.2A CN110188026B (en) 2019-05-31 2019-05-31 Method and device for determining missing parameters of fast table

Publications (2)

Publication Number Publication Date
CN110188026A true CN110188026A (en) 2019-08-30
CN110188026B CN110188026B (en) 2023-05-12

Family

ID=67719768

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910473368.2A Active CN110188026B (en) 2019-05-31 2019-05-31 Method and device for determining missing parameters of fast table

Country Status (1)

Country Link
CN (1) CN110188026B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2024444A1 (en) * 1989-10-20 1991-04-21 Geoffrey O. Blandy Process using virtual addressing in a non-privileged instruction to control the copying of a page of data in or between multiple media
US20060026383A1 (en) * 2004-07-31 2006-02-02 Dinechin Christophe De Method for efficient virtualization of physical memory in a virtual-machine monitor
CN101246452A (en) * 2007-02-12 2008-08-20 国际商业机器公司 Method and apparatus for fast performing MMU analog, and total system simulator
CN102360339A (en) * 2011-10-08 2012-02-22 浙江大学 Method for improving utilization efficiency of TLB (translation lookaside buffer)
CN104156255A (en) * 2014-07-31 2014-11-19 华为技术有限公司 Virtual machine migration method, virtual machine migration device and source physical host
CN107193631A (en) * 2017-04-28 2017-09-22 华中科技大学 A kind of virtual time piece dispatching method detected based on the Parallel application stage and system
CN107577616A (en) * 2017-09-05 2018-01-12 郑州云海信息技术有限公司 A kind of method and system for dividing final stage shared buffer memory

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2024444A1 (en) * 1989-10-20 1991-04-21 Geoffrey O. Blandy Process using virtual addressing in a non-privileged instruction to control the copying of a page of data in or between multiple media
US20060026383A1 (en) * 2004-07-31 2006-02-02 Dinechin Christophe De Method for efficient virtualization of physical memory in a virtual-machine monitor
CN101246452A (en) * 2007-02-12 2008-08-20 国际商业机器公司 Method and apparatus for fast performing MMU analog, and total system simulator
CN102360339A (en) * 2011-10-08 2012-02-22 浙江大学 Method for improving utilization efficiency of TLB (translation lookaside buffer)
CN104156255A (en) * 2014-07-31 2014-11-19 华为技术有限公司 Virtual machine migration method, virtual machine migration device and source physical host
CN107193631A (en) * 2017-04-28 2017-09-22 华中科技大学 A kind of virtual time piece dispatching method detected based on the Parallel application stage and system
CN107577616A (en) * 2017-09-05 2018-01-12 郑州云海信息技术有限公司 A kind of method and system for dividing final stage shared buffer memory

Also Published As

Publication number Publication date
CN110188026B (en) 2023-05-12

Similar Documents

Publication Publication Date Title
US10146685B2 (en) Garbage collection and other management of memory heaps
AU2013233830B2 (en) Controlling operation of a run-time instrumentation facility from a lesser-privileged state
US10169239B2 (en) Managing a prefetch queue based on priority indications of prefetch requests
US8104036B2 (en) Measuring processor use in a hardware multithreading processor environment
KR102424121B1 (en) Pre-fetch unit, apparatus having the same and operating method thereof
EP2825963B1 (en) Run-time instrumentation reporting
US9454462B2 (en) Run-time instrumentation monitoring for processor characteristic changes
EP2825961B1 (en) Run-time instrumentation directed sampling
JP6995124B2 (en) Protected storage event handling during transaction execution
WO2013136703A1 (en) Modifying run-time-instrumentation controls from a lesser-privileged state
WO2013136706A1 (en) Determining the status of run-time-instrumentation controls
WO2013136681A1 (en) Run-time instrumentation indirect sampling by address
CN107102950A (en) A kind of applied program testing method and device
US9442818B1 (en) System and method for dynamic data collection
CN108614763A (en) A kind of adjustment method and device of application
CN110188026A (en) The determination method and device of fast table default parameters
CN109902001A (en) To the detection method and terminal device of uninitialized variable
CN109782978A (en) List content choosing method and device
WO2013136680A1 (en) Run-time-instrumentation controls emit instruction
CN104462368A (en) Data calculating method, device and server
Vandierendonck et al. On the Impact of OS and Linker Effects on Level-2 Cache Performance
Tallent et al. Diagnosing Network Bottlenecks: One-sided Message Contention

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
CB02 Change of applicant information

Address after: 100095 Building 2, Longxin Industrial Park, Zhongguancun environmental protection technology demonstration park, Haidian District, Beijing

Applicant after: Loongson Zhongke Technology Co.,Ltd.

Address before: 100095 Building 2, Longxin Industrial Park, Zhongguancun environmental protection technology demonstration park, Haidian District, Beijing

Applicant before: LOONGSON TECHNOLOGY Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant