Prefetch configuration optimization method for sharing prefetcher in multiple core groups

By sampling performance feature data, scheduling applications and real-time monitoring of memory bandwidth in the multi-core group shared prefetcher architecture, optimizing prefetch configurations, the challenge of optimization of prefetch configurations within multi-core group is solved and system performance is improved.

CN119917443AActive Publication Date: 2025-05-02ZHEJIANG UNIV +1

Patent Information

Application Number
CN202411813108.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-05-02
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

In the processor architecture where multiple core groups share L2 cache and prefetchers, how to optimize the prefetcher configuration to improve system performance and avoid memory bandwidth contention and cache pollution.

Method used

By sampling performance characteristic data of processor cores in each core group, compute prefetch yield ratios and secondary cache missing rates, the application is scheduled to equalize prefetch yields, and monitor and optimize prefetch configurations in real time based on memory bandwidth occupancy.

Benefits of technology

Ensure that the prefetch revenue of applications within the core group is close, reduces L2 cache contention, and dynamically optimizes the prefetch configuration to improve the overall system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917443A_ABST
    Figure CN119917443A_ABST
Patent Text Reader

Abstract

The invention discloses a prefetch configuration optimization method of a shared prefetcher in multiple core groups, which is characterized by comprising the following steps of: sampling performance characteristic data, and obtaining a prefetch income ratio and a second-level cache missing rate of each application program under different prefetch configurations; scheduling all the application programs based on the second-level cache missing rate and the prefetch income ratio to obtain application program groups running in each core group; sampling the core performance characteristic data, and obtaining a core group prefetching income ratio and a memory bandwidth occupation lifting value of each core group under different prefetching configurations; comparing the core group prefetching income ratios of each core group under different prefetching configurations, and configuring the prefetching configuration corresponding to the highest core group prefetching income ratio for each core group; monitoring the memory bandwidth in real time according to the memory bandwidth occupancy increase value, and optimizing the prefetching configuration of the prefetcher in the core group; the method has the advantages that the prefetching configuration of the prefetcher is optimized, and the overall performance of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a prefetch configuration optimization method for a prefetcher, in particular to a prefetch configuration optimization method for a prefetcher shared within a plurality of core groups. Background Art

[0002] Data prefetching technology is an effective method to improve system performance. With the development of computer hardware and software, the speed of processors has far exceeded the speed of memory. In order to bridge this gap, data prefetching technology is widely used in modern computer systems. Data prefetching reduces memory access latency by loading data into the cache before the processor actually needs it. This process is usually based on the prefetcher's prediction of the program's access pattern, and loads the data that may be needed from the main memory or other low-speed storage devices into the cache in advance. This technology can significantly improve the processor utilization and overall system performance and reduce the time the processor waits for data. Therefore, optimizing the prefetch configuration of the prefetcher is crucial to improving system performance. However, this task faces challenges in a multi-core processor environment. An overly aggressive prefetch configuration may cause contention for memory bandwidth and cache pollution, reducing system performance; while an overly conservative prefetch configuration may not be able to load data into the cache in time. To solve these problems, current research is committed to dynamically selecting the optimal prefetch configuration for the prefetcher during runtime, and using heuristic strategies or machine learning techniques to dynamically adjust according to the performance characteristics of the application.

[0003] The current prefetcher prefetch configuration optimization method is mainly aimed at the processor architecture in which each core has its own L2 cache prefetcher, that is, each core has its own L1 and L2 cache, and multiple cores share the L3 cache. In this architecture, each L2 cache is equipped with a corresponding L2 cache prefetcher group, which contains multiple prefetchers that can pre-load data into the cache according to different access modes. By adjusting the parameters of these L2 cache prefetcher groups, the data prefetching in the corresponding L2 cache can be optimized, thereby improving the performance of the corresponding core.

[0004] However, the above optimization scheme is not applicable to the architecture of multiple core groups sharing L2 cache and prefetcher, wherein each core group includes multiple processor cores, L1 cache with the same number as the processor core, a L2 cache and a L2 cache prefetcher, and multiple core groups share L3 cache. Under the design of this processor architecture, each core group shares a L2 cache prefetcher, and a prefetcher serves all processor cores in the core group, but only serves one processor core at any time. Therefore, adjusting the prefetch configuration of the L2 cache prefetcher in this processor architecture will affect the data prefetching and performance of all processor cores in the entire core group. For example, when prefetching intentional applications and prefetching harmful applications are running on different processor cores of the same core group, if the prefetching aggressiveness parameter is improved according to the characteristics of the prefetching beneficial applications, it will cause serious performance degradation of the prefetching harmful applications. In addition, even in the case where the applications are beneficial to prefetching, due to different prefetching benefits, blindly adjusting the prefetching aggressiveness parameter will also cause waste of shared resources (such as memory bandwidth). Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a prefetch configuration optimization method for a shared prefetcher in multiple core groups, which not only optimizes the prefetch configuration of the prefetcher, but also improves the overall performance of the system.

[0006] The technical solution adopted by the present invention to solve the above technical problem is: a prefetch configuration optimization method for a shared prefetcher in multiple core groups, comprising the following steps:

[0007] Step ①, sampling the performance characteristic data of the applications distributed on all processor cores in each core group under different prefetch configurations, and obtaining the prefetch benefit ratio and the L2 cache miss rate of each application under different prefetch configurations according to the performance characteristic data;

[0008] Step ②, schedule all applications based on the L2 cache miss rate and prefetch benefit ratio to obtain the application group running in each core group;

[0009] Step ③, sampling the core performance characteristic data of all processor cores in each core group when running under different prefetch configurations, and obtaining the core group prefetch benefit ratio and memory bandwidth occupancy improvement value of each core group under different prefetch configurations according to the core performance characteristic data;

[0010] Step ④, compare the core group prefetch benefit ratios of each core group under different prefetch configurations, and configure a prefetch configuration corresponding to the highest core group prefetch benefit ratio for each core group;

[0011] Step ⑤, monitor the memory bandwidth in real time according to the memory bandwidth usage improvement value, and optimize the prefetch configuration of the prefetcher in the core group;

[0012] Step ⑥, repeat step ⑤, when the number of times step ⑤ is executed exceeds the preset fixed number of times, return to step ①.

[0013] Compared with the prior art, the advantages of the present invention are that the performance characteristic data of applications distributed on all processor cores in each core group under different prefetch configurations are sampled, and the prefetch benefit ratio and the secondary cache miss rate of each application under different prefetch configurations are obtained according to the performance characteristic data, all applications are scheduled based on the secondary cache miss rate and the prefetch benefit ratio, and the application group running in each core group is obtained, so as to ensure that the applications in the core group have similar prefetch benefits, and avoid the situation that when there is a large difference in the prefetch benefits of the subsequent applications in the core group, after the prefetch configuration is adjusted according to the average prefetch benefit of the core group, the performance of some applications is seriously degraded. In addition, scheduling is performed according to the secondary cache miss rate of the application, so as to alleviate the secondary cache contention problem in the core group; the core performance characteristic data of all processor cores in each core group under different prefetch configurations are sampled when they are running, and the core group prefetch benefit ratio and the memory bandwidth occupancy improvement value of each core group under different prefetch configurations are obtained according to the core performance characteristic data, and the prefetch configuration of the secondary cache prefetcher of the core group is dynamically optimized according to the core group prefetch benefit ratio and the system memory bandwidth occupancy, thereby improving the overall performance of the system.

[0014] Furthermore, the prefetch configuration includes closed prefetch, conservative prefetch and aggressive prefetch.

[0015] Furthermore, the specific operation process of step ① is as follows:

[0016] Step ①-1, sampling the performance characteristic data of the application programs distributed on all the processor cores in each core group under different prefetch configurations during operation through the performance monitoring unit of the processor, wherein the performance characteristic data includes the number of cycles, the number of instructions executed, the number of L2 cache hits, the number of L2 cache misses, and the memory bandwidth usage within the sampling period;

[0017] Step ①-2, calculate the prefetch benefit ratio and L2 cache miss rate of each application under different prefetch configurations based on the number of cycles, number of executed instructions, number of L2 cache hits, number of L2 cache misses, and memory bandwidth usage:

[0018] When the prefetch configuration is config, the prefetch benefit ratio is recorded as P2B_ratio config , Among them, IPC_ratio config Indicates the performance improvement ratio when the prefetch configuration is config. IPC config Indicates the number of instructions per cycle of the core when the prefetch configuration is config, IPC prefetch_off Indicates the number of instructions per cycle of the core when the prefetch configuration is turned off. The number of instructions per cycle is the ratio of the number of instructions executed to the number of cycles. config indicates the type of prefetch configuration, bandwidth_ratio config Indicates the bandwidth usage improvement ratio when the prefetch configuration is config. bandwidth config Indicates the core memory bandwidth usage when the prefetch configuration is config, bandwidth prefetch_off Indicates the memory bandwidth usage of the core when prefetch is configured to be turned off;

[0019] The L2 cache miss ratio when prefetch is configured as config is recorded as L2_miss_ratio. Among them, L2cache miss represents the number of L2 cache misses, and L2cache hit represents the number of L2 cache hits.

[0020] Furthermore, the specific operation process of step ② is as follows:

[0021] Step ②-1, according to the L2 cache miss rate of each application under different prefetch configurations, obtain the average L2 cache miss rate of each application, and sort all applications from small to large according to the average L2 cache miss rate of each application to obtain sorted applications;

[0022] Step ②-2, according to the prefetch benefit ratio of each application under different prefetch configurations, the average prefetch benefit ratio of each application is obtained, the sorted applications are grouped based on the number of core groups, and the groups are sorted from small to large according to the average prefetch benefit ratio of each application, and the average prefetch benefit ratio of each application is obtained. Group application grouping, where M represents the total number of applications and N represents the total number of core groups. Indicates rounding up;

[0023] Step ②-3, evenly schedule the applications with the same ranking in each group of application groups to different processor cores of the same core group, and obtain the application groups running in each core group. The average L2 cache miss rate is used as an indicator to measure the degree of interference of applications on the shared L2 cache. By grouping applications and assigning applications in the same cache group to different core groups, the average L2 cache miss rates between core groups are ensured to be close, effectively reducing the unbalanced interference in the shared cache; sorting applications according to their average prefetch benefit ratios, assigning applications with the same average prefetch benefit ratio ranking to the same core group, so that applications in the same core group have close average prefetch benefit ratios, thereby enhancing the effect of subsequent prefetch configuration optimization and avoiding the problem of low overall prefetch benefit and overall waste of resources.

[0024] Furthermore, the specific operation process of step ③ is as follows:

[0025] Step ③-1, sampling the core performance characteristic data of all processor cores in each core group under different prefetch configurations during operation through the performance monitoring unit of the processor, wherein the core performance characteristic data includes the number of cycles, the number of instructions executed, the number of L2 cache hits, the number of L2 cache misses, and the memory bandwidth usage within the sampling period;

[0026] Step ③-2, based on the number of cycles, the number of instructions executed, the number of L2 cache hits, the number of L2 cache misses, and the memory bandwidth usage, calculate the core group prefetch benefit ratio and the memory bandwidth usage improvement value of each core group under different prefetch configurations;

[0027] When prefetch is configured as config, the core group prefetch benefit ratio is recorded as GP2B_ratio config , Among them, IPC_group_ratio conig Indicates the core group performance improvement ratio when the prefetch configuration is config. C represents the total number of cores in a core group. Indicates the performance improvement ratio of the kth core in the core group when the prefetch configuration is config. config indicates the type of prefetch configuration. bandwidth_group_ratio config Indicates the core group bandwidth usage increase ratio when the prefetch configuration is config. group_bandwidth config Indicates the memory bandwidth usage of all cores in the core group when the prefetch configuration is config. The memory bandwidth usage of all cores in the core group when prefetch is configured to be turned off;

[0028] The memory bandwidth usage increase value when prefetch is configured as config is recorded as bandwidth_change config , bandwidth_change config =group_bandwidth config -group_bandwidth prefetch_off , where group_bandwidth config Indicates the total bandwidth usage of the core group when the prefetch configuration is config, group_bandwidth prefetch_off Represents the total bandwidth usage of the core group when the prefetch configuration is turned off. By using the geometric mean to process the average performance improvement of the core group and calculating the ratio of the average performance improvement to the overall bandwidth occupancy improvement, the benefits of the prefetch configuration are effectively revealed, overcoming the problem of inaccurate memory occupancy evaluation that may result from simply using the average of all core bandwidth occupancy improvement ratios when there are differences in the bandwidth occupancy levels of different cores. At the same time, it also solves the problem that the performance improvement ratio of applications with different instructions per cycle levels cannot be fully reflected when the core performance characteristic data is used directly, so that the prefetch configuration benefits of different applications in a multi-core environment can be more accurately evaluated and optimized.

[0029] Furthermore, in step ①-1 and step ③-1, the sampling period is 100ms.

[0030] Further, the specific operation process of step ⑤ is as follows:

[0031] Step ⑤-1, after waiting for a preset time interval, determine whether the memory bandwidth usage exceeds a preset first threshold, if so, execute step ⑤-2; if not, execute step ⑤-3;

[0032] Step ⑤-2, selecting a core group corresponding to the largest memory bandwidth occupancy improvement value from multiple core groups whose core group prefetch benefit ratios are low and whose prefetch functions are not disabled, and if the prefetch aggressiveness parameter of the prefetcher in the core group has not been reduced to the minimum, reducing the prefetch aggressiveness parameter of the prefetcher in the core group; if the prefetch aggressiveness parameter of the prefetcher in the core group has been reduced to the minimum, setting the prefetch configuration of the prefetcher in the core group to disable prefetch, and executing step ⑤-1;

[0033] Step ⑤-3, determining whether the memory bandwidth usage is lower than a preset second threshold, if so, executing step ⑤-4; if not, ending;

[0034] Step ⑤-4, select the core group corresponding to the smallest memory bandwidth occupancy improvement value from multiple core groups whose core group prefetch benefit ratios are high and whose prefetch aggressiveness parameters have not reached the highest value; if the prefetch configuration of the prefetcher in the core group is to turn off prefetch, set the prefetch configuration of the prefetcher in the core group to conservative prefetch; if the prefetch configuration of the prefetcher in the core group is not to turn off prefetch, increase the prefetch aggressiveness parameter of the prefetcher in the core group and execute step ⑤-1. The average prefetch benefit ratio of each core group and the impact of prefetching on bandwidth usage are comprehensively considered. When the system bandwidth usage is low, the prefetch aggressiveness parameters of the core groups with higher prefetch benefit ratios and less impact on bandwidth are increased first. Compared with comprehensively increasing the prefetch aggressiveness parameters of all core groups, this strategy can more effectively improve core performance while avoiding system performance instability and increased memory latency caused by excessive bandwidth usage. Conversely, when the system bandwidth usage is high, by reducing the prefetch aggressiveness parameters of the core groups with lower prefetch benefit ratios and greater impact on bandwidth usage, it is possible to reduce bandwidth usage while minimizing the performance degradation caused by reducing the prefetch aggressiveness parameters, thereby achieving the best balance between bandwidth usage and core performance.

[0035] Furthermore, in step ⑤-1, the preset time interval is 200-500ms, and the preset first threshold is 75%; in step ⑤-2, the prefetch aggression parameter of the prefetcher in the core group is reduced by 25%; in step ⑤-3, the preset second threshold is 40%; in step ⑤-4, the prefetch aggression parameter of the prefetcher in the core group is increased by 25%.

[0036] Furthermore, in step ⑥, the preset fixed number of times is 20 times. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of the processor architecture of the present invention;

[0038] Figure 2 It is a schematic diagram of the overall process of the present invention;

[0039] Figure 3 It is a schematic diagram of the specific operation flow of step ② of the present invention. DETAILED DESCRIPTION

[0040] The present invention is further described in detail below with reference to the accompanying drawings.

[0041] A method for optimizing prefetch configuration of shared prefetchers in multiple core groups, such as Figure 1As shown, the processor architecture applicable to the present invention includes a memory, a three-level cache and multiple core groups, each core group includes multiple processor cores, a first-level cache with the same number as the processor cores, a second-level cache and a second-level cache prefetcher, such as Figure 2 As shown, the specific pre-fetch configuration optimization method includes the following steps:

[0042] Step ①, sampling the performance characteristic data of the applications distributed on all processor cores in each core group under different prefetch configurations, and obtaining the prefetch benefit ratio and the L2 cache miss rate of each application under different prefetch configurations according to the performance characteristic data; the prefetch configuration includes closed prefetch, conservative prefetch and aggressive prefetch, which respectively indicate that the prefetch parameter is not enabled, the prefetcher aggressiveness parameter is the lowest value, and the prefetcher aggressiveness parameter is the highest value; the prefetcher aggressiveness parameter is determined by the configurable parameters of the processor, including prefetch distance, prefetch depth, external queue threshold and other parameters; taking the Intel Atom core group as an example, the prefetcher aggressiveness parameter includes prefetch distance (Distance) and external queue threshold (External Queue Threshold);

[0043] The specific operation process of step ① is as follows:

[0044] Step ①-1, sampling the performance characteristic data of the application programs distributed on all the processor cores in each core group under different prefetch configurations through the performance monitoring unit of the processor, the performance characteristic data including the number of cycles, the number of instructions executed, the number of L2 cache hits, the number of L2 cache misses and the memory bandwidth usage within the sampling period; the sampling period is 100ms;

[0045] Step ①-2, calculate the prefetch benefit ratio and L2 cache miss rate of each application under different prefetch configurations based on the number of cycles, number of executed instructions, number of L2 cache hits, number of L2 cache misses, and memory bandwidth usage:

[0046] When the prefetch configuration is config, the prefetch benefit ratio is recorded as P2B_ratio config , Among them, IPC_ratio config Indicates the performance improvement ratio when the prefetch configuration is config. IPC config Indicates the number of instructions per cycle of the core when the prefetch configuration is config, IPC prefetch_offIndicates the number of instructions per cycle of the core when the prefetch configuration is turned off. The number of instructions per cycle is the ratio of the number of instructions executed to the number of cycles. config indicates the type of prefetch configuration, bandwidth_ratio config Indicates the bandwidth usage improvement ratio when the prefetch configuration is config. bandwidth config Indicates the core memory bandwidth usage when the prefetch configuration is config, bandwidth prefetch_off Indicates the memory bandwidth usage of the core when prefetch is configured to be turned off;

[0047] The L2 cache miss ratio when prefetch is configured as config is recorded as L2_miss_ratio. Among them, L2cache miss represents the number of L2 cache misses, and L2cache hit represents the number of L2 cache hits;

[0048] Step ②, schedule all applications based on the L2 cache miss rate and prefetch benefit ratio to obtain the application group running in each core group;

[0049] like Figure 3 As shown, the specific operation process of step ② is as follows:

[0050] Step ②-1, according to the L2 cache miss rate of each application under different prefetch configurations, obtain the average L2 cache miss rate of each application, and sort all applications from small to large according to the average L2 cache miss rate of each application to obtain sorted applications;

[0051] Step ②-2, according to the prefetch benefit ratio of each application under different prefetch configurations, the average prefetch benefit ratio of each application is obtained, the sorted applications are grouped based on the number of core groups, and the groups are sorted from small to large according to the average prefetch benefit ratio of each application, and the average prefetch benefit ratio of each application is obtained. Group application grouping, where M represents the total number of applications and N represents the total number of core groups. Indicates rounding up;

[0052] Step ②-3, evenly dispatch applications with the same ranking in each group of application groups to different processor cores in the same core group, to obtain application groups running in each core group;

[0053] Step ③, sampling the core performance characteristic data of all processor cores in each core group under different prefetch configurations when running obtained in step ②-3, and obtaining the core group prefetch benefit ratio and memory bandwidth occupancy improvement value of each core group under different prefetch configurations according to the core performance characteristic data;

[0054] The specific operation process of step ③ is as follows:

[0055] Step ③-1, sampling the core performance characteristic data of all processor cores in each core group under different prefetch configurations during operation through the performance monitoring unit of the processor, wherein the core performance characteristic data includes the number of cycles, the number of instructions executed, the number of L2 cache hits, the number of L2 cache misses, and the memory bandwidth usage within the sampling period; the sampling period is 100ms;

[0056] Step ③-2, based on the number of cycles, the number of instructions executed, the number of L2 cache hits, the number of L2 cache misses, and the memory bandwidth usage, calculate the core group prefetch benefit ratio and the memory bandwidth usage improvement value of each core group under different prefetch configurations;

[0057] When prefetch is configured as config, the core group prefetch benefit ratio is recorded as GP2B_ratio config , Among them, IPC_group_ratio conig Indicates the core group performance improvement ratio when the prefetch configuration is config. C represents the total number of cores in a core group. Indicates the performance improvement ratio of the kth core in the core group when the prefetch configuration is config. config indicates the type of prefetch configuration. bandwidth_group_ratio config Indicates the core group bandwidth usage increase ratio when the prefetch configuration is config. group_bandwidth config Indicates the memory bandwidth usage of all cores in the core group when the prefetch configuration is config. The memory bandwidth usage of all cores in the core group when prefetch is configured to be turned off;

[0058] The memory bandwidth usage increase value when prefetch is configured as config is recorded as bandwidth_change config , bandwidth_change config =group_bandwidth config -group_bandwidth prefetch_off , where group_bandwidthconfig Indicates the total bandwidth usage of the core group when the prefetch configuration is config, group_bandwidth prefetch_off Indicates the total bandwidth usage of the core group when prefetch is configured to be turned off;

[0059] Step ④, compare the core group prefetch benefit ratios of each core group under different prefetch configurations, and configure a prefetch configuration corresponding to the highest core group prefetch benefit ratio for each core group;

[0060] Step ⑤, monitor the memory bandwidth in real time according to the memory bandwidth occupancy improvement value, and optimize the prefetch configuration of the prefetcher in the core group;

[0061] The specific operation process of step ⑤ is as follows:

[0062] Step ⑤-1, after waiting for a preset time interval, determine whether the memory bandwidth usage exceeds a preset first threshold value, if so, execute step ⑤-2; if not, execute step ⑤-3; wherein the preset time interval is 200-500ms, and the preset first threshold value is 75%;

[0063] Step ⑤-2, select the core group corresponding to the largest memory bandwidth occupancy improvement value from multiple core groups whose core group prefetch benefit ratios are low and whose prefetch functions are not disabled. If the prefetch aggressiveness parameter of the prefetcher in the core group has not been reduced to the minimum, reduce the prefetch aggressiveness parameter of the prefetcher in the core group by 25%. If the prefetch aggressiveness parameter of the prefetcher in the core group has been reduced to the minimum, set the prefetch configuration of the prefetcher in the core group to disable prefetch, and execute step ⑤-1;

[0064] Step ⑤-3, determine whether the memory bandwidth usage is lower than a preset second threshold, if yes, execute step ⑤-4; if no, end; wherein the preset second threshold is 40%;

[0065] Step ⑤-4, selecting a core group corresponding to the smallest memory bandwidth occupancy improvement value from multiple core groups whose core group prefetch benefit ratios are high and whose prefetch aggressiveness parameters have not reached the highest value, if the prefetch configuration of the prefetcher in the core group is to turn off prefetch, then setting the prefetch configuration of the prefetcher in the core group to conservative prefetch, if the prefetch configuration of the prefetcher in the core group is not to turn off prefetch, then increasing the prefetch aggressiveness parameter of the prefetcher in the core group by 25%, and executing step ⑤-1;

[0066] Step ⑥, repeat step ⑤, when the number of times step ⑤ is executed exceeds the preset fixed number of times, return to step ①, where the preset fixed number of times is 20 times.

Claims

1. A method for optimizing prefetch configuration of a shared prefetcher in multiple core groups, characterized in that The following steps are involved: Step ①, sampling the performance characteristic data of the applications distributed on all processor cores in each core group under different prefetch configurations, and obtaining the prefetch benefit ratio and the L2 cache miss rate of each application under different prefetch configurations according to the performance characteristic data; Step ②, schedule all applications based on the L2 cache miss rate and prefetch benefit ratio to obtain the application group running in each core group; Step ③, sampling the core performance characteristic data of all processor cores in each core group when running under different prefetch configurations, and obtaining the core group prefetch benefit ratio and memory bandwidth occupancy improvement value of each core group under different prefetch configurations according to the core performance characteristic data; Step ④, compare the core group prefetch benefit ratios of each core group under different prefetch configurations, and configure a prefetch configuration corresponding to the highest core group prefetch benefit ratio for each core group; Step ⑤, monitor the memory bandwidth in real time according to the memory bandwidth usage improvement value, and optimize the prefetch configuration of the prefetcher in the core group; Step ⑥, repeat step ⑤, when the number of times step ⑤ is executed exceeds the preset fixed number of times, return to step ①.

2. The method for optimizing prefetch configuration of a shared prefetcher in multiple core groups according to claim 1, characterized in that The prefetch configuration includes closed prefetch, conservative prefetch and aggressive prefetch.

3. The method for optimizing prefetch configuration of a shared prefetcher in multiple core groups according to claim 2, characterized in that The specific operation process of step ① is as follows: Step ①-1, sampling the performance characteristic data of the application programs distributed on all the processor cores in each core group under different prefetch configurations during operation through the performance monitoring unit of the processor, wherein the performance characteristic data includes the number of cycles, the number of instructions executed, the number of L2 cache hits, the number of L2 cache misses, and the memory bandwidth usage within the sampling period; Step ①-2, calculate the prefetch benefit ratio and L2 cache miss rate of each application under different prefetch configurations based on the number of cycles, number of executed instructions, number of L2 cache hits, number of L2 cache misses, and memory bandwidth usage: When the prefetch configuration is config, the prefetch benefit ratio is recorded as P2B_ratio config , Among them, IPC_ratio config Indicates the performance improvement ratio when the prefetch configuration is config. IPC config Indicates the number of instructions per cycle of the core when the prefetch configuration is config, IPC prefetch_off Indicates the number of instructions per cycle of the core when the prefetch configuration is turned off. The number of instructions per cycle is the ratio of the number of instructions executed to the number of cycles. config indicates the type of prefetch configuration, bandwidth_ratio config Indicates the bandwidth usage improvement ratio when the prefetch configuration is config. bandwidth config Indicates the core memory bandwidth usage when the prefetch configuration is config, bandwidth prefetch_off Indicates the memory bandwidth usage of the core when prefetch is configured to be turned off; The L2 cache miss ratio when prefetch is configured as config is recorded as L2_miss_ratio. Among them, L2 cache miss represents the number of L2 cache misses, and L2 cache hit represents the number of L2 cache hits.

4. The method for optimizing prefetch configuration of a shared prefetcher in multiple core groups according to claim 2, characterized in that The specific operation process of step ② is as follows: Step ②-1, according to the L2 cache miss rate of each application under different prefetch configurations, obtain the average L2 cache miss rate of each application, and sort all applications from small to large according to the average L2 cache miss rate of each application to obtain sorted applications; Step ②-2, according to the prefetch benefit ratio of each application under different prefetch configurations, the average prefetch benefit ratio of each application is obtained, the sorted applications are grouped based on the number of core groups, and the groups are sorted from small to large according to the average prefetch benefit ratio of each application, and the average prefetch benefit ratio of each application is obtained. Group application grouping, where M represents the total number of applications and N represents the total number of core groups. Indicates rounding up; Step ②-3, evenly schedule the applications with the same ranking in each group of application groups to different processor cores in the same core group to obtain the application groups running in each core group.

5. The method for optimizing prefetch configuration of a shared prefetcher in multiple core groups according to claim 3, characterized in that The specific operation process of step ③ is as follows: Step ③-1, sampling the core performance characteristic data of all processor cores in each core group under different prefetch configurations during operation through the performance monitoring unit of the processor, wherein the core performance characteristic data includes the number of cycles, the number of instructions executed, the number of L2 cache hits, the number of L2 cache misses, and the memory bandwidth usage within the sampling period; Step ③-2, based on the number of cycles, the number of instructions executed, the number of L2 cache hits, the number of L2 cache misses, and the memory bandwidth usage, calculate the core group prefetch benefit ratio and the memory bandwidth usage improvement value of each core group under different prefetch configurations; When prefetch is configured as config, the core group prefetch benefit ratio is recorded as GP2B_ratio config , Among them, IPC_group_ratio config Indicates the core group performance improvement ratio when the prefetch configuration is config. C represents the total number of cores in a core group. Indicates the performance improvement ratio of the kth core in the core group when the prefetch configuration is config. config indicates the type of prefetch configuration. bandwidth_group_ratio config Indicates the core group bandwidth usage increase ratio when the prefetch configuration is config. group_bandwidth config Indicates the memory bandwidth usage of all cores in the core group when the prefetch configuration is config. The memory bandwidth usage of all cores in the core group when prefetch is configured to be turned off; The memory bandwidth usage increase value when prefetch is configured as config is recorded as bandwidth_change config , bandwidth_change config =group_bandwidth config -group_bandwidth prefetch_off , where group_bandwidth config Indicates the total bandwidth usage of the core group when the prefetch configuration is config, group_bandwidth prefetch_off Represents the core group's overall bandwidth usage when prefetch is configured with prefetch turned off.

6. A method for optimizing prefetch configuration of a shared prefetcher in multiple core groups according to claim 3 or 5, characterized in that In step ①-1 and step ③-1, the sampling period is 100ms.

7. The method for optimizing prefetch configuration of a shared prefetcher in multiple core groups according to claim 5, characterized in that The specific operation process of step ⑤ is as follows: Step ⑤-1, after waiting for a preset time interval, determine whether the memory bandwidth usage exceeds a preset first threshold, if so, execute step ⑤-2; if not, execute step ⑤-3; Step ⑤-2, selecting a core group corresponding to the largest memory bandwidth occupancy improvement value from multiple core groups whose core group prefetch benefit ratios are low and whose prefetch functions are not disabled, and if the prefetch aggressiveness parameter of the prefetcher in the core group has not been reduced to the minimum, reducing the prefetch aggressiveness parameter of the prefetcher in the core group; if the prefetch aggressiveness parameter of the prefetcher in the core group has been reduced to the minimum, setting the prefetch configuration of the prefetcher in the core group to disable prefetch, and executing step ⑤-1; Step ⑤-3, determining whether the memory bandwidth usage is lower than a preset second threshold, if so, executing step ⑤-4; if not, ending; Step ⑤-4, select the core group corresponding to the smallest memory bandwidth occupancy improvement value from multiple core groups whose core group prefetch benefit ratios are high and whose prefetch aggressiveness parameters have not reached the highest value; if the prefetch configuration of the prefetcher in the core group is to turn off prefetch, set the prefetch configuration of the prefetcher in the core group to conservative prefetch; if the prefetch configuration of the prefetcher in the core group is not to turn off prefetch, increase the prefetch aggressiveness parameter of the prefetcher in the core group and execute step ⑤-1.

8. The method for optimizing prefetch configuration of a shared prefetcher in multiple core groups according to claim 1, characterized in that In step ⑤-1, the preset time interval is 200-500ms, and the preset first threshold is 75%; in step ⑤-2, the prefetch aggression parameter of the prefetcher in the core group is reduced by 25%; in step ⑤-3, the preset second threshold is 40%; in step ⑤-4, the prefetch aggression parameter of the prefetcher in the core group is increased by 25%.

9. The method for optimizing prefetch configuration of a shared prefetcher in multiple core groups according to claim 1, characterized in that In step ⑥, the preset fixed number of times is 20 times.

Citation Information

Patent Citations

  • Prefetching energy efficiency optimization adaptive device and method based on machine learning

    CN105955709A

  • Cache data prefetching method, processor and electronic equipment

    CN118035132A

  • Data prefetching method and device, electronic equipment, electronic device and medium

    CN118093020A

  • Systems and methods for adaptive hybrid hardware pre-fetch

    US20230022190A1

  • Method, Computer Program, and Computer System for Prefetching Data During Execution of an Application Program

    US20240143507A1

Cited By

  • Processor, display card, computer equipment and constant reading method

    CN120596427A