Storage capacity analysis method and apparatus for computing device

By acquiring and analyzing the performance data of the cache medium, the upper limit of its capacity that can be reduced was determined, thus solving the problem of low cache medium utilization efficiency and achieving efficient cache medium management and improved processor performance.

WO2025227824A1PCT designated stage Publication Date: 2025-11-06HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/070371
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-30
Filing Date
2025-01-03
Publication Date
2025-11-06

AI Technical Summary

Technical Problem

Existing technologies cannot effectively manage the capacity of cache media, resulting in low efficiency and an inability to optimize the configuration and use of cache media.

Method used

By acquiring performance data from the business application during runtime, the available capacity of the cache medium can be reduced, and the upper limit of the cache medium reduction can be determined based on the performance data, so as to effectively manage the capacity of the cache medium and improve its utilization efficiency.

Benefits of technology

Without significantly impacting the performance of business applications, optimize the configuration of the cache medium, improve the efficiency of cache medium usage, and utilize the reduced cache medium space to deploy other components to enhance the overall performance of the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025070371_06112025_PF_FP_ABST
    Figure CN2025070371_06112025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of storage, and discloses a storage capacity analysis method and apparatus for a computing device. A processor of the computing device is provided with a cache medium. The cache medium is arranged outside a processor core of the processor. The processor is used for running a service application program. The method comprises: a processor acquires first performance data when a service application program is running; the processor acquires second performance data when the service application program is running on the basis of the cache medium of which the capacity is reduced; and on the basis of the extent of degradation of the running performance indicated by the second performance data obtained after capacity reduction compared to the running performance indicated by the first performance data, the processor determines an upper limit value of capacity of the cache medium that can be reduced. On the premise that the impact of the available capacity of the cache medium on the running performance of the service application program is controlled to be within an acceptable range, the present application can determine the upper limit value of capacity of the cache medium that can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Storage capacity analysis method and device of computing device

[0001] The present application claims priority from the Chinese patent application No. 202410547073.6, filed on April 30, 2024, and entitled "Storage capacity analysis method and device of computing device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the field of storage technology, in particular to a storage capacity analysis method and device of a computing device. BACKGROUND

[0003] A cache medium is usually provided in a processor of a computing device. The cache medium is a high-speed memory used to store data and instructions frequently accessed by the processor, so as to reduce the number of times of accessing the memory by the processor, thereby improving the system performance.

[0004] At present, the computing device can manage the cache medium through some instructions. For example, the computing device can use the top command to dynamically and real-timely display the resource occupation of the process in the computing device. The top command is equivalent to the function of the resource manager under Windows. In addition, some tools can be used to analyze the memory / cache usage of the Windows system. For example, in addition to the system self-provided task manager (task manager), resource monitor (resource manager), performance monitor (performance monitor), there are SysInternals tools, such as RAMMap and PoolMon, which can be used to analyze the cache problem.

[0005] However, these cannot analyze the capacity of the cache medium, so that the computing device cannot effectively manage the cache medium, resulting in the problem of low use efficiency of the cache medium. SUMMARY

[0006] The present application provides a storage capacity analysis method and device of a computing device. The present application can determine the upper limit value of the capacity of the cache medium that can be reduced, on the premise that the influence of reducing the available capacity of the cache medium on the running performance of the business application program is controlled within an acceptable range, so as to effectively manage the cache medium based on the upper limit value. The technical solution provided by the present application is as follows:

[0007] In a first aspect, the present application provides a method for analyzing storage capacity of a computing device. The computing device is provided with a cache medium in a processor. The cache medium is arranged outside of a processor core of the processor. The processor is configured to run a business application. The method comprises: obtaining, by the processor, first performance data of the business application when running based on the cache medium, the first performance data being indicative of running performance of the business application when running based on the cache medium; reducing, by the processor, available capacity of the cache medium; obtaining, by the processor, second performance data of the business application when running based on the cache medium with the reduced capacity, the second performance data being indicative of running performance of the business application when running based on the cache medium with the reduced capacity; and determining, by the processor, an upper limit of the capacity of the cache medium that can be reduced based on a degree of deterioration of the running performance indicated by the second performance data relative to the running performance indicated by the first performance data.

[0008] In this way, the method can determine the upper limit of the capacity of the cache medium that can be reduced based on the performance of the business application, and control the impact of reducing the available capacity of the cache medium on the running performance of the business application within an acceptable range, so as to effectively manage the cache medium based on the upper limit. For example, storage units with a total capacity not greater than the upper limit in the cache medium can be used to store data other than cache data, so as to improve the use efficiency of the cache medium. For another example, in the process of producing the processor, the cache medium to be configured for the processor can be selected according to the upper limit, so as to realize accurate pairing of the business application and the capacity of the cache medium. At the same time, the occupied area reduced due to the reduction of the capacity of the cache medium can be used for other purposes, such as deploying other components of the processor in the area, so as to improve the overall performance of the processor. Wherein, the smaller the capacity of the cache medium, the smaller the area occupied by the cache medium, and therefore, when the cache medium with a smaller capacity is configured for the processor, the area occupied by the cache medium in the processor is smaller. It should be noted that the upper limit can also be used in other scenarios, which will not be exemplified here.

[0009] In a possible implementation, the processor determines the upper limit of the capacity that can be reduced from the cache medium based on the degree of performance degradation of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data, including: when the degree of performance degradation of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data is not greater than a degradation threshold, the processor repeatedly performs the capacity adjustment process until the degree of performance degradation of the running performance indicated by the second performance data obtained after the capacity is continuously reduced compared with the running performance indicated by the first performance data is greater than the degradation threshold, and then determines the upper limit based on the capacity that is reduced from the cache medium for multiple times. The capacity adjustment process includes: continuously reducing the available capacity of the cache medium, and obtaining the second performance data of the running of the business application based on the cache medium after the capacity is continuously reduced. By gradually increasing the capacity reduced from the cache medium, the impact on the running performance of the business application can be effectively reduced in the process of determining the upper limit of the capacity that can be reduced from the cache medium.

[0010] In a possible implementation, the processor determines the upper limit based on the capacity that is reduced from the cache medium for multiple times, including: when the degree of performance degradation of the running performance indicated by the second performance data obtained after the capacity is continuously reduced compared with the running performance indicated by the first performance data is greater than the degradation threshold for the first time, the processor determines the sum of the capacity that is reduced from the cache medium before the current capacity reduction as the upper limit. In this way, the impact of reducing the available capacity of the cache medium on the running performance of the business application can be controlled within an acceptable range.

[0011] In a possible implementation, the processor determines the upper limit of the capacity that can be reduced from the cache medium based on the degree of performance degradation of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data, including: when the degree of performance degradation of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data is not greater than a degradation threshold, the processor determines the upper limit as 0. At this time, the method further includes: restoring the available capacity of the cache medium to the value before the capacity is reduced.

[0012] In a possible implementation, when a storage unit in the cache medium is allocated to the business application by the processor, the processor can mark the use state of the storage unit as used, so that the processor will not allocate the storage unit to the business application again. Similarly, the processor sets the target storage unit to the unavailable state, which can also be implemented by setting a state flag for the target storage unit by the processor. For example, the processor marks the use state of the target storage unit as used to achieve the purpose of setting the target storage unit to the unavailable state.

[0013] In a possible implementation, before the processor reduces the available capacity of the cache medium, the method further includes: the processor migrating data stored in at least one target storage unit in the cache medium to other storage units or memory, the other storage units being storage units in the cache medium other than the at least one target storage unit, and the available capacity of the cache medium to be reduced being the capacity of the at least one target storage unit. Before the processor reduces the available capacity of the cache medium, the processor can avoid the data stored in the target storage unit from being unable to be used by the processor after the available capacity of the cache medium is reduced, so that the data can continue to be used by the processor, and thus the business application can continue to run based on the data.

[0014] In a possible implementation, the processor includes a plurality of core sets, each core set including one or more processor cores, the cache medium includes a plurality of sub-media corresponding configured for the plurality of core sets, and the plurality of target storage units include storage units distributed in each of the plurality of sub-media. The available capacity of the cache medium to be reduced is the capacity of the plurality of target storage units. For example, the plurality of target storage units are distributed in the plurality of sub-media with the same capacity.

[0015] When the plurality of target storage units include storage units distributed in each of the plurality of sub-media, it can be ensured that after the capacity of the plurality of target storage units is reduced, the plurality of core sets can all cache data using storage units in the sub-media corresponding distributed near the plurality of core sets other than the plurality of target storage units. When a processor core in the plurality of core sets needs to cache data, the data can be preferentially cached in the sub-media distributed near the processor core, without the need to cache the data in a storage medium at a farther location, such as in the memory or the sub-media corresponding to another core set. In this way, since the speed of various storage media in the computing device generally shows a positive correlation with the distance of the storage medium to the processor, it can be ensured that there is no significant difference in the access performance of the sub-media used by the plurality of core sets to cache data. When the plurality of storage units are distributed in the storage units in the plurality of sub-media with the same capacity, if the capacities of the plurality of sub-media are equal, it can be ensured that the capacities of the plurality of sub-media used to cache data are equal after the available capacity of the cache medium is reduced. Since the access performance of the cache medium is positively correlated with the capacity of the cache medium that can be used for caching, it can be ensured that the access performance of the plurality of sub-media remains basically flat after the available capacity of the cache medium is reduced, and thus the performance of the entire processor is at a high level.

[0016] In a possible implementation, the available capacity of the cache medium to be reduced is an integer multiple of the capacity of one storage unit. In this way, the control efficiency can be ensured when the available capacity of the cache medium is reduced.

[0017] In a second aspect, the present application provides a storage capacity analysis apparatus of a computing device. A cache medium is arranged in a processor of the computing device. The cache medium is arranged outside a processor core of the processor. The processor is configured to run a business application. The apparatus comprises: an obtaining module configured to obtain first performance data of the business application when running based on the cache medium, the first performance data being indicative of a running performance of the business application when running based on the cache medium; the obtaining module is further configured to obtain second performance data of the business application when running based on the cache medium after a capacity reduction, the second performance data being indicative of a running performance of the business application when running based on the cache medium after the capacity reduction; and a processing module configured to determine an upper limit of the capacity reduction of the cache medium based on a degree of deterioration of the running performance indicated by the second performance data obtained after the capacity reduction relative to the running performance indicated by the first performance data.

[0018] In a possible implementation, the processing module is specifically configured to: when the degree of deterioration of the running performance indicated by the second performance data obtained after the capacity reduction relative to the running performance indicated by the first performance data is not greater than a deterioration threshold, repeatedly perform a capacity adjustment process until the degree of deterioration of the running performance indicated by the second performance data of the business application when running based on the cache medium after a further capacity reduction relative to the running performance indicated by the first performance data is greater than the deterioration threshold, and then determine the upper limit based on the capacity of the cache medium reduced for multiple times. The capacity adjustment process comprises: continuously reducing the available capacity of the cache medium, and obtaining the second performance data of the business application when running based on the cache medium after the further capacity reduction.

[0019] In a possible implementation, the processing module is specifically configured to: when the degree of deterioration of the running performance indicated by the second performance data obtained after the capacity reduction relative to the running performance indicated by the first performance data is initially greater than the deterioration threshold, determine a sum of the capacity of the cache medium reduced before the current capacity reduction as the upper limit.

[0020] In a possible implementation, the processing module is specifically configured to: when the degree of deterioration of the running performance indicated by the second performance data obtained after the capacity reduction relative to the running performance indicated by the first performance data is not greater than the deterioration threshold, determine the upper limit as 0. At this time, the processing module is further configured to restore the available capacity of the cache medium to a value before the capacity reduction.

[0021] In a possible implementation, the processing module is specifically configured to: set at least one target storage unit in the cache medium to an unavailable state, and the available capacity of the cache medium reduced is a capacity of the at least one target storage unit.

[0022] In a possible implementation, the processing module is further configured to migrate data stored in the at least one target storage unit in the cache medium to other storage units or memory, the other storage units being storage units in the cache medium other than the at least one target storage unit, and the reduced available capacity of the cache medium being the capacity of the at least one target storage unit.

[0023] In a possible implementation, the processor includes a plurality of core sets, each core set including one or more processor cores, the cache medium includes a plurality of sub-media corresponding configured for the plurality of core sets, and the plurality of target storage units include storage units distributed in each of the plurality of sub-media, and the reduced available capacity of the cache medium is the capacity of the plurality of target storage units.

[0024] In a possible implementation, the plurality of target storage units are distributed in the plurality of sub-media in the same capacity.

[0025] In a possible implementation, the reduced available capacity of the cache medium is an integer multiple of the capacity of one storage unit.

[0026] In a third aspect, the present application provides a storage capacity adjustment method of a computing device. The computing device is provided with a cache medium in a processor of the computing device, and the cache medium is arranged outside processor cores of the processor. The storage capacity adjustment method includes: determining, by the processor, a first storage unit in the cache medium, the total capacity of the first storage unit being less than or equal to an upper limit value of a reducible capacity of the cache medium; transferring, by the processor, management authority of the first storage unit to an operating system of the computing device; and allocating, by the operating system, the first storage unit to a service application running in the processor after receiving a memory application request of the service application.

[0027] In this way, the first storage unit in the cache medium can be used as memory, which is equivalent to reducing the total capacity of the cache medium that can actually be used by the processor. Since the actual usage of the cache medium is in the total capacity of the cache medium that can actually be used by the processor, it reflects the capacity usage efficiency of the cache medium. Under the premise that the actual usage of the cache medium does not change relative to when the storage unit in the cache medium is not used as memory, by using the first storage unit in the cache medium as memory, the total capacity of the cache medium that can actually be used by the processor is reduced, which is equivalent to improving the capacity usage efficiency of the cache medium. Moreover, since the physical form of the first storage unit is still the physical form of the cache medium, it has a larger transmission bandwidth and a smaller transmission latency than the memory arranged outside the processor, so by using the first storage unit as memory, the average bandwidth of the storage medium used as memory can also be improved, and the average latency of the storage medium used as memory can be reduced, thereby improving the overall memory performance of the storage medium used as memory.

[0028] In a possible implementation, when the total capacity of the first storage unit is less than the upper limit of the reducible capacity of the cache medium, the method further comprises: when the first storage unit is used up, the processor determines a second storage unit in the cache medium, and the total capacity of the first storage unit and the second storage unit is less than or equal to the upper limit of the reducible capacity of the cache medium; the processor transfers the management right of the second storage unit to the operating system; and the operating system allocates the second storage unit to the service application program running in the processor after receiving a memory application request of the service application program. At this time, the first storage unit and the second storage unit are both used as memory. Similarly, when the second storage unit is used up, if the total capacity of the first storage unit and the second storage unit does not reach the upper limit of the reducible capacity of the cache medium, the processor can continue to determine a third storage unit in the cache medium, and transfer the management right of the third storage unit to the operating system, so as to continue to use the third storage unit as memory. At this time, the first storage unit, the second storage unit and the third storage unit are all used as memory. This cycle continues until the total capacity of the storage units used as memory in the cache medium reaches the upper limit of the reducible capacity of the cache medium.

[0029] The process is equivalent to first using the storage unit with less capacity in the cache medium as memory, and then gradually increasing the storage unit used as memory when the storage unit is used up, until the total capacity of the storage unit used as memory in the cache medium reaches the upper limit of the reducible capacity of the cache medium. Since the cache medium has a speed advantage over the memory, and the storage unit in the cache medium can continue to be used by the processor to cache data when not used as memory, by gradually increasing the storage unit used as memory, the speed advantage of the cache medium can be used to a large extent to ensure the running performance of the service application program. Moreover, since the current cache medium generally has the problem of low capacity utilization efficiency, and the upper limit of the reducible capacity of the cache medium is the upper limit of the capacity that can be reduced by the cache medium under the premise of ensuring the running performance of the service application program. Therefore, even if the storage unit in the cache medium with a total capacity less than the upper limit of the reducible capacity of the cache medium is used as memory, the impact on the running performance of the service application program is within a controllable range, and the running performance of the service application program can still be maintained in a good state.

[0030] In a possible implementation, the storage unit in the cache medium managed by the operating system is a target storage unit, and the processor transfers the management right of the target storage unit to the operating system, including: the processor sets the target storage unit to a lock state, and instructs the operating system to manage the target storage unit. When the first storage unit is in the lock state, the processor cannot allocate the first storage unit to the service application. Therefore, the processor sets the first storage unit to the lock state, so that the processor cannot continue to use the first storage unit, and thus, after the processor transfers the management right of the first storage unit to the operating system, the first storage unit cannot be allocated by both the processor and the operating system, and the effectiveness of the management right of the first storage unit by the operating system is ensured.

[0031] In a possible implementation, the storage unit in the cache medium managed by the operating system is a target storage unit, and before the processor transfers the management right of the target storage unit to the operating system, the method further includes: the processor migrates data stored in the target storage unit to other storage units or memory, and the other storage units are storage units other than the target storage unit in the cache medium.

[0032] Before the processor transfers the management right of the first storage unit to the operating system of the computing device, the processor migrates data stored in the first storage unit to other storage units or memory, so that the data stored in the first storage unit can continue to be used by the processor after the first storage unit is managed by the operating system, and the service application can continue to run based on the data.

[0033] In a possible implementation, the processor includes a plurality of core sets, each core set includes one or more processor cores, the cache medium includes a plurality of sub-medium corresponding to the plurality of core sets, and the storage unit in the cache medium managed by the operating system includes storage units distributed in each of the plurality of sub-medium. In an example, the storage units in the cache medium managed by the operating system are distributed in storage units in the plurality of sub-medium, and the capacities of the storage units are the same.

[0034] When the first storage unit includes storage units distributed in each of the plurality of sub-media, it can be ensured that each of the plurality of core sets can cache data using the storage units distributed in the sub-media near the core set, excluding the first storage unit. When a processor in the plurality of core sets needs to cache data, the data can be preferentially cached in the sub-media near the processor, without being cached in a storage medium at a farther location, such as a memory or a sub-media corresponding to another core set. In this way, since the speed of various storage media in the computing device generally increases with the distance of the storage medium from the processor, it can be ensured that the access performance of the sub-media used by the plurality of core sets to cache data does not differ significantly. When the capacities of the storage units in the plurality of sub-media where the first storage unit is distributed are equal, if the capacities of the plurality of sub-media are equal, it can be ensured that the capacities of the plurality of sub-media used to cache data are equal. Since the access performance of a cache medium is positively correlated with the capacity of the cache medium that can be used for caching, it can be ensured that the access performance of the plurality of sub-media is substantially flat, thereby ensuring that the performance of the entire processor is at a high level.

[0035] In a possible implementation, the storage units in the cache medium managed by the operating system are mapped into one or more isolated storage spaces. When the first storage unit is mapped into a plurality of isolated storage spaces, since the plurality of storage spaces are isolated, it can be ensured that the data stored in the plurality of storage spaces do not interfere with each other, thereby ensuring that the data has high security.

[0036] In a fourth aspect, the present application provides a computing device, the computing device having a processor and a cache medium disposed outside the processor core of the processor, the computing device further comprising an operating system; the processor is configured to determine a first storage unit in the cache medium, the total capacity of the first storage unit being less than or equal to an upper limit of the reducible capacity of the cache medium; the processor is configured to transfer the management right of the first storage unit to the operating system; and the operating system is configured to allocate the first storage unit to a service application running in the processor after receiving a memory application request of the service application.

[0037] In a possible implementation, the processor is further configured to, when the total capacity of the first storage unit is less than the upper limit of the reducible capacity of the cache medium, determine a second storage unit in the cache medium when the first storage unit is used up, the total capacity of the first storage unit and the second storage unit being less than or equal to the upper limit of the reducible capacity of the cache medium; the processor is further configured to transfer the management right of the second storage unit to the operating system; and the operating system is further configured to allocate the second storage unit to the service application running in the processor after receiving a memory application request of the service application.

[0038] In a possible implementation, the storage unit in the cache medium managed by the operating system is the target storage unit. The processor is specifically configured to set the target storage unit to the locked state, and instruct the operating system to manage the target storage unit.

[0039] In a possible implementation, the storage unit in the cache medium managed by the operating system is the target storage unit. The processor is further configured to migrate data stored in the target storage unit to other storage units or memory before transferring the management right of the target storage unit to the operating system, the other storage units being storage units in the cache medium except the target storage unit.

[0040] In a possible implementation, the processor includes a plurality of core sets, each core set including one or more processor cores, the cache medium includes a plurality of sub-mediums corresponding to the plurality of core sets, and the storage unit in the cache medium managed by the operating system includes storage units distributed in each of the plurality of sub-mediums.

[0041] In a possible implementation, the storage unit in the cache medium managed by the operating system is distributed in the plurality of sub-mediums, and the capacities of the storage units in the plurality of sub-mediums are the same.

[0042] In a possible implementation, the storage unit in the cache medium managed by the operating system is mapped to one or more isolated storage spaces.

[0043] In a fifth aspect, the present application provides a computing device, including a processor and a plurality of memories, and the memories store program instructions, and the processor executes the program instructions, so that the computing device executes the method provided in the first or third aspect and any possible implementation manner thereof.

[0044] In a sixth aspect, the present application provides a computer readable storage medium, including program instructions, and when the program instructions are executed on a computing device, the computing device executes the method provided in the first or third aspect and any possible implementation manner thereof.

[0045] In a seventh aspect, the present application provides a computer program product including instructions, and when the instructions are executed on a computing device, the computing device executes the method provided in the first or third aspect and any possible implementation manner thereof. BRIEF DESCRIPTION OF DRAWINGS

[0046] FIG. 1 is a schematic diagram of a storage medium in a computing device according to an embodiment of the present application;

[0047] FIG. 2 is a structural schematic diagram of a computing device according to an embodiment of the present application;

[0048] FIG. 3 is a flow chart of a storage capacity analysis method of a computing device according to an embodiment of the present application;

[0049] FIG. 4 is a logic diagram of a storage capacity analysis method of a computing device according to an embodiment of the present application;

[0050] FIG. 5 is a schematic diagram of setting a target storage unit to an unavailable state according to an embodiment of the present application;

[0051] FIG. 6 is a flow chart of another storage capacity analysis method of a computing device according to an embodiment of the present application;

[0052] FIG. 7 is a flow chart of a storage capacity adjustment method of a computing device according to an embodiment of the present application;

[0053] FIG. 8 is a schematic diagram of determining a first storage unit in an L3 cache according to an embodiment of the present application;

[0054] FIG. 9 is a flow chart of another storage capacity adjustment method of a computing device according to an embodiment of the present application;

[0055] FIG. 10 is a schematic diagram of a first storage unit mapping to a memory space according to an embodiment of the present application;

[0056] FIG. 11 is a schematic diagram of a storage capacity analysis apparatus of a computing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0057] For the purpose of making the purpose, technical scheme and advantages of the present application more clear, the embodiments of the present application will be described in further detail below with reference to the drawings.

[0058] The processor in the computing device is used to run a business application, and the storage medium is used to store instructions and data required by the business application. A plurality of storage media are usually provided in the computing device. For example, as shown in FIG. 1, the computing device is provided with a cache medium, an internal memory (also referred to as a memory) and an external storage. The cache medium is arranged inside the processor, and the memory and the external storage are arranged outside the processor. The speeds of the cache medium, the memory and the external storage decrease in turn. When reading data, the processor first reads from the cache medium. When the cache medium does not store the data required to be read, the processor reads from the memory. When the memory does not store the data required to be read, the processor reads from the external storage. The cache medium can be further divided into multiple levels of cache, and the speeds of different levels of cache are different. Moreover, some levels of cache are arranged inside the processor core, and some levels of cache are arranged outside the processor core. For example, the cache medium can be divided into three levels of cache with decreasing speeds, and the three levels of cache are a first level L1 cache, a second level L2 cache and a third level L3 cache. The L1 cache and the L2 cache are arranged inside the processor core, and the L3 cache is arranged outside the processor core. It should be noted that the cache medium can also be divided into more or fewer levels of cache, which is not limited herein. The speed of the storage medium can be determined by the bandwidth used for data transmission between the storage medium and the processor and the running frequency of the storage medium. The faster the speed of the storage medium, the better the memory access performance of the storage medium. The speeds of various storage media in the computing device are generally positively correlated with the distances of the storage media to the processor.

[0059] Cache medium is a high-speed storage medium used to store data and instructions in memory that are accessed most frequently by a processor to reduce the number of times the processor accesses the memory, thereby improving system performance. For example, when storing data of a business application program in memory that is accessed most frequently by a processor in a cache medium, the running performance of the business application program can be ensured. However, there are also some problems in the process of using the cache medium, such as cache consistency, cache expiration, and cache penetration. In addition, the capacity usage efficiency of the cache medium also needs to be analyzed efficiently, so that the cache medium can be reasonably used and managed in business applications. At present, a computing device can manage storage media such as memory and cache medium through some instructions. For example, the computing device can use the top command to dynamically and in real time display the resource (such as memory and cache) occupation of the process in the computing device. The top command is equivalent to the function of the resource manager under Windows. Similarly, the computing device can use the free command to release the memory. The vmstat command is used to detect the virtual memory to display the state value of the server in a given time interval, including CPU usage, memory usage, virtual memory exchange, IO read / write, and the like. The / proc / meminfo command is used to obtain the memory usage of the Linux system. The htop command is used to view the usage of the central processing unit (CPU), memory, and swap space. In addition, there are also some tools that can be used to analyze the memory / cache usage of the Windows system. For example, in addition to the task manager, resource manager, and performance monitor that come with the Windows system, there are also SysInternals tools such as RAMMap and PoolMon that can be used to analyze cache problems.

[0060] However, these cannot analyze the capacity of the cache medium, so that the computing device cannot effectively manage the cache medium, resulting in the problem of low usage efficiency of the cache medium.

[0061] Based on this, the embodiment of the present application provides a storage capacity analysis method of a computing device. The method is performed for a cache medium arranged outside a processor core of a processor in the computing device. If not otherwise specified, the cache medium in the following refers to the cache medium arranged outside the processor core. For example, according to the description above, when the cache medium of the processor is divided into L1 cache, L2 cache and L3 cache, the L3 cache is arranged outside the processor core, and the method is for the L3 cache. If not otherwise specified, the cache medium in the following refers to the L3 cache. In the method, the processor can obtain first performance data of a business application program running, then reduce the available capacity of the cache medium, and obtain second performance data of the business application program running based on the cache medium with reduced capacity (i.e. reduced available capacity). Based on the degradation of the running performance indicated by the second performance data compared with the running performance indicated by the first performance data, the upper limit value of the capacity of the cache medium that can be reduced is determined. The first performance data is used to indicate the running performance of the business application program based on the cache medium. The second performance data is used to indicate the running performance of the business application program based on the cache medium with reduced capacity. The business application program can be various application programs for implementing general computing. For example, the business application program can be a database application and a big data application, etc. which will not be exemplified one by one here. Moreover, the implementation form of the business application program is not limited in the present application. For example, the business application program can be a virtualization application.

[0062] In this way, the method can take the performance of the business application program as a reference basis, and determine the upper limit value of the capacity of the cache medium that can be reduced on the premise that the influence of reducing the available capacity of the cache medium on the running performance of the business application program is controlled within an acceptable range, so as to facilitate effective management of the cache medium based on the upper limit value. For example, the storage units with a total capacity not greater than the upper limit value in the cache medium can be used to store other data except cache data, so as to improve the use efficiency of the cache medium. For another example, in the process of producing the processor, the cache medium needed to be configured for the processor is selected according to the upper limit value, so as to realize accurate pairing of the business application program and the capacity of the cache medium. Meanwhile, the occupied area reduced due to the reduction of the capacity of the cache medium can be used for other purposes, such as deploying other components of the processor in the area, so as to improve the overall performance of the processor. The smaller the capacity of the cache medium is, the smaller the occupied area of the cache medium is. Therefore, when the cache medium with a smaller capacity is configured for the processor, the area occupied by the cache medium in the processor is smaller. It should be noted that the upper limit value can also be used in other scenarios, which will not be exemplified one by one here.

[0063] In this paper, the technical solutions of the present application are introduced in detail from the aspects of implementation scenarios, method flows, hardware devices, software devices, etc. The application scenarios of the embodiments of the present application are exemplified first below.

[0064] The implementation scenario related to the storage capacity analysis method of the computing device provided by the embodiments of the present application includes a computing device. The computing device is configured with the storage capacity analysis method of the computing device provided by the embodiments of the present application. The computing device can be a server or the like. For example, the computing device is a server used for performing general-purpose computing in a data center. FIG. 2 is a structural schematic diagram of a computing device provided by an embodiment of the present application. As shown in FIG. 2, the computing device 20 includes a processor 201, a communication interface 202, an external memory 203, an internal memory (also referred to as a physical memory) 204, a basic input output system 205 (BIOS), and a bus 206. The processor 201 is provided with a cache medium 207. The processor 201, the communication interface 202, the external memory 203, the internal memory 204, the basic input output system 205, and the cache medium 207 are connected to each other through the bus 206.

[0065] The processor 201 can be a dedicated hardware chip. The dedicated hardware chip is a hardware module with high processing performance. The dedicated hardware chip includes a digital signal processor, an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 201 can also be a general-purpose processor, for example, a central processing unit (CPU), a microprocessor, a graphics processing unit (GPU), a network processor (NP), or a combination of a CPU and an NP. The CPU is, for example, a single-CPU, and is, for example, a multi-CPU.

[0066] The communication interface 202 uses a transceiving module such as, but not limited to, a transceiver to enable communication with other devices or communication networks, such as an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. For example, the communication interface 202 can be any one or any combination of the following: a network interface (e.g., an Ethernet interface), a wireless network card, etc.

[0067] The external memory 203 is used to store executable code or data generated when executing an application program, etc. For example, the external memory 203 is used to store an operating system 208. Executable code stored in the external memory 203 can be read into the memory and executed by the processor 201 to implement the functions corresponding to the executable code. Similarly, data stored in the external memory 203 can be read into the memory and accessed by the processor 201 to perform corresponding processing according to the data. The external memory 203 is, for example, a read-only memory or other type of static storage device that can store static information and instructions, a random access memory or other type of dynamic storage device that can store information and instructions, a electrically erasable programmable read-only memory, a read-only optical disc or other optical disc storage, an optical disc storage (including a compact disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired executable codes in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. For example, the external memory 203 is used to store an egress port queue, etc. The external memory 203 is, for example, independently present and connected to the processor 201 through the bus 206. Alternatively, the external memory 203 and the processor 201 are integrated together. For example, the external memory 203 can include a volatile memory such as a random-access memory (RAM). The external memory 203 can also include a non-volatile memory such as a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD). Alternatively, the external memory 203 can also include a combination of the above types of memories.

[0068] The memory 204 is used to temporarily store data and instructions required by the processor 201 during operation. For example, the memory 204 is used to store an operating system read from the external memory 203 into the memory 204 when the computing device is started, and data generated when an application is executed. Since the memory 204 has a faster read and write speed, the memory 204 is usually used as a data bridge between the external memory 203 and the processor 201. That is, during the operation of the computing device, the data required by the processor 201 can be read from the external memory 203 into the memory 204 in advance, so that the processor 201 reads the required data from the memory 204 to ensure the computing speed of the processor 201. The memory 204 of the present application can be various storage media capable of temporarily storing data required by the processor 201 during operation. The memory 204 is, for example, independently present and connected to the processor 201 through the bus 206. For example, the memory 204 is a dynamic random access memory (DRAM).

[0069] The cache medium 207 has a faster read and write speed than the memory 204, and the cache medium 207 is usually used as a data bridge between the memory 204 and the processor 201. That is, during the operation of the computing device, the data required by the processor 201 can be read from the memory 204 into the cache medium 207 in advance, so that the processor 201 reads the required data from the cache medium 207 to ensure the computing speed of the processor 201. The cache medium of the present application can be various storage media capable of caching data in the memory for the processor. The cache medium 207 and the processor 201 are integrated together. For example, the cache medium is a static random access memory (SRAM) or a magnetic random access memory (MRAM), and the cache medium in the present application can be a storage medium arranged in the processor and arranged outside the processor core. For example, when the SRAM is a three-level cache, the cache medium in the present application is the last level cache (LLC) of the SRAM, that is, the third level cache L3 cache. For another example, the cache medium includes a four-level cache, and when the third level cache and the fourth level cache are arranged outside the processor core, the cache medium in the present application is the third level cache and the fourth level cache.

[0070] The basic input and output system 205 is used to perform self-checking and initialization on various components in the computing device, and serves as a transmission medium between software programs and hardware to transmit information between software programs and hardware.

[0071] The bus 206 is any type of communication bus, which is used to realize the interconnection of the internal devices (for example, the external memory 203, the processor 201, the communication interface 202) of the computing device. For example, the bus 206 can be divided into an address bus, a data bus, a control bus, and the like. For the convenience of representation, only one thick line is shown in FIG. 2, but it does not mean that there is only one bus or one type of bus. The embodiments of the present application take the above-mentioned devices inside the computing device as an example to illustrate that the above-mentioned devices inside the computing device can be communicatively connected to each other by means of the bus 206. Alternatively, the above-mentioned devices inside the computing device 20 can also be communicatively connected to each other by means of other connection manners in addition to the bus 206. For example, the above-mentioned devices inside the computing device 20 are interconnected by means of internal logical interfaces.

[0072] It should be noted that the above-mentioned multiple devices can be respectively arranged on mutually independent chips, or at least partially or entirely arranged on the same chip. Whether to arrange each device independently on different chips or to integrate on one or more chips often depends on the needs of product design. The embodiments of the present application do not limit the specific implementation form of the above-mentioned devices. And the description of the corresponding flow of each of the above-mentioned figures has its own emphasis, and the part not described in detail in a certain flow can be referred to the related description of other flows.

[0073] In the above-mentioned embodiments, all or part of the storage capacity analysis method of the computing device can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part of the storage capacity analysis method of the computing device can be realized in the form of a computer program product. The computer program product providing the program development platform includes one or more computer instructions, which, when loaded and executed on the computing device, realize all or part of the functions of the storage capacity analysis method of the computing device provided by the embodiments of the present application.

[0074] Moreover, the computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line) or wireless (for example, infrared, wireless, microwave, etc.). The computer readable storage medium stores computer program instructions providing the program development platform.

[0075] In an implementation manner, the storage capacity analysis method of the computing device provided by the embodiments of the present application can be realized by running an executable program of the computing device. Alternatively, the executable program for realizing the storage capacity analysis method of the computing device can be presented in the form of an application installation package, and after the server installs the application installation package, the executable program in the application installation package can be run to realize the storage capacity analysis method of the computing device provided by the embodiments of the present application. In an implementation manner, the storage capacity analysis method of the computing device provided by the embodiments of the present application can be realized by running an executable program of the computing device. Alternatively, the executable program for realizing the storage capacity analysis method of the computing device can be presented in the form of an application installation package, and after the server installs the application installation package, the executable program in the application installation package can be run to realize the storage capacity analysis method of the computing device provided by the embodiments of the present application.

[0076] It should be understood that the above is an exemplary description of the implementation scenario of the storage capacity analysis method of the computing device provided by the embodiments of the present application, and does not constitute a limitation on the implementation scenario of the storage capacity analysis method of the computing device. Those skilled in the art can know that the implementation scenario can be adjusted according to the application requirements as the business requirements change, and the embodiments of the present application do not make specific limitations. Moreover, when the storage capacity analysis method of the computing device provided by the embodiments of the present application is applied to other scenarios, the executable program of the method can also be presented in the form of an application installation package or in other ways, and the embodiments of the present application do not make one-by-one enumeration.

[0077] The implementation process of the storage capacity analysis method of the computing device provided by the embodiments of the present application will be described below. FIG. 3 is a flowchart of the storage capacity analysis method of the computing device provided by the embodiments of the present application. As shown in FIG. 3, the storage capacity analysis method of the computing device includes the following steps:

[0078] In step 301, the processor acquires first performance data of the business application program running time, and the first performance data is used to indicate the running performance of the business application program based on the cache medium running time.

[0079] The performance data of the business application program is the data of the performance indicators of the business application program. In the present application, the performance indicators of the business application program can be any indicators that can indicate the running performance of the business application program. For example, when the business application program is an application program for sequentially reading and writing big data Hbase (a kind of Hadoop database), the performance indicator can be the data read-write bandwidth. When the business application program is a big data spark (a kind of data analysis engine) application program, the performance indicator can be the data analysis time. The data analysis time refers to the time consumed from starting to analyze data to obtaining the analysis result. When the business application program is a distributed storage full flash read-write application program, the performance indicator can be the number of input / output operations per second (IOPS).

[0080] The first performance data is used to indicate the running performance of the business application based on the cache medium at runtime. That is, the first performance data is the performance data of the business application based on the cache medium with the reduced available capacity at runtime. The first performance data can be used as a reference basis for judging whether the running performance of the business application is degraded after the available capacity of the cache medium is reduced. That is, the first performance data can be used to compare with the performance data of the business application based on the cache medium with the reduced capacity at runtime, so as to obtain the influence degree of the reduced capacity on the running performance of the business application. For example, as shown in FIG. 4, the processor obtains the performance data of the business application at runtime in the process of running the business application, so as to obtain the performance data used for comparison. Since the performance data is obtained when the available capacity of the cache medium is not reduced, the performance data is referred to as the first performance data, so as to be distinguished from the performance data obtained after the cache medium is reduced.

[0081] Step 302, the processor reduces the available capacity of the cache medium.

[0082] The cache medium of the present application can be various storage media that can be used as the cache of the processor. For example, the cache medium is a static random access memory (SRAM) or a magnetic random access memory (MRAM), and the memory is a dynamic random access memory (DRAM). In addition, the cache medium in the present application can be the last level cache (LLC) in the storage medium of the processor. For example, when the SRAM is a three-level cache, the cache medium in the present application is the third-level cache L3 cache. Alternatively, the cache medium in the present application is a multi-level cache located outside the processor core. For example, the cache medium includes a four-level cache, and the third-level cache and the fourth-level cache are located outside the processor core. The cache medium has a rated capacity and an available capacity. The rated capacity of the cache medium is determined by the physical structure of the cache medium, and the rated capacity of the cache medium will not change after the cache medium is completed. The available capacity of the cache medium is the capacity that can be used in the rated capacity of the cache medium, and the available capacity is less than or equal to the rated capacity. The available capacity of the cache medium can change due to circumstances. For example, due to the damage of part of the storage units in the cache medium, or due to the configuration of part of the storage units in the cache medium by human, the part of the storage units cannot be used, and the available capacity of the cache medium is reduced.

[0083] The value of the reduced available capacity of the cache medium can be determined according to application requirements. The value of the reduced available capacity of the cache medium can be different under different application requirements. For example, when the cache medium is combined and controlled in the granularity of a way, the reduced available capacity of the cache medium by the processor is an integer multiple of the capacity of a way of storage units. In this way, the control efficiency can be ensured when the available capacity of the cache medium is reduced. For example, as shown in FIG. 4, the processor reduces the available capacity of the cache medium by the capacity of a way of storage units after obtaining the first performance data of the service application during the running of the service application.

[0084] In a possible implementation, the processor reduces the available capacity of the cache medium, including: the processor determines at least one target storage unit in the cache medium, and sets the at least one target storage unit to an unavailable state. The reduced available capacity of the cache medium is the capacity of the at least one target storage unit. The processor reducing the available capacity of the cache medium generally means that the processor reduces the available capacity of the cache medium by a specified capacity, and the reduced capacity here is the specified capacity, and the specified capacity is the sum of the capacities of the at least one target storage unit. When the processor manages the cache medium, after a storage unit in the cache medium is allocated to the service application by the processor, the processor can mark the use state of the storage unit as used, so that the processor will not allocate the storage unit to the service application again. Similarly, the processor sets the target storage unit to the unavailable state can also be implemented by the processor setting a state mark for the target storage unit. For example, the processor marks the use state of the target storage unit as used to achieve the purpose of setting the target storage unit to the unavailable state. For example, as shown in FIG. 5, the processor marks the use state of a part of storage units in the L3 cache as used, so that the part of storage units can be set to the disable state, which is equivalent to reducing the available capacity of the cache medium by the capacity of the part of storage units.

[0085] The processor can determine at least one target storage unit in the cache medium according to a preset policy. In a possible implementation, the cache medium of the computing device can be divided into a plurality of sub-media, that is, the whole composed of the plurality of sub-media is the cache medium. The processor usually manages the processor cores of the processor in a core set as a unit, and the processor includes a plurality of core sets, each of which includes one or more processor cores. Each core set is correspondingly configured with a sub-medium, and the sub-medium configured for the core set is used to store data used by the processor cores in the core set. When the available capacity of the cache medium is reduced to the capacity of the plurality of target storage units, and the cache medium includes a plurality of sub-media correspondingly configured for the plurality of core sets, the plurality of target storage units include storage units distributed in each of the plurality of sub-media. For example, the plurality of target storage units are distributed in the storage units in the plurality of sub-media, that is, the plurality of target storage units are evenly distributed in the plurality of sub-media. For example, the processor cores are managed in a processor cluster as a unit, and the plurality of processor cores in the processor are divided into a plurality of processor clusters for management, and each processor cluster includes a plurality of processor cores. The cache medium includes a plurality of sub-media, and the plurality of sub-media are correspondingly distributed near the plurality of processor clusters, and the sub-medium corresponding to each processor cluster is used to store data used by the processor cores in the processor cluster. As shown in FIG. 5, the processor includes three processor clusters. Each processor cluster includes four processor cores. The cache medium includes three L3 caches, and the three L3 caches are correspondingly distributed near the three processor clusters. When performing the step 302, if the required reduced capacity is 1.5 megabytes (MB), the processor can select storage units L0 with a total capacity of 0.5 MB in the L3 cache corresponding to each processor cluster, and then set the selected storage units in the three L3 caches to an unavailable state, so as to achieve the purpose of reducing the available capacity of the cache medium by 1.5 MB.

[0086] When the plurality of target storage units include storage units distributed in each of the plurality of sub-media, it can be ensured that after the capacity of the plurality of target storage units is reduced, the plurality of core sets can all cache data using the storage units distributed in the sub-media near the plurality of core sets except the plurality of target storage units. When a processor core in the plurality of core sets needs to cache data, the data can be preferentially cached in the sub-media distributed near the processor core, without needing to cache the data in a storage medium at a farther location, such as a memory or a sub-media corresponding to another core set. In this way, since the speed of various storage media in the computing device generally shows a positive correlation with the distance of the storage media to the processor, it can be ensured that the access performance of the sub-media used by the plurality of core sets to cache data does not show a significant difference. When the capacity of the plurality of storage units distributed in the plurality of sub-media is the same, if the capacity of the plurality of sub-media is equal, it can be ensured that after the available capacity of the cache medium is reduced, the capacity of the plurality of sub-media for caching data is equal. Since the access performance of the cache medium is positively correlated with the capacity of the cache medium that can be used for caching, it can be ensured that after the available capacity of the cache medium is reduced, the access performance of the plurality of sub-media is still basically flat, thereby ensuring that the performance of the entire processor is at a high level.

[0087] The reduced available capacity of the cache medium is the capacity of at least one target storage unit. Optionally, before the processor reduces the available capacity of the cache medium, the processor can also perform some preprocessing on the at least one target storage unit. For example, as shown in FIG. 6, before the processor reduces the available capacity of the cache medium, the method further includes: step 305, the processor migrates data stored by the at least one target storage unit to other storage units or a memory, the other storage units being storage units in the cache medium except the at least one target storage unit. Migrating the data stored by the target storage unit to the other storage units is actually transferring the data between different storage units in the cache medium. Migrating the data stored by the target storage unit to the memory is actually flushing the data in the cache medium to the memory. Before the processor reduces the available capacity of the cache medium, the processor can avoid the data stored by the target storage unit from being unable to be used by the processor after the available capacity of the cache medium is reduced by migrating the data stored by the target storage unit to the other storage units or the memory, so that the data can continue to be used by the processor, thereby ensuring that the business application program can continue to run based on the data.

[0088] Step 303, the processor obtains second performance data of the business application program running based on the cache medium with the reduced capacity, the second performance data being used to indicate the running performance of the business application program running based on the cache medium with the reduced capacity.

[0089] As shown in FIG. 4, after reducing the available capacity of the cache medium by the capacity of the storage unit, the processor obtains performance data of the service application running based on the cache medium with the reduced capacity. Since the performance data is obtained after reducing the available capacity of the cache medium, the performance data is referred to as second performance data for the purpose of distinguishing from the first performance data. The implementation process of step 303 can refer to the implementation process of step 301, and will not be repeated here.

[0090] In step 304, the processor determines the upper limit of the capacity of the cache medium that can be reduced based on the degree of deterioration of the running performance indicated by the second performance data relative to the running performance indicated by the first performance data.

[0091] The degree of deterioration of the running performance indicated by the second performance data relative to the running performance indicated by the first performance data refers to the degree of deterioration of the running performance indicated by the second performance data relative to the running performance indicated by the first performance data. In a possible implementation, the degree of deterioration can be equal to the percentage of the performance difference to the first performance data, and the performance difference is the difference between the first performance data and the second performance data. For example, when the running performance of the service application is indicated by a performance indicator, the degree of deterioration is equal to the percentage of the performance difference to the first performance data of the performance indicator, and the performance difference is the difference between the first performance data of the performance indicator and the second performance data of the performance indicator. When the running performance of the service application is indicated by multiple performance indicators, the degree of deterioration is equal to the percentage of the weighted value of the performance difference of the multiple performance indicators to the weighted value of the first performance data of the multiple performance indicators. The performance difference of any performance indicator is the difference between the first performance data of the performance indicator and the second performance data of the performance indicator. It should be noted that the above is an illustrative example of the calculation method of the degree of deterioration, and there are other calculation methods, which will not be repeated here.

[0092] In a possible implementation, as shown in FIG. 4, in the process of determining the upper limit of the capacity of the cache medium that can be reduced, the processor can reduce the available capacity of the cache medium multiple times, and after each time of reducing the available capacity of the cache medium, the processor obtains second performance data of the service application running based on the cache medium with the reduced capacity, and then decides whether to continue to reduce the available capacity of the cache medium according to the second performance data, and when stopping to reduce the available capacity of the cache medium, determines the upper limit of the capacity of the cache medium that can be reduced based on the available capacity of the cache medium that has been reduced. For example, as shown in FIG. 6, the implementation process of step 304 includes:

[0093] In step 3041, when the degree of deterioration of the running performance indicated by the second performance data relative to the running performance indicated by the first performance data is greater than a deterioration threshold, the processor determines that the upper limit is 0.

[0094] After step 302 and step 303, it can be determined whether to continue to reduce the available capacity of the cache medium according to the second performance data obtained in step 303. For example, when the second performance data obtained in step 303 indicates that the degree of deterioration of the running performance is greater than the deterioration threshold compared with the first performance data, the reduction of the available capacity of the cache medium is stopped. When the second performance data obtained in step 303 indicates that the degree of deterioration of the running performance is not greater than the deterioration threshold compared with the first performance data, the reduction of the available capacity of the cache medium is continued, i.e., step 3041 is executed. After it is determined to stop the reduction of the available capacity of the cache medium, it is necessary to determine the upper limit value of the capacity by which the cache medium can be reduced based on the available capacity of the cache medium that has been reduced.

[0095] In a possible implementation, when the capacity reduced by step 302 is the capacity of the minimum organization unit of the storage unit in the cache medium, since step 302 is the first time to reduce the available capacity of the cache medium, if the degree of deterioration of the running performance indicated by the second performance data is greater than the deterioration threshold compared with the first performance data after the capacity of the minimum organization unit is reduced, it is considered that the available capacity of the cache medium cannot be reduced, i.e., the upper limit value of the capacity by which the cache medium can be reduced is 0. Assuming that the capacity reduced by step 302 is a specified capacity, when the specified capacity is not the capacity of the minimum organization unit of the storage unit in the cache medium, if the degree of deterioration of the running performance indicated by the second performance data after the capacity is reduced is greater than the deterioration threshold compared with the first performance data, step 302 and step 303 can be re-executed. When step 302 is re-executed, the capacity of the cache medium is reduced by a smaller capacity than the specified capacity, such as the capacity of the minimum organization unit of the storage unit in the cache medium. Then step 304 is executed to determine whether to continue to reduce the capacity of the cache medium or to determine the upper limit value of the capacity by which the cache medium can be reduced according to the degree of deterioration corresponding to the second performance data obtained after the capacity is re-reduced.

[0096] When the running performance indicated by the second performance data obtained after the capacity is reduced is not deteriorated by more than the deterioration threshold value compared with the running performance indicated by the first performance data, the available capacity of the cache medium is continuously reduced on the basis of the cache medium having been reduced in capacity, that is, step 3042 is executed. As shown in FIG. 4, the process is equivalent to first reducing a smaller capacity from the cache medium, and when the running performance indicated by the second performance data obtained after the smaller capacity is reduced is not deteriorated by more than the deterioration threshold value compared with the running performance indicated by the first performance data, the available capacity of the cache medium is continuously reduced on the basis of the cache medium having been reduced in the smaller capacity, until the running performance of the cache medium at the time of continuous reduction in capacity indicated by the second performance data is deteriorated by more than the deterioration threshold value compared with the running performance indicated by the first performance data. Since the cache medium has an advantage in speed over the internal memory and the external storage, and the storage units providing the capacity not reduced in the cache medium can continue to cache data, the running performance of the business application program can be ensured to a large extent by using the speed advantage of the cache medium through gradually increasing the available capacity of the cache medium reduced. In the process of executing step 3042, the available capacity reduced by different capacity adjustment processes can be equal or unequal, which is not limited in the embodiments of the present application. In addition, the implementation of the processor to reduce the available capacity of the cache medium can refer to the implementation in step 302, which will not be described here.

[0097] The organization unit of the storage unit is a set including one or more storage units. The capacity reduced from the cache medium is the capacity of the smallest organization unit of the storage unit in the cache medium, which is the smallest capacity that can be reduced from the cache medium under the limitation of the mechanism for managing the storage unit in the cache medium, and the corresponding smallest organization unit is a set of one or more storage units with a total capacity equal to the smallest capacity. For example, when the cache medium is combined and controlled according to the granularity of a way, the available capacity of the cache medium reduced by the processor each time is an integer multiple of the capacity of a way storage unit. According to the limitation, the smallest capacity that can be reduced from the cache medium is the capacity of a way storage unit, and the corresponding smallest organization unit includes a way storage unit. The value of the deterioration threshold value can be determined according to application requirements. For example, to avoid too much influence of reducing the available capacity of the cache medium on the application performance of the business application program, the deterioration threshold value can be 5%.

[0098] In a possible implementation, after the processor determines that the upper limit of the capacity that can be reduced from the cache medium is 0, the method further includes: restoring the available capacity of the cache medium to the value when the capacity is not reduced. For example, when the processor reduces the available capacity of the cache medium by setting the storage unit to an unavailable state, the processor can optionally set the storage unit in the cache medium set to the unavailable state due to the reduction in capacity to an available state, so as to restore the available capacity of the cache medium to the value when the capacity is not reduced.

[0099] In step 3042, when the running performance indicated by the second performance data obtained after the capacity is reduced is not deteriorated by more than the deterioration threshold value compared with the running performance indicated by the first performance data, the processor repeats the capacity adjustment process until the running performance indicated by the second performance data obtained after the capacity is continuously reduced is deteriorated by more than the deterioration threshold value compared with the running performance indicated by the first performance data, and then determines the upper limit value based on the capacity by which the cache medium is reduced multiple times. The capacity adjustment process comprises: continuously reducing the available capacity of the cache medium, and obtaining the second performance data based on the running of the service application on the cache medium after the capacity is continuously reduced.

[0100] When the processor executes step 3042, it is equivalent to gradually increasing the reduced capacity of the cache medium in the process of reducing the available capacity of the cache medium. As the reduced capacity of the cache medium increases, the running performance of the service application based on the cache medium after the capacity is reduced will gradually deteriorate. Therefore, by gradually increasing the reduced capacity of the cache medium, the impact on the running performance of the service application can be effectively reduced in the process of determining the upper limit value of the capacity by which the cache medium can be reduced. In a possible implementation, the processor determines the upper limit value based on the capacity by which the cache medium is reduced multiple times, comprising: when the running performance indicated by the second performance data obtained after the capacity is continuously reduced is deteriorated by more than the deterioration threshold value compared with the running performance indicated by the first performance data for the first time, the processor determines the sum of the capacity reduced from the cache medium before the current capacity reduction as the upper limit value. That is, after the processor reduces the available capacity of the cache medium, if the running performance indicated by the second performance data obtained after the capacity is reduced is deteriorated by more than the deterioration threshold value compared with the running performance indicated by the first performance data, the processor needs to perform a rollback operation to determine the sum of the capacity reduced from the cache medium before the available capacity of the cache medium is reduced this time as the upper limit value of the capacity by which the cache medium can be reduced.

[0101] For example, assume that the cache medium is reduced in available capacity by the capacity of one way of storage unit each time, and the degradation threshold is 5%. In step 302, the available capacity of the cache medium is reduced by the capacity of one way of storage unit. In step 303, the second performance data of the service application running on the cache medium after the reduction of the capacity of one way of storage unit is obtained. The degradation degree of the running performance indicated by the second performance data compared with the running performance indicated by the first performance data is 3%, which is not greater than the degradation threshold, and thus step 3042 is continued. In step 3042, the capacity of the cache medium is further reduced by the capacity of one way of storage unit based on the reduction of the capacity of one way of storage unit, and thus the capacity of the cache medium is reduced by the capacity of two ways of storage unit. Then, the second performance data of the service application running on the cache medium after the reduction of the capacity of two ways of storage unit is obtained. The degradation degree of the running performance indicated by the second performance data compared with the running performance indicated by the first performance data is 6%, which is greater than the degradation threshold. At this time, the reduction of the capacity of two ways of storage unit to the cache medium causes the running performance of the service application to degrade seriously, and thus the processor needs to perform a rollback operation to determine the capacity of one way of storage unit as the upper limit of the capacity of the cache medium that can be reduced.

[0102] It should be noted that, in step 3042, the processor can also perform some preprocessing on the storage unit whose capacity is to be reduced before the processor reduces the available capacity of the cache medium each time. For example, the processor can migrate the data stored in the storage unit whose capacity is to be reduced to other storage units or memory, and the other storage units are storage units other than the storage unit whose capacity is to be reduced in the cache medium.

[0103] It should be understood that there are various implementation manners of step 304, and the above is an example of the implementation manner of step 304, and step 304 can also have other implementation manners. For example, the processor can also obtain the trend of the running performance of the service application changing with the available capacity of the cache medium, and then determine the upper limit of the capacity of the cache medium that can be reduced according to the trend when the degradation degree of the running performance does not exceed the degradation threshold. Similarly, step 304 can also have other implementation manners, which are not exemplified one by one here.

[0104] To sum up, in the storage capacity analysis method of the computing device provided in the application, the processor can acquire the first performance data of the business application running, reduce the available capacity of the cache medium, then acquire the second performance data of the business application running based on the cache medium with the reduced capacity, and determine the upper limit value of the capacity of the cache medium that can be reduced based on the degradation of the running performance indicated by the second performance data compared with the running performance indicated by the first performance data. In this way, the method can take the performance of the business application as a reference, control the influence of reducing the available capacity of the cache medium on the running performance of the business application within an acceptable range, determine the upper limit value of the capacity of the cache medium that can be reduced, and facilitate effective management of the cache medium based on the upper limit value. For example, the storage units with a total capacity not greater than the upper limit value in the cache medium can be used to store other data except cache data, so as to improve the use efficiency of the cache medium. For another example, in the process of producing the processor, the cache medium to be configured for the processor is selected according to the upper limit value, and the occupied area reduced due to the reduction of the capacity of the cache medium is used for other purposes, such as deploying other components of the processor in the area, so as to improve the overall performance of the processor. Wherein, the smaller the capacity of the cache medium is, the smaller the occupied area of the cache medium is, so when the cache medium with a smaller capacity is configured for the processor, the area occupied by the cache medium in the processor is smaller.

[0105] It should be noted that the order of the steps of the storage capacity analysis method of the computing device provided in the embodiments of the application can be adjusted appropriately, and the steps can be increased or decreased as appropriate. Any person skilled in the art can easily think of changes within the technical range disclosed in the application, which should be covered within the protection scope of the application, therefore, no further description is given.

[0106] According to the foregoing, after determining the upper limit value of the cache medium that can be reduced in capacity by using the storage capacity analysis method of the computing device provided in the present application, the computing device effectively manages the cache medium based on the upper limit value. For example, the computing device can use the storage unit with a total capacity not greater than the upper limit value in the cache medium to store data other than cache data, so as to improve the use efficiency of the cache medium. Taking the application of the upper limit value as an example, the embodiments of the present application further provide a storage capacity adjustment method of a computing device. The method is performed for the cache medium arranged outside the processor core of the processor in the computing device. In the method, the processor determines a first storage unit in the cache medium, and the total capacity of the first storage unit is less than or equal to the upper limit value of the cache medium that can be reduced in capacity. Then, the management right of the first storage unit is transferred to the operating system of the computing device, so that the operating system has the management right of the first storage unit. When the operating system receives a memory application request of a business application program, the operating system can allocate the first storage unit to the business application program, and use the first storage unit as memory to allocate to the business application program. The business application program can be various application programs for implementing general computing. For example, the business application program can be a database application and a big data application, and the like, which will not be listed one by one here. Moreover, the implementation form of the business application program is not limited in the present application. For example, the business application program can be a virtualization application.

[0107] In this way, the first storage unit in the cache medium can be used as memory, which is equivalent to reducing the total capacity of the cache medium that can be actually used by the processor. Since the proportion of the actual use amount of the cache medium in the total capacity of the cache medium that can be actually used by the processor is reflected as the capacity use efficiency of the cache medium, under the premise that the actual use amount of the cache medium does not change relative to the case where the storage unit in the cache medium is not used as memory, by using the first storage unit in the cache medium as memory, the total capacity of the cache medium that can be actually used by the processor is reduced, which is equivalent to improving the capacity use efficiency of the cache medium. Moreover, since the physical form of the first storage unit is still the physical form of the cache medium, it has a larger transmission bandwidth and a smaller transmission latency than the memory arranged outside the processor, so by using the first storage unit as memory, the average bandwidth of the storage medium used as memory can also be improved, and the average latency of the storage medium used as memory can also be reduced, thereby improving the overall memory performance of the storage medium used as memory.

[0108] FIG. 7 is a flowchart of a storage capacity adjustment method of a computing device provided in an embodiment of the present application. As shown in FIG. 7, the storage capacity adjustment method of the computing device includes the following steps:

[0109] Step 701, the processor determines a first storage unit in the cache medium, and the total capacity of the first storage unit is less than or equal to the upper limit value of the cache medium that can be reduced in capacity.

[0110] The processor can first determine the first storage unit in the cache medium, so as to transfer the management right of the first storage unit to the operating system of the computing device for use, so that the operating system uses the first storage unit for memory. According to the foregoing description, since the cache medium has a speed advantage, storing the data of the business application program in the cache medium can ensure the running performance of the business application program, and therefore the total amount of the first storage unit needs to be limited to ensure that the remaining capacity of the cache medium can ensure that the running performance of the business application program is not affected. In a possible implementation, the total capacity of the first storage unit is less than or equal to an upper limit value of the cache medium that can be reduced in capacity. The upper limit value is the maximum value of the capacity of the cache medium that can be reduced under the premise of ensuring the running performance of the business application program. The upper limit value of the cache medium that can be reduced in capacity can be determined according to application requirements, and the determination method thereof will be described below. The first storage unit is a set of one or more storage structures in the cache medium, and the total capacity of the storage structures in the set is equal to the total capacity of the first storage unit. The granularity of the storage structure can be different under different application requirements. For example, when the cache medium is combined and controlled according to the granularity of a way, the granularity of the storage structure is a whole composed of cache blocks in one way. Correspondingly, the first storage unit is a whole composed of cache blocks in one way or more ways in the cache medium.

[0111] The processor can determine the first storage unit in the cache medium according to a preset strategy. In a possible implementation, when the cache medium generally includes a plurality of sub-media corresponding to a plurality of core sets, the first storage unit includes storage units distributed in each of the plurality of sub-media. The processor generally manages the processor cores of the processor in units of core sets. The processor includes a plurality of core sets, and each core set includes one or more processor cores. For example, the first storage unit is distributed in storage units of the plurality of sub-media, and the capacities of the storage units are the same, that is, the first storage unit is evenly distributed in the plurality of sub-media. The cache medium of the computing device can be divided into a plurality of sub-media, that is, the whole of the plurality of sub-media is the cache medium. For example, the processor cores are managed in units of clusters. The plurality of processor cores in the processor are divided into a plurality of processor clusters for management, and each processor cluster includes a plurality of processor cores. The processor includes a plurality of sub-media, and the plurality of sub-media are correspondingly distributed near the plurality of processor clusters. The sub-media corresponding to each processor cluster are used to store data used by the processor cores in the processor cluster. The whole of the plurality of sub-media is the cache medium of the processor. For example, as shown in FIG. 8, the processor includes three processor clusters, each processor cluster includes four processor cores, and the cache medium includes three L3 caches, which are correspondingly distributed near the three processor clusters. When the step 701 is performed, the processor can select a storage unit L0 with a total capacity of 0.5 MB in each L3 cache corresponding to each processor cluster, and determine the whole of the selected storage units in the three L3 caches as the first storage unit, to obtain a first storage unit with a total capacity of 1.5 MB.

[0112] When the first storage unit includes storage units distributed in each of the plurality of sub-media, it can be ensured that each core set can cache data in the storage units distributed near the core set except the first storage unit. When a processor in the plurality of core sets needs to cache data, the data can be preferentially cached in the sub-media distributed near the processor, without being cached in a storage medium at a farther position, such as a memory or a sub-medium corresponding to another core set. In this way, since the speed of various storage media in the computing device generally positively correlates with the distance of the storage medium to the processor, it can be ensured that the access performance of the sub-media used by the plurality of core sets to cache data does not differ significantly. When the capacities of the storage units in the first storage unit distributed in the plurality of sub-media are the same, if the capacities of the plurality of sub-media are equal, it can be ensured that the capacities of the plurality of sub-media used to cache data are equal. Since the access performance of the cache medium positively correlates with the capacity of the cache medium that can be used for caching, it can be ensured that the access performance of the plurality of sub-media is basically flat, thereby ensuring that the performance of the whole processor is at a high level.

[0113] In step 702, the processor transfers the management right of the first storage unit to the operating system of the computing device.

[0114] After determining the first storage unit in the cache medium, the processor can transfer the management right of the first storage unit to the operating system of the computing device, so that the operating system manages the first storage unit. In an implementation, the processor transfers the management right of the target storage unit to the operating system, including: the processor sets the first storage unit to a locked state, and instructs the operating system to manage the first storage unit. When the first storage unit is in the locked state, the processor cannot allocate the first storage unit to the service application. Therefore, by setting the first storage unit to the locked state, the processor cannot continue to use the first storage unit, so that after the processor transfers the management right of the first storage unit to the operating system, the first storage unit cannot be allocated by both the processor and the operating system, ensuring the validity of the management right of the first storage unit by the operating system.

[0115] In a possible implementation, when the processor manages the cache medium, after a storage structure in the cache medium is allocated by the processor to be used by the service application, the processor can mark the usage state of the storage structure as used. Similarly, the processor can set the first storage unit to the locked state by setting a state flag for the first storage unit. For example, the processor can mark the usage state of the first storage unit as locked, to achieve the purpose of setting the first storage unit to the locked state.

[0116] The processor instructs the operating system to manage the first storage unit, which can be achieved by exposing the physical address of the first storage unit to the operating system by the processor. In a possible implementation, a register is provided in the processor, and the data to be transmitted by the processor to the operating system can be stored in the register, and the operating system reads the data from the register at a specified time to obtain the data transmitted by the processor to the operating system. In addition, the processor and the operating system can be configured such that when the processor provides the physical address of the storage unit to the operating system, the physical address indicates that the storage unit needs to be managed as memory by the operating system. Therefore, the processor can write the physical address of the first storage unit into the register, so that the operating system can obtain the physical address of the first storage unit when reading the register. After obtaining the physical address of the first storage unit, the operating system can determine that the first storage unit indicated by the physical address is managed as memory by the operating system. The physical address of the first storage unit can be represented by a start address and a length. The timing of the operating system reading the register in the processor can be set according to application requirements, which is not limited here.

[0117] Optionally, before the processor transfers the management right of the first storage unit to the operating system of the computing device, the processor can also perform some preprocessing on the first storage unit. For example, as shown in FIG. 9, before the processor transfers the management right of the first storage unit to the operating system, the method further includes: step 707, the processor migrates the data stored in the first storage unit to other storage units or memory, the other storage units being the storage units in the cache medium except the first storage unit. Migrating the data stored in the first storage unit to other storage units is actually the dumping of data between different storage units in the cache medium. Migrating the data stored in the first storage unit to memory is actually flushing the data in the cache medium to memory. Before the processor transfers the management right of the first storage unit to the operating system of the computing device, the processor can avoid the data stored in the first storage unit from being unable to be used by the processor after the first storage unit is managed by the operating system, ensure that the data stored in the first storage unit can continue to be used by the processor, and further ensure that the business application program can continue to run based on the data.

[0118] Step 703, after the operating system receives the memory application request of the business application program running in the processor, the operating system allocates the first storage unit to the business application program.

[0119] After the operating system obtains the management right of the first storage unit, the operating system can manage the first storage unit in the manner of managing memory. For example, after the operating system obtains the management right of the first storage unit, the operating system can perform paging, building a page table, allocating the access interface of the first storage unit to the business application program, and recycling, etc. After the operating system receives the memory application request of the business application program running in the processor, the operating system can allocate the first storage unit to the business application program according to the demand. Since the physical form of the first storage unit is still the physical form of the cache medium, the first storage unit has better memory access performance than the memory arranged outside the processor. By using the first storage unit as memory, the cache medium can provide effective support for the storage unit used as memory without increasing the cost, the average bandwidth of the storage medium used as memory can be improved, the average latency of the storage medium used as memory can be reduced, and the overall memory access performance of the storage medium used as memory can be improved. The storage medium used as memory includes memory and the first storage unit used as memory. Therefore, the first storage unit can also be called a high-performance memory implemented by a cache medium.

[0120] In a possible implementation, the first storage unit can be mapped by the operating system as one continuous storage space or as multiple isolated storage spaces. For example, as shown in FIG. 10, for the first storage unit shown in FIG. 8, the first storage unit includes three L0s with a capacity of 0.5 MB, two L0 caches are mapped as one continuous large memory space, and the memory space mapped by one L0 cache is isolated from the large memory space. When the first storage unit is mapped as multiple isolated storage spaces, the data stored in the multiple storage spaces can be guaranteed not to interfere with each other due to the isolation between the multiple storage spaces, and the data can be guaranteed to have high security.

[0121] In step 704, when the first storage unit is used up, the processor determines a second storage unit in the cache medium, and the total capacity of the first storage unit and the second storage unit is less than or equal to the upper limit of the reducible capacity of the cache medium.

[0122] When the total capacity of the first storage unit is less than the upper limit of the reducible capacity of the cache medium, when the first storage unit is used up, the processor can continue to determine a second storage unit in the cache medium, and transfer the management right of the second storage unit to the operating system, so as to continue to use the second storage unit as memory. At this time, the first storage unit and the second storage unit are both used as memory. Similarly, when the second storage unit is used up, if the total capacity of the first storage unit and the second storage unit does not reach the upper limit of the reducible capacity of the cache medium, the processor can continue to determine a third storage unit in the cache medium, and transfer the management right of the third storage unit to the operating system, so as to continue to use the third storage unit as memory. At this time, the first storage unit, the second storage unit, and the third storage unit are all used as memory. This cycle continues until the total capacity of the storage units used as memory in the cache medium reaches the upper limit of the reducible capacity of the cache medium. Steps 704 to 706 are described by taking the example of continuing to use the second storage unit as memory, and the implementation of continuing to use other storage units as memory can be understood with reference to the implementation of continuing to use the second storage unit as memory.

[0123] The process is equivalent to first using the storage units with smaller capacity in the cache medium as the memory, then gradually increasing the storage units used as the memory when the storage units are used up, until the total capacity of the storage units used as the memory in the cache medium reaches the upper limit of the capacity that can be reduced. Since the cache medium has a speed advantage over the memory, and the storage units in the cache medium can continue to be used by the processor for caching data when not used as the memory, by gradually increasing the storage units used as the memory, the speed advantage of the cache medium can be used to ensure the running performance of the business application to a greater extent. Moreover, since the current cache medium generally has the problem of low capacity utilization efficiency, and the upper limit of the capacity that can be reduced of the cache medium is the upper limit of the capacity that can be reduced of the cache medium under the premise of ensuring the running performance of the business application. Therefore, even if the storage units in the cache medium with a total capacity less than the upper limit of the capacity that can be reduced are used as the memory, the impact on the running performance of the business application is within a controllable range, and the running performance of the business application can still be maintained in a good state.

[0124] In a possible implementation, whether the storage units used as the memory in the cache medium are used up can be detected by the processor, or notified to the processor by the operating system. For example, the storage capacity adjustment method of the computing device of the present application adds a query interface for the processor and the operating system. The query interface is used to query one or more of the following: the capacity and usage of the storage units in the remaining cache medium after the storage units are used as the memory, the capacity and usage of the storage units in the cache medium used as the memory, or the capacity and usage of the memory. Therefore, the processor and the operating system can both use the newly added query interface to query the total capacity and usage of the first storage unit, and then compare the total capacity with the usage of the first storage unit to determine whether the first storage unit is used up. Similarly, after the processor transfers the management right of the first storage unit to the operating system, the processor can use the newly added query interface to query the capacity of the remaining storage units in the multiple sub-media after the storage units are used as the memory, and query the capacity of the multiple sub-media, and then verify whether the total capacity of the first storage unit is equal to the expected total capacity and whether the first storage unit is evenly distributed in the multiple sub-media according to the query result.

[0125] In the implementation process of the second storage unit in the cache medium by the processor, please refer to the related description in step 701 for details, which will not be repeated here. Moreover, the second storage unit can also include storage units distributed in each of the multiple sub-media. For example, the capacity of the storage units distributed in the multiple sub-media is the same.

[0126] Step 705, the processor transfers the management right of the second storage unit to the operating system.

[0127] The implementation process of this step 705 can refer to the related description in step 702, which will not be repeated here. As shown in FIG. 9, before the processor transfers the management right of the second storage unit to the operating system of the computing device, the method can also optionally include: step 708, the processor migrates the data stored in the second storage unit to other storage units or memory, and the other storage units are storage units in the cache medium except the second storage unit.

[0128] Step 706, after the operating system receives the memory application request of the service application running in the processor, the operating system allocates the second storage unit to the service application.

[0129] The implementation process of this step 706 can refer to the related description in step 703, which will not be repeated here. In addition, the operating system can also optionally map the second storage unit as one or more isolated storage spaces.

[0130] As can be seen from the above, in the storage capacity adjustment method of the computing device provided in the present application, the processor determines that the total capacity is less than or equal to the upper limit value of the cache medium that can be reduced in capacity, and then transfers the management right of the first storage unit to the operating system of the computing device, so that the operating system has the management right of the first storage unit. When the operating system receives the memory application request of the service application, the operating system can allocate the first storage unit to the service application, and use the first storage unit as memory to allocate to the service application. In this way, the first storage unit in the cache medium can be used as memory, which is equivalent to reducing the total capacity of the cache medium that the processor can actually use. Since the actual usage of the cache medium in the total capacity of the cache medium that the processor can actually use is reflected as the capacity usage efficiency of the cache medium. Under the premise that the actual usage of the cache medium does not change relative to the case where the storage unit in the cache medium is not used as memory, by using the first storage unit in the cache medium as memory, the total capacity of the cache medium that the processor can actually use is reduced, which is equivalent to improving the capacity usage efficiency of the cache medium. Moreover, since the physical form of the first storage unit is still the physical form of the cache medium, it has a larger transmission bandwidth and a smaller transmission delay than the memory arranged outside the processor, so by using the first storage unit as memory, the average bandwidth of the storage medium used as memory can also be improved, and the average latency of the storage medium used as memory can be reduced, thereby improving the overall memory access performance of the storage medium used as memory. For example, the present application reduces the memory access latency of the computing device by 90%, and increases the memory bandwidth by 5 times. For another example, when the present application is applied to each typical business scenario in the data center, the end-to-end performance can be improved by 10% to 20%, thereby improving the differentiated competitiveness of the data center.

[0131] The virtual device of the embodiments of the present application is illustrated below.

[0132] The storage capacity analysis method of the computing device is introduced above. Corresponding to the above method, the embodiments of the present application further provide a storage capacity analysis device of a computing device. The cache medium is arranged in the processor of the computing device. The cache medium is arranged outside the processor core of the processor. The processor is used to run the business application program. FIG. 11 is a structural schematic diagram of a storage capacity analysis device of a computing device according to an embodiment of the present application. Based on the following multiple components shown in FIG. 11, the storage capacity analysis device of the computing device shown in FIG. 11 can perform all or part of the operations shown in FIG. 3, FIG. 4 or FIG. 6. It should be understood that the device can include more additional components than the shown components or omit part of the shown components, and the embodiments of the present application do not limit this. As shown in FIG. 11, the storage capacity analysis device 110 of the computing device can include:

[0133] The obtaining module 1101 is configured to obtain first performance data of the business application program when running, the first performance data being used to indicate the running performance of the business application program when running based on the cache medium.

[0134] The processing module 1102 is configured to reduce the available capacity of the cache medium.

[0135] The obtaining module 1101 is further configured to obtain second performance data of the business application program when running based on the cache medium after the capacity is reduced, the second performance data being used to indicate the running performance of the business application program when running based on the cache medium after the capacity is reduced.

[0136] The processing module 1102 is further configured to determine the upper limit value of the capacity of the cache medium that can be reduced based on the degree of deterioration of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data.

[0137] In a possible implementation, the processing module 1102 is specifically configured to: when the degree of deterioration of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data is not greater than a deterioration threshold, repeatedly perform a capacity adjustment process until the degree of deterioration of the running performance indicated by the second performance data of the cache medium when running after the capacity continues to be reduced compared with the running performance indicated by the first performance data is greater than the deterioration threshold, and then determine the upper limit value based on the capacity of the cache medium that is reduced multiple times. The capacity adjustment process includes: continuing to reduce the available capacity of the cache medium, and obtaining the second performance data of the business application program when running based on the cache medium after the capacity continues to be reduced.

[0138] In a possible implementation, the processing module 1102 is specifically configured to: when the running performance indicated by the second performance data obtained after the capacity is continuously reduced is initially deteriorated to a degree greater than the deterioration threshold compared to the running performance indicated by the first performance data, determine the sum of the capacity of the cache medium that has been reduced before the current capacity reduction as the upper limit value.

[0139] In a possible implementation, the processing module is specifically configured to: when the running performance indicated by the second performance data obtained after the capacity is reduced is not deteriorated to a degree not greater than the deterioration threshold compared to the running performance indicated by the first performance data, determine the upper limit value as 0. At this time, the processing module is further configured to restore the available capacity of the cache medium to the value before the capacity is reduced.

[0140] In a possible implementation, the processing module 1102 is specifically configured to: set at least one target storage unit in the cache medium to an unavailable state, and the available capacity of the cache medium that is reduced is the capacity of the at least one target storage unit.

[0141] In a possible implementation, the processing module 1102 is further configured to: migrate data stored in at least one target storage unit in the cache medium to other storage units or memory, the other storage units being storage units in the cache medium other than the at least one target storage unit, and the available capacity of the cache medium that is reduced is the capacity of the at least one target storage unit.

[0142] In a possible implementation, the processor includes a plurality of core sets, each core set including one or more processor cores, the cache medium includes a plurality of sub-mediums corresponding to the plurality of core sets, and the plurality of target storage units include storage units distributed in each of the plurality of sub-mediums, and the available capacity of the cache medium that is reduced is the capacity of the plurality of target storage units.

[0143] In a possible implementation, the plurality of target storage units are distributed in the plurality of sub-mediums with the same capacity.

[0144] In a possible implementation, the available capacity of the cache medium that is reduced is an integer multiple of the capacity of one storage unit.

[0145] Here, the detailed working processes of the obtaining module 1101 and the processing module 1102 are described in the foregoing method embodiments. For example, the obtaining module 1101 obtains the first performance data of the service application running by using the foregoing step 301, and obtains the second performance data of the service application running based on the reduced capacity of the cache medium by using the foregoing step 303. The processing module 1102 reduces the available capacity of the cache medium by using the foregoing step 302, and determines the upper limit value of the capacity of the cache medium that can be reduced based on the degradation degree of the running performance indicated by the second performance data compared with the running performance indicated by the first performance data by using the foregoing step 304. The embodiments of the present application do not repeat the description here.

[0146] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of each component described above can refer to the corresponding content in the foregoing method embodiments, which will not be described here.

[0147] The hardware device of the embodiments of the present application is illustrated below.

[0148] The storage capacity adjustment method of the computing device of the embodiments of the present application is introduced above. Corresponding to the foregoing method, the embodiments of the present application also provide a computing device. FIG. 2 provides a schematic diagram of one possible structure of the computing device. The processor of the computing device is provided with a cache medium, and the cache medium is arranged outside the processor core of the processor. The computing device also includes an operating system. The computing device is used to execute the storage capacity adjustment method of the computing device and / or the storage capacity analysis method of the computing device provided by the embodiments of the present application.

[0149] For example, the processor is used to determine a first storage unit in the cache medium, and the total capacity of the first storage unit is less than or equal to the upper limit value of the capacity of the cache medium that can be reduced. The processor is used to transfer the management right of the first storage unit to the operating system. The operating system is used to allocate the first storage unit to the service application running in the processor after receiving the memory application request of the service application.

[0150] In one possible implementation, when the total capacity of the first storage unit is less than the upper limit value of the capacity of the cache medium that can be reduced, the processor is used to determine a second storage unit in the cache medium when the first storage unit is used up, and the total capacity of the first storage unit and the second storage unit is less than or equal to the upper limit value of the capacity of the cache medium that can be reduced. The processor is also used to transfer the management right of the second storage unit to the operating system. The operating system is also used to allocate the second storage unit to the service application running in the processor after receiving the memory application request of the service application.

[0151] In a possible implementation, the storage unit in the cache medium managed by the operating system is the target storage unit. The processor is specifically configured to set the target storage unit to the locked state, and instruct the operating system to manage the target storage unit.

[0152] In a possible implementation, the storage unit in the cache medium managed by the operating system is the target storage unit. The processor is further configured to migrate data stored in the target storage unit to other storage units or memory before transferring the management right of the target storage unit to the operating system, the other storage units being storage units in the cache medium except the target storage unit.

[0153] In a possible implementation, the processor includes a plurality of core sets, each core set including one or more processor cores, the cache medium includes a plurality of sub-medium corresponding to the plurality of core sets, and the storage unit in the cache medium managed by the operating system includes storage units distributed in each of the plurality of sub-medium.

[0154] In a possible implementation, the storage unit in the cache medium managed by the operating system is distributed in the storage units in the plurality of sub-medium, and the capacities of the storage units are the same.

[0155] In a possible implementation, the storage unit in the cache medium managed by the operating system is mapped to one or more isolated storage spaces.

[0156] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of each component described above can refer to the corresponding content in the foregoing method embodiments, which will not be described herein.

[0157] The embodiments of the present application further provide a computer program product containing instructions. The computer program product can be software or a program product containing instructions, which can run on a computing device or be stored in any available medium. When the computer program product runs on at least one computing device, the at least one computing device is caused to execute the storage capacity adjustment method of the computing device and / or the storage capacity analysis method of the computing device provided by the embodiments of the present application.

[0158] The embodiment of the present application further provides a computer readable storage medium. The computer readable storage medium can be any available medium or data storage device that can be accessed by a computing device, such as a data center containing one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk), etc. The computer readable storage medium includes instructions indicating the computing device to execute the storage capacity adjustment method and / or the storage capacity analysis method of the computing device provided by the embodiment of the present application, or to execute the storage capacity adjustment method and / or the storage capacity analysis method of the computing device provided by the embodiment of the present application.

[0159] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by programs instructing relevant hardware to complete, and the programs can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0160] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the present application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions. For example, the raw data and executable codes involved in the present application are obtained under sufficient authorization.

[0161] In the embodiments of the present application, the terms "first", "second" and "third" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance. The term "at least one" means one or more, and the term "multiple" means two or more, unless otherwise explicitly limited.

[0162] In the present application, the term "and / or" is only used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in this paper generally represents that the front and rear associated objects are in an "or" relationship.

[0163] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the protection scope of the technical solutions of the embodiments of the present application.

Claims

1. A storage capacity analysis method of a computing device, characterized by, A cache medium is arranged in a processor of a computing device, the cache medium is arranged outside a processor core of the processor, the processor is used to run a business application, and the method comprises: The processor obtains first performance data of the business application when running, the first performance data is used to indicate running performance of the business application when running based on the cache medium; The processor reduces available capacity of the cache medium; The processor obtains second performance data of the business application when running based on the cache medium after the capacity is reduced, the second performance data is used to indicate running performance of the business application when running based on the cache medium after the capacity is reduced; The processor determines an upper limit value of the capacity that can be reduced for the cache medium based on a degree of deterioration of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data.

2. The method of claim 1, wherein, The processor determines an upper limit value of the capacity that can be reduced for the cache medium based on a degree of deterioration of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data, comprising: When the degree of deterioration of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data is not greater than a deterioration threshold, the processor repeatedly performs a capacity adjustment process until the degree of deterioration of the running performance indicated by the second performance data of the cache medium when running after the capacity continues to be reduced compared with the running performance indicated by the first performance data is greater than the deterioration threshold, and then determines the upper limit value based on the capacity of the cache medium that is reduced multiple times; The capacity adjustment process comprises: continuing to reduce the available capacity of the cache medium, and obtaining second performance data of the business application when running based on the cache medium after the capacity continues to be reduced.

3. The method of claim 2, wherein, The processor determines the upper limit value based on the capacity of the cache medium that is reduced multiple times, comprising: When the degree of deterioration of the running performance indicated by the second performance data obtained after the capacity continues to be reduced compared with the running performance indicated by the first performance data is greater than the deterioration threshold for the first time, the processor determines a sum of the capacity of the cache medium that is reduced before the current capacity reduction as the upper limit value.

4. The method of claim 1, wherein, The processor determines an upper limit value of the capacity that can be reduced for the cache medium based on a degree of deterioration of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data, comprising: When the degree of deterioration of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data is not greater than a deterioration threshold, the processor determines the upper limit value as 0.

5. The method according to any one of claims 1 to 4, characterized in that, The processor reduces the available capacity of the cache medium, comprising: The processor sets at least one target storage unit in the cache medium to an unavailable state, and the reduced available capacity of the cache medium is the capacity of the at least one target storage unit.

6. The method of any one of claims 1 to 5, wherein, Before the processor reduces the available capacity of the cache medium, the method further comprises: The processor migrates data stored in at least one target storage unit of the cache medium to other storage units or memory, the other storage units being storage units of the cache medium other than the at least one target storage unit, and the reduced available capacity of the cache medium being the capacity of the at least one target storage unit.

7. The method of any one of claims 1 to 6, wherein, The processor includes a plurality of core sets, each core set including one or more processor cores, the cache medium includes a plurality of sub-media correspondingly configured for the plurality of core sets, and the plurality of target storage units include storage units distributed in each of the plurality of sub-media, and the reduced available capacity of the cache medium being the capacity of the plurality of target storage units.

8. The method of claim 7, wherein, The plurality of target storage units are distributed in the plurality of sub-media with the same capacity.

9. The method of any one of claims 1 to 8, wherein, The reduced available capacity of the cache medium is an integer multiple of the capacity of one storage unit.

10. A storage capacity analysis apparatus of a computing device, characterized by comprising: The processor of the computing device is provided with a cache medium, the cache medium being arranged outside processor cores of the processor, the processor being configured to execute a business application, and the apparatus comprises: an obtaining module configured to obtain first performance data of the business application when running, the first performance data being used to indicate a running performance of the business application when running based on the cache medium; a processing module configured to reduce an available capacity of the cache medium; the obtaining module is further configured to obtain second performance data of the business application when running based on the cache medium after the capacity is reduced, the second performance data being used to indicate a running performance of the business application when running based on the cache medium after the capacity is reduced; the processing module is further configured to determine an upper limit value of the cache medium that can be reduced in capacity based on a degree of deterioration of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data.

11. The apparatus of claim 10, wherein, The processing module is specifically configured to: when the degree of deterioration of the running performance indicated by the second performance data obtained after the capacity is reduced compared with the running performance indicated by the first performance data is not greater than a deterioration threshold, repeatedly perform a capacity adjustment process until the degree of deterioration of the running performance indicated by the second performance data of the cache medium when running after the capacity is continuously reduced compared with the running performance indicated by the first performance data is greater than the deterioration threshold, and then determine the upper limit value based on the capacity of the cache medium that is reduced multiple times; wherein the capacity adjustment process includes continuously reducing the available capacity of the cache medium and obtaining the second performance data of the business application when running based on the cache medium after the capacity is continuously reduced.

12. The apparatus of claim 11, wherein, The processing module is specifically configured to: when the degree of deterioration of the running performance indicated by the second performance data obtained after the capacity is continuously reduced compared with the running performance indicated by the first performance data is initially greater than the deterioration threshold, determine a sum of the capacity of the cache medium that has been reduced before the current capacity reduction as the upper limit value.

13. The apparatus of claim 10, wherein, The processing module is specifically configured to: When the second performance data obtained after the capacity is reduced indicates that the degradation of the running performance compared to the running performance indicated by the first performance data is not greater than a degradation threshold, the upper limit value is determined as 0.

14. The apparatus of any one of claims 10 to 13, wherein, The processing module is specifically configured to: Set at least one target storage unit in the cache medium to an unavailable state, and the reduced available capacity of the cache medium is the capacity of the at least one target storage unit.

15. The apparatus of any of claims 10 to 14, wherein, The processing module is further configured to migrate data stored in the at least one target storage unit in the cache medium to other storage units or memory, the other storage units being storage units in the cache medium other than the at least one target storage unit, and the reduced available capacity of the cache medium being the capacity of the at least one target storage unit.

16. The apparatus of any one of claims 10 to 15, wherein, The processor includes a plurality of core sets, each core set including one or more processor cores, the cache medium includes a plurality of sub-mediums corresponding configured for the plurality of core sets, and the plurality of target storage units include storage units distributed in each of the plurality of sub-mediums, and the reduced available capacity of the cache medium is the capacity of the plurality of target storage units.

17. The apparatus of claim 16, wherein, The plurality of target storage units are distributed in the plurality of sub-mediums with the same capacity.

18. The apparatus of any one of claims 10 to 17, wherein, The reduced available capacity of the cache medium is an integer multiple of the capacity of one storage unit.

19. A computing device, comprising: The computing device includes a processor and a plurality of memories, and the memories store program instructions, and the processor executes the program instructions, so that the computing device executes the method of any of claims 1 to 9.

20. A computer-readable storage medium, characterized in that, The program instructions, when executed on a computing device, cause the computing device to execute the method of any of claims 1 to 9.

21. A computer program product comprising instructions, wherein: The instructions, when executed on a computing device, cause the computing device to execute the method of any of claims 1 to 9.

Citation Information

Patent Citations

  • Data caching method and device, electronic equipment and storage medium

    CN114048152A

  • System capacity adjusting method and device, storage medium and electronic equipment

    CN117349017A

  • Performance detection method, performance detection device and computer readable storage medium

    CN117389846A

  • Cache space adjustment method and device, electronic equipment and medium

    CN117850659A

  • Method and apparatus of capacity learning for computer systems and applications

    US20060287739A1