Systems, devices, and methods for beyond non-locality based instruction processing
By introducing locality-free load instructions and sparse access buffers into the processor, the problems of irregular memory access and bandwidth waste in sparse data processing are solved, achieving more efficient memory system performance and simplified cache design. .
Patent Information
- Application Number
- CN201810169075.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-03-31
- Filing Date
- 2018-02-28
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2038-02-28
AI Technical Summary
Modern processors have erratic and pseudo-random memory access patterns when executing sparse data processing workloads, leading to cache pollution and wasted external memory bandwidth, and the fine-grained memory access capabilities provided by newer memory interfaces complicate high-speed Cache design.
By introducing locality-free (NL) load instructions into the processor, user-level locality-free memory access instructions are used to bypass the cache hierarchy and selectively enable full-width memory accesses when the access pattern is localized. Capture locality and use sparse access buffers (SABs) in the memory controller to track local behavior to make dynamic access decisions.
It effectively reduces cache pollution and bandwidth waste, simplifies cache design, improves memory system performance, and especially significantly improves processor performance and throughput in sparse data structures and big data analysis.
Smart Images

Figure CN108694136B_ABST
Abstract
Description
Technical Field
[0001] Embodiments relate to efficient handling of memory accesses in a computing system. Background Art
[0002] Sparse data processing workloads, such as graph analytics, perform irregular memory accesses. In some cases, these accesses are to large data structures and are pseudo-random. In modern processors, complete cache lines are fetched from memory and inserted into cache memory. However, in many cases, these lines are evicted before any reuse (due to spatial or temporal locality). This leads to both cache pollution and waste of external memory bandwidth. Newer memory interfaces provide fine-grained memory access capabilities, i.e., memory accesses that are smaller than a given memory line or cache line width. However, sub-cache line memory accesses lead to partial cache lines in the processor cache hierarchy, which can complicate cache design. BRIEF DESCRIPTION OF THE DRAWINGS
[0003] Figure 1 is a block diagram of a system according to an embodiment of the present invention.
[0004] Figure 2 is a block diagram of a processor according to an embodiment of the present invention.
[0005] Figure 3 is a block diagram of a system according to an embodiment of the present invention.
[0006] Figure 4 is a flow chart of a method according to an embodiment of the present invention.
[0007] Figure 5 is a flow chart of a method according to another embodiment of the present invention.
[0008] Figure 6 is a block diagram of a sparse access buffer according to an embodiment of the present invention.
[0009] Fig. 7A is a block diagram of an exemplary in-order pipeline and an exemplary register renaming, out-of-order issue / execution pipeline to be included in a processor according to an embodiment of the present invention.
[0010] Figure 7B is a block diagram illustrating an exemplary embodiment of an in-order architecture core and an exemplary register renaming, out-of-order issue / execution architecture core to be included in a processor according to an embodiment of the present invention.
[0011] Figure 8 is a block diagram of a single-core processor and a multi-core processor with integrated memory controller and graphics according to an embodiment of the present invention.
[0012] Fig. 9 A block diagram of a system according to an embodiment of the present invention is presented.
[0013] Fig.10 A block diagram of a system on chip (SoC) according to an embodiment of the present invention is shown.
[0014] Fig.11 A block diagram is shown comparing the use of a software instruction converter for converting binary instructions in a source instruction set to binary instructions in a target instruction set in accordance with an embodiment of the present invention.
[0015] Fig.12 is a flow chart of a method according to an embodiment of the present invention.
[0016] Fig.13 is a flow chart of a method according to another embodiment of the present invention. DETAILED DESCRIPTION
[0017] In various embodiments, the processor is configured to optimize the processing of data that exhibits non-locality (referred to herein as no-locality data) by accessing the data in a fine-grained manner as possible and possibly by bypassing storage in cache memory. Some embodiments may utilize user-level no-locality memory access instructions that may be used to read and write data in a manner that bypasses the cache hierarchy. Such instructions may also be used to perform fine-grained memory access as described herein. Although the scope of the invention is not limited in this regard, such instructions include streaming load and store instructions, in response to which the core may issue several loads or stores for individual data elements accessed, the data elements carrying a hint indicating that the memory access will bypass the storage in the cache and may be narrowly processed at the memory controller.
[0018] By selectively enabling full-width memory accesses in response to certain no-locality requests as described herein, locality can be exploited when the access pattern is actually cache-friendly, for example, if a data structure accessed in a pseudo-random manner fits into an on-die cache, or if a data structure is accessed in an unexpectedly regular pattern and has a large amount of spatial locality. In this way, embodiments can take advantage of the fine-grained memory access capabilities provided by newer memory technologies without requiring significant changes to cache hierarchy designs, while capturing locality in accesses when locality exists.
[0019] In an embodiment, the processor includes microarchitectural support for "no-locality" (NL) loads. In contrast to non-temporal loads, NL loads imply neither temporal nor spatial locality. Such NL loads may cause the processor to look up the cache and return the data if a cache hit occurs, as with a regular load. Conversely, if a miss occurs and an NL request is received at the memory controller, the memory controller causes a fine-grained memory access to occur to obtain a partial cache line from memory. It should be noted that this partial cache line is not inserted into the cache, but rather bypasses the cache and is provided directly to the core.
[0020] Figure 1 1 is a block diagram of an embodiment of a system 100 that includes a processor 102 having a cache hierarchy 103 and a memory 118. The processor 102 and the memory 118 are coupled together by one or more interconnects 116. The processor 102 includes one or more cores 104. In the illustrated example, the processor 102 includes a first core 104-1, and optionally up to an Nth core 104-N. The processor may include any desired number of cores (e.g., typically in the order of one to hundreds). The core 104-1 includes one or more execution units 106-1, and the core 104-N includes one or more execution units 106-N.
[0021] Typically, the processor 102 may also have one or more caches 108, 110. These caches may represent a relatively smaller and faster type of storage than the memory 118. These caches may also be closer to the core and / or execution unit than the memory 118. These caches may be used to cache or store data loaded into the processor from the memory 118 (e.g., in response to a given memory access instruction 112, such as a load instruction) to provide faster subsequent access to the data. When the processor attempts to read or write data with the memory 118, the processor may first check whether a copy of the data is stored in the cache. If the data is found in the cache, the processor may access the data from the cache faster than if the data were accessed from the memory 118. As a result, including a cache may help reduce the average amount of time required to access data, which may enhance the performance and / or throughput of the processor.
[0022] Still reference Figure 1, cache hierarchy 103 includes multiple levels of caches that differ in their relative proximity to the cores and / or execution units of the processor. Core 104-1 has a first level cache or level 1 (L1) cache 108-1. Similarly, core 104-N has an L1 cache 108-N. Each L1 cache can be dedicated to the corresponding core it is contained in. The L1 cache represents the cache level closest to the core. The processor also has a second level cache or level 2 (L2) cache 110. The L2 cache represents the cache level that is next closest to the core. In some implementations, the L2 cache can be shared by the cores. Although not shown, one or more additional cache levels (e.g., a level 3 (L3) cache) that are further away from the core can optionally be present.
[0023] One reason for including a cache in a processor is that memory references often have locality properties. For example, references to data in memory often have temporal locality and / or spatial locality. Temporal locality means that when data is accessed from an address in memory, the same data may be accessed again within a short period of time. This may be the case, for example, when the same value is reused in a loop, when the same value is reused in a set of calculations, or for a variety of other reasons. In such cases, it may be beneficial to store the data in a cache after accessing it from memory so that subsequent accesses to the data can be performed more quickly from the cache rather than more slowly from memory.
[0024] Spatial locality means that when a given data is accessed from an address in memory, nearby data at nearby addresses may also be accessed within a short period of time. For example, two sets of data may be part of the same content (e.g., an image, table, data structure, video, etc.) and may be processed at approximately the same time. Spatial locality may also occur for a variety of other reasons. Caches exploit spatial locality by storing not only the data that was originally needed, but also nearby data from nearby addresses.
[0025] Typically, the minimum amount of data accessed from memory and stored in the cache is a full width cache line of data, even though a much smaller amount of data may be needed initially. For example, typically, an entire 512-bit cache line may be accessed from memory and stored in the cache even though only a single 8-bit, 16-bit, 32-bit, 64-bit, or 128-bit data element may be needed initially. This would be beneficial if there is spatial locality, since it is likely that additional data loaded into the cache will also be needed in the near future.
[0026] During operation, the data in the cache is constantly changing by evicting data that may not be needed in the near future to make room for data that may be needed in the near future. Various replacement algorithms and strategies are used, many of which are often based primarily on the age of the data (e.g., a least recently used indication) due to temporal locality.
[0027] The memory access instructions 112 utilize temporal and / or spatial locality by storing the data elements that have been collected from the memory 118 in the cache hierarchy 103. Many applications and data types show significant spatial and / or temporal locality in their access streams, and thus benefit from accessing and storing the entire cache line amount of data in the cache for each data element collected. However, for load and / or store instructions, not all applications and / or data types have sufficient temporal and / or spatial locality to prove that accessing and storing the entire cache line in the cache is justified. Some data elements may be needed once, but are unlikely to be needed again in the near future. For example, this may be the case in some streaming data applications, high performance computing applications, applications with very sparse memory access streams, and in various other applications. In addition, in many cases, programmers and / or software (e.g., operating systems) may be able to identify locality.
[0028] Still reference Figure 1 , one or more cores 104 may receive and execute a no-locality-hint memory access instruction 114 (e.g., a no-locality-hint load instruction such as a no-locality-hint load or gather instruction, and / or a no-locality-hint store instruction such as a no-locality-hint store or scatter instruction). The hint may indicate that the data to be accessed (e.g., gathered or scattered) has insufficient spatial and / or temporal locality. In some embodiments, the no-locality hint may be a no-temporal locality hint. In other embodiments, the no-locality hint may be a no-spatial locality hint. In still other embodiments, the no-locality hint may be a no-temporal and no-spatial locality hint. In the absence of a temporal locality hint, in some embodiments, the collected data elements may bypass the cache hierarchy 103 and / or not be stored in the cache hierarchy 103, which may help reduce cache pollution. Without a spatial locality hint, in some embodiments, accesses to data elements may be performed using only a sub-cache line size (e.g., a half or quarter cache line size), or in some cases a single data element size, which may help reduce waste of interconnect bandwidth and / or reduce power consumption. Using memory access instructions without a locality hint may help improve performance and / or reduce power consumption when spatial and / or temporal locality is insufficient.
[0029] Figure 2 2 is a block diagram of an embodiment of a processor 202 operable to execute an embodiment of a memory access instruction 214 without a locality hint. The memory access instruction without a locality hint may also be referred to herein as a load instruction without a locality hint. In some embodiments, the processor 202 may be a general-purpose processor (e.g., a general-purpose microprocessor or central processing unit (CPU) of the type used in a desktop computer, a laptop computer, or other computer). Alternatively, the processor may be a special-purpose processor. Examples of suitable special-purpose processors include, but are not limited to: a graphics processor, a network processor, a communication processor, a cryptographic processor, a coprocessor, an embedded processor, a digital signal processor (DSP), and a controller (e.g., a microcontroller). The processor 202 may be any of the following processors: various complex instruction set computing (CISC) processors, reduced instruction set computing (RISC) processors, very long instruction word (VLIW) processors, a mixture thereof, other types of processors, or a combination of different processors (e.g., in different cores).
[0030] During operation, the processor 202 may receive a no locality hint memory access instruction 214. For example, the no locality hint memory access instruction may be received from an instruction fetch unit, an instruction queue, etc. The no locality hint memory access instruction may represent a macroinstruction, an assembly language instruction, a machine code instruction, or other instructions or control signals of the processor 202 instruction set.
[0031] Still reference Figure 2 , the processor 202 includes a decoding unit or decoder 230. The decoding unit 230 can receive and decode the non-locality hint memory access instruction 214. The decoding unit 230 can output one or more microinstructions, micro-operations, microcode entry points, decoded instructions or control signals, or reflect or represent the non-locality hint memory access instruction and / or other relatively lower-level instructions or control signals derived therefrom. The one or more lower-level instructions or control signals can implement a higher-level non-locality hint memory access instruction through one or more lower-level (e.g., circuit level or hardware level) operations. The decoding unit 230 can be implemented using a variety of different mechanisms, including but not limited to: microcode read-only memory (ROM), lookup table, hardware implementation, programmable logic array (PLA), and other mechanisms for implementing a decoding unit known in the art.
[0032] Reference again Figure 2, the processor 202 also includes a set of general registers 242 and a set of packed data registers 232. The packed data registers can each represent an on-die storage location operable to store packed data, vector data, or single instruction multiple data (SIMD) data. The registers can represent architecturally visible registers (e.g., an architectural register file) visible to software and / or a programmer and / or registers indicated by instructions of an instruction set for identifying operands. The execution unit 206 is coupled to the decode unit 230 and the registers 232, 242. The execution unit 206 can receive one or more decoded or otherwise converted instructions or control signals representing a load instruction without a locality hint and / or derived therefrom.
[0033] Execution unit 206 can operate to access a location in memory in response to and / or as a result of a no-locality-hint load instruction (e.g., in response to one or more instructions or control signals decoded directly or indirectly (e.g., through emulation) from the instruction). Execution unit 206 can provide no-locality-hint load operations 248 to one or more cache controllers 244. In some embodiments, there can be a single cache level and a single cache controller (e.g., an L1 cache controller). In other embodiments, there can be two or more cache controllers (e.g., an L1 cache controller, an L2 cache controller, and optionally an L3 cache controller).
[0034] In some embodiments, if the no-locality-hint load operation 248 hits in the cache 208, the associated cache controller 244 may optionally return a sub-cache line amount of data from the cache 208 (where the cache supports sub-cache line accesses, such as a partitioned cache). In various embodiments, the sub-cache line amount of data may be only half a cache line (e.g., only 256 bits of a 512-bit cache line), only a quarter of a cache line (e.g., only 128 bits), only an eighth of a cache line (e.g., only 64 bits), or only a single data element (e.g., 1 128-bit, 64-bit, 32-bit, 16-bit, or 8-bit data element). In other cases, a full cache line may be returned on a cache hit.
[0035] Conversely, if the no-locality-hint load operation 248 misses in all caches 208, a request for data may be sent to the memory controller 246 in response to the request 249. In some embodiments, the memory controller 246 may perform a sub-cache line data access and return 250 from a memory (e.g., an external memory). And it should be noted that the associated cache controller 244 may not allocate storage space in the cache for the requested data, as it would normally do for a conventional load instruction (i.e., without a no-locality hint). In various embodiments, the sub-cache line data access and return 250 may be only half a cache line (e.g., only 256 bits), only a quarter cache line (e.g., only 128 bits), only an eighth cache line (e.g., only 64 bits), or only a single data element (e.g., a 64-bit, 32-bit, 16-bit, or 8-bit data element). That is, the memory controller 246 may load data from a memory with a smaller size access and data return than is normally used for a load operation without a no-locality hint (e.g., a conventional load operation). As a specific example, only one of a pair of 256-bit bus signals that would normally be used to access an entire 512-bit cache line amount of data may be sent from the memory controller 246 to the memory, where the bus signal sent is the bus signal containing the desired data element. In some embodiments, accesses and data returns of a minimum size sufficient to contain the desired data element may optionally be used. The memory controller 246 may provide a sub-cache line data return 250 to the cache controller(s) 244. The cache controller may provide the corresponding sub-cache line amount of data 252 to the execution unit 206. Thus, in various embodiments, a load instruction containing no locality hint may result in a sub-cache line data access and return directly to the core, thereby bypassing the cache hierarchy.
[0036] In an embodiment, the processor 202 includes a so-called sparse access buffer (SAB) 245, which is a memory structure included in or associated with the memory controller 246. The memory controller 246 registers the addresses of fine-grained accesses in this buffer. When an NL load arrives at the memory controller, the memory controller looks up the buffer. A hit to the corresponding entry in the SAB 245 implies locality (e.g., a situation where the data previously bypassed the cache, but now the line is referenced again). In one example, in response to this situation, the NL load request is selectively enabled to be processed as a regular load, thereby returning a full cache line from memory as a selective full-width return 251, and inserting it into the cache to exploit locality for future accesses. In this way, the information in the SAB 245 can be used by the memory controller 246 to selectively filter accesses with the possibility of locality and insert their target data into the cache as a full cache line, while bypassing accesses without locality.
[0037] Embodiments may be used to handle partial cache line memory accesses without using partitioned caches, which may simplify cache design. Also by embodiments, locality potential, when present, may be exploited via cache storage. NL loads with locality potential include sparse data processing workloads, which may exhibit locality potential based on the input data set (e.g., size, type, topology, etc.).
[0038] In an embodiment, a SAB structure is included in the memory controller to track the locality behavior of the memory side. With this arrangement, the SAB mainly observes low locality access traffic because high locality access is filtered by the cache. In contrast, the core side tracking will receive access flows with high locality access and low locality access. Therefore, the SAB configured on the memory side can provide much higher low locality access tracking coverage for a given number of entries. As an example, even a SAB with as few as 32 entries can provide reasonable performance, while the core side tracking may consume a much larger number of entries, such as 256k entries.
[0039] Sparse data structures are very common in big data analytics, machine learning, and high-performance computing. These workloads sometimes have very large data structures that do not fit in cache. These large data structures are often indexed by sparsely connected matrices, which leads to irregular access and reuse with poor spatial locality (e.g., loops on A[B[i]], where A is large and where B[i] can be completely random). Using fine-grained memory access via partial-width loads reduces bandwidth waste and cache pollution, thereby improving memory system performance.
[0040] In an embodiment, instruction set architecture (ISA) support for loads without locality may include special scalar loads and single instruction multiple data (SIMD) gathers that do not suggest spatial or temporal locality. As a baseline system, the following semantics may be assumed for NL loads. NL loads are allowed on cacheable write-back memories with weak ordering semantics. This allows the hardware to speculatively read the data but without inserting a (potentially partial) cache line into the cache hierarchy for snooping.
[0041] An embodiment dynamically makes a decision to determine whether to follow the NL hint or ignore the hint to store the obtained data (which may be of full width) in the cache hierarchy. For each NL load access, simply bypassing the cache may result in a performance loss based on several factors: (i) sparsely indexed data structures may be small enough to fit in the cache because the programmer often does not know the input size in advance; and (ii) sparse input data may present different access distributions that are unknown to the compiler or programmer. For example, the distribution can be uniformly random, or in the case of many social network graphs, it can present a power-law distribution, where there are several hub nodes that see many re-references, but there are many leaf nodes that are not reused. Selectively inserting hub nodes into the cache and bypassing leaf nodes will improve overall performance. As another factor, the programmer may misuse NL loads. In these cases, the mechanism for detecting the possibility of locality of NL loads can override the NL behavior. In this way, the dynamic correction mechanism according to the embodiment allows the programmer to use the NL load feature more freely.
[0042] In operation, the NL load flow starts like a regular load flow. If the NL load hits in the cache, the hardware will return the cache line as usual, insert the cache line into the (multiple) caches closer to the core, and update the use bit (although insertion and replacement can be optimized based on the NL hint). In some embodiments, if there is already an outstanding miss for the same address, the NL load miss is merged with the outstanding load. If there are no outstanding misses for the address of the NL load, it allocates a fill buffer, such as a miss status holding register (MSHR) entry with an NL flag or indicator. If there are any incoming misses for an address that already has an outstanding NL load miss, the incoming miss will not rely on the outstanding miss with the NL flag to cause a cache line. New misses can be suspended (MSHR is full), or outstanding misses with the NL flag can be converted to regular misses to be inserted into the cache.
[0043] If an NL load misses all caches and is used to access memory, the memory controller dynamically decides whether to execute this request as a regular full cache line memory access (via selective override with no locality hint) or as a fine-grained (sub-cache line width) memory access (according to no locality hint). If a full cache line access occurs, the load flow is completed as usual, the cache line is returned so that the line can be inserted into the cache(s), and the allocated MSHR entry is updated. However, if a fine-grained memory access is decided, the memory controller returns the sub-cache line data directly to the core without inserting the data into the cache. After completing this miss, the corresponding MSHR entry with the NL flag will be cleared.
[0044] Reference now Figure 3 , a block diagram of a system according to an embodiment of the present invention is shown. More specifically, system 300 includes a processor 302, i.e., a multi-core processor. As seen, processor 302 includes multiple cores 304-1 to 304-N, with corresponding dedicated cache memories (i.e., L1 caches) 306-1 to 306-N. These cache memories are in turn coupled to a shared cache memory 310, which in one embodiment may be an L2 cache (and in some cases, may be a last level cache (LLC)). Cache memory 310 is in turn coupled to a memory controller 346. In the illustrated embodiment, memory controller 346 is coupled to a sparse access buffer 345. Although shown as separate components for ease of illustration, it should be understood that in some embodiments, sparse access buffer 345 may be implemented within memory controller 346. In any event, sparse access buffer 345 is separate from core 304 as a non-core circuit component and is therefore not part of a coherent domain. Memory controller 346 in turn interfaces with system memory 360, which in one embodiment may be any type of memory structure capable of handling fine-grained accesses.
[0045] It should be understood that the memory controller 346 may further include a locality control circuit (locality controller) 347 configured to dynamically determine, in response to receiving an NL load request, whether to process the request as an NL load with NL load processing or to process the request with full-width load processing. As described herein, this determination may be based at least in part on information within the sparse access buffer 345.
[0046] Still reference Figure 3, shows a process for regular load processing and NL load processing. Specifically, for regular loads, a load request is issued from a given core 304 and provided to the cache hierarchy to determine whether the request hits in the cache hierarchy. If so, the data is returned. If a cache miss occurs, the request goes to the memory controller 346, which issues a corresponding request to the system memory 360 to obtain the full width of data (i.e., a full cache line). When this data is returned, the memory controller 346 provides the data to be inserted into the cache hierarchy and provided to the requesting core 304.
[0047] Conversely, if the NL load request misses in the cache hierarchy, the memory controller 346 accesses the sparse access buffer 345 to determine whether to process the request with NL processing or full-width processing. If the address of the request hits within the sparse access buffer 345 and the associated confidence value meets the threshold level, the memory controller 346 may process the request as a full-width load, where the processing is as discussed above. Otherwise, the memory controller 346 requests partial-width data from the system memory 360 and provides the returned data directly to the requesting core 304, bypassing the cache hierarchy. It should be understood that although in Figure 3 The embodiments are shown at this high level, but many variations and alternatives are possible.
[0048] Reference now Figure 4 , shown is a flow chart of a method according to an embodiment of the present invention. More specifically, method 400 can be performed by hardware circuitry, software, firmware, and / or a combination thereof. More specifically, method 400 can be performed by various logic and circuitry within a processor to process memory access instructions with no locality hints. As shown, method 400 begins with receiving a memory access instruction with no locality hints (frame 410). This instruction can be received in a decoding unit of a processor that decodes the instruction. Next, control is transferred to diamond frame 420, in which it is determined whether the address associated with this instruction in the cache memory hierarchy hits. If so, control is transferred to frame 430, in which data is returned to the requester. It should be understood that additional processing may occur, such as updating the recent information of the hit cache line, etc.
[0049] Still reference Figure 4, if the request misses in the cache memory hierarchy, control is transferred to box 440, in which the type of memory access processing can be determined. More specifically, at box 440, which can be executed in a locality controller of a memory controller, information for the self-sparse access buffer can be used to determine appropriate processing, as discussed above. If non-local processing is to be performed, control is transferred to box 450, in which partial width data is obtained and returned directly to the requester. The partial width data is returned directly to the requester (e.g., core) bypassing the cache hierarchy. Further, the information in the sparse access buffer can be updated. For example, if an entry for the address associated with this memory access instruction already exists, the confidence value can be updated (e.g., incremented). Or if no entry previously existed in the sparse access buffer, a new entry can be inserted for this address. Depending on the implementation of the sparse access buffer, the partial width data itself can also be stored.
[0050] Still reference Figure 4 If, instead, it is determined that selective full-width processing is to be performed for this memory access instruction, control passes to block 460 where full-width data may be obtained. This data may be provided to the requestor via the cache memory hierarchy. It should also be noted that if an entry for this address exists in the sparse access buffer, it may be removed. It should be understood that although Figure 4 The embodiments are shown at this high level, but many variations and alternatives are possible.
[0051] Thus, in an embodiment, the SAB can be used to dynamically detect potential locality for NL loads that miss in all caches, for example, through a fine-grained / full access decision. In response to a fine-grained memory access, an entry is allocated in the SAB. A new NL load received in the memory controller and hitting in the SAB indicates that this address was recently accessed, but bypassed the cache and is now being re-referenced. In this case, a confidence indicator (e.g., one or more so-called confidence bits) for identifying potential locality is incremented for this particular address. If the confidence is high enough when a new NL load is received in the memory controller, a regular full cache line memory access is performed and the data is inserted into the cache to capture locality for the next request.
[0052] Reference now Figure 5 , which is a flow chart of a method according to another embodiment of the present invention. More specifically, method 500 describes processing a load instruction with no locality hint within a processor. Thus, method 500 can be performed by hardware circuitry, software, firmware, and / or a combination thereof.
[0053] As shown, method 500 begins by determining whether the address of the NL load instruction hits in any level of the cache hierarchy (diamond 510). If so, control passes to box 520, where the data is returned to the core. Further, depending on the processor implementation, the hit data may also be inserted into one or more higher cache levels (i.e., one or more cache levels closer to the core). Conversely, if it is determined that the address of the NL load does not hit in any cache in the processor, control passes to diamond 530 to determine whether the address hits in the SAB.
[0054] If not, then the processing of this load request may occur with different flows depending on whether the SAB is implemented as a bypassed address filter (BAF) or a read combination buffer (RCB). In the case of a BAF, control passes to block 540, where the memory controller may issue a narrow data request (i.e., for sub-cache line width data), and upon receiving the requested data from the memory, bypass the cache hierarchy to return the data directly to the core. Thus, this data is not inserted into any cache memory of the cache hierarchy. Further still, in the case of a miss within the SAB, a new SAB entry may be allocated for the address associated with this NL load. In the context of an RCB implementation, in the case of a miss within the SAB for the address associated with the NL load, control passes to block 545 instead. There, the sub-cache line width data reaches the core directly, bypassing the cache hierarchy. Further still, in the case of a miss within the SAB, a new SAB entry may be allocated for the address associated with this NL load, and the partial width data itself may be stored within the allocated entry.
[0055] Still reference Figure 5 , if the address of the NL load in the SAB hits, control passes to diamond 550 to determine whether the confidence value of the hit entry exceeds the confidence threshold. In one embodiment, the confidence value may simply be a single bit that is set to one when the entry of the SAB hits for the first time. In other cases, the confidence value may be implemented as multi-bit counting information, such that for each hit to this entry, the confidence value may be updated to one, for example.
[0056] In any event, if the confidence value does not exceed the confidence threshold, control is transferred to one of blocks 560 and 565, depending on whether the SAB is implemented as a BAF (block 560) or an RCB (block 565). As shown, for a BAF implementation, partial width data is returned directly to the core, bypassing the cache hierarchy, and does not need to be inserted into any cache of the cache hierarchy. In addition, the confidence value of the entry is increased. In contrast, for an RCB implementation, partial width data is returned directly to the core from the SAB itself, bypassing the cache hierarchy. In addition, the confidence value of the entry is increased.
[0057] Still reference Figure 5 , if instead it is determined at diamond 550 that the confidence value of the hit entry exceeds the confidence threshold, then control passes to one of blocks 570 and 575, depending on the SAB implementation. In the case of a BAF implementation, at block 570, the NL hint for this NL load is overridden or ignored, causing the memory controller to request and receive the full width data and return this full width data to the core. In an embodiment, this return includes inserting into one or more caches of the cache hierarchy because, with this override, a determination of locality has been made so that the data may be used again with one or more of spatial and / or temporal locality. In addition, at block 570, the memory controller may invalidate the SAB entry associated with the address of the NL load. In this way, additional space in the SAB may be used by another NL load for a different address. In contrast, for an RCB implementation, control passes to block 575 where the NL hint for this NL load is overridden or ignored, causing the memory controller to request and receive the remaining data portion from memory and combine with the portion comprising the RCB to obtain full width data, which is returned to the core (and inserted into one or more caches of the cache hierarchy). Additionally, at block 575, the memory controller may invalidate the SAB entry associated with the address of the NL load. It should be appreciated that, although in Figure 5 are shown at this high level, but many variations and alternatives are possible.
[0058] Various types of sparse access buffer implementations are possible. Although the scope of the invention is not limited in this respect, two possible implementations include a read combining buffer (RCB) and a bypassed address filter (BAF).
[0059] In one implementation, the RCB is a small memory-side buffer included in or closely associated with a memory controller. Such an RCB may include multiple entries to store bypassed addresses, locality confidence values, and data for fine-grained access. This buffer is outside the coherence domain of the processor cache, and it only stores sub-cache line data from its memory channel that is not inserted into the cache. Data in the RCB is accessed only when the corresponding address cannot be found in the cache hierarchy. Regular writes received in the memory controller (e.g., dirty evictions from the cache) also check the RCB, and update the content if the corresponding address is valid in the RCB.
[0060] When an NL load hits in the RCB, the locality confidence value is incremented, and the load is served from the RCB to the core without any external memory access. If the confidence value of the corresponding entry is high enough, the remainder of the line is obtained from the memory, and it is combined with the part already present in the RCB to form a cache line. This line is then inserted into the cache to capture potential reuse for later access. When the line is inserted into the cache, it becomes part of the cache coherence domain, thus invalidating the corresponding entry from the RCB, which strictly excludes the CPU cache. Invalidating entries when inserted into the cache hierarchy opens up space in the RCB to allocate new entries, thereby minimizing forced evictions from the RCB and increasing effective coverage for bypassed addresses. In an embodiment, the RCB may be organized as a set associative cache to reduce the chance of conflict misses. It should be noted that the RCB may be expensive in terms of area because, in an embodiment, it may retain complete addresses, fine-grained data, and metadata.
[0061] In another implementation, the SAB can be implemented as a bypassed address filter (BAF), which can be configured as a small buffer included in or closely associated with a memory controller. This buffer retains a set of addresses that have recently bypassed the cache hierarchy and can be used to make fine-grained memory access decisions. Unlike RCB, BAF only retains addresses and confidence indicators, which can reduce regional costs. When an NL load hits in the BAF, the locality confidence indicator is incremented, and if the locality confidence value does not meet the threshold, the data is obtained from the memory via fine-grained memory access. If the confidence value meets the threshold, the request is served as a regular memory access to generate a complete cache line, which is inserted into the cache hierarchy to capture reuse for future references. When the line is inserted into the cache, the corresponding entry is invalidated from the BAF, which opens up space for allocating new entries, thereby minimizing forced evictions from the BAF and increasing the effective coverage of bypassed addresses.
[0062] It should be noted that with the BAF implementation, memory access always occurs to obtain fine-grained data. In addition, to facilitate access to a full cache line, the BAF obtains the entire cache line from memory. The RCB implementation can save memory bandwidth so that hits are served directly from the RCB, and the full cache line facilitates obtaining only the remainder of the cache line from memory. However, the area footprint of the BAF implementation can be much smaller than that of the RCB because it does not retain sub-cache line data.
[0063] In addition, BAF can keep approximate information to reduce costs without sacrificing correctness. Since BAF only affects fine-grained access decisions, errors will only lead to reduced efficiency. Approximate information can be in the form of storage of partial addresses in BAF, for example. This reduces the capacity requirements of BAF, or can be used to increase bypass address coverage with the same capacity. In the case of partial addresses, BAF may report false positives (false hits). In other words, the reference address may incorrectly match the partial address in BAF. This false positive may erroneously increase the confidence value, so it may produce a trend that makes full cache line accesses occur more frequently. This can be solved by increasing the confidence threshold. However, these false positives will not cause any correctness problems. It should be noted that retaining partial addresses is impossible for RCB implementations because false positives may cause erroneous data to be returned to the core.
[0064] If a complete address (e.g., cache line address and block offset) is provided to the memory controller, the SAB can be used to track spatial and temporal locality. For example, assuming an 8-byte (B) tracking granularity, for each 64B cache line, the SAB entry can include 8 confidence counters (note that the confidence counter can be as low as 1 bit). For each cache line, the sum of all counters can be combined to give a temporal locality confidence, and adjacent counters with non-zero confidence values can indicate the spatial locality confidence of the bypassed address. These temporal / spatial confidence counters are used to determine the threshold for promoting access to regular complete memory accesses. In the simplest version, the tracking granularity matches the cache line size and a single one-bit counter is used. Therefore, in this simplest configuration, after the first hit in the SAB (a temporal hit to the same block or a spatial hit to another block in the same cache line), the access is promoted to a complete access.
[0065] Reference now Figure 6 , which is a block diagram of a sparse access buffer according to an embodiment of the present invention. More specifically, Figure 6An embodiment of the SAB 600 in the form of a bypassed address filter is shown, wherein the SAB 600 does not include storage of partial width data. In this way, with the same size buffer, information about more addresses can be stored.
[0066] As shown, the SAB 600 includes a plurality of entries 6100 to 610 n . As shown, each entry 610 includes multiple fields, including a valid field 612, a tag field 614, and a confidence field 616. In an embodiment, the valid field 612 can be a single bit that indicates whether a given entry is valid (e.g., set to a logic 1 value to indicate that the entry is valid, and vice versa). The tag field 614 can store at least a portion of the address of a given NL memory access instruction. As discussed above, in order to provide wider coverage at the expense of possible false positives, this tag portion can only store a partial address. In turn, the confidence field 616 can store one or more bits to provide confidence information. Figure 6 In the illustrated embodiment, the confidence field 616 may be a multi-counter field. For example, in a given embodiment, for an entry 610 associated with a 64B cache line, eight counters may be provided, each of which may be one or more bits. With this type of implementation, temporal locality may be determined based on the sum of the count values of each of these counters. Furthermore, spatial locality may be determined by referencing neighboring counters having non-zero values.
[0067] Different analyses of the values of the plurality of counters may be contemplated in different embodiments. For example, in one embodiment, a memory controller (and more specifically, a locality controller of such a memory controller) may simply consider the sum of the confidence values when determining whether a particular memory access instruction with a non-locality hint should be processed instead as a memory access instruction with locality (i.e., processed with a full width data return and store in the cache hierarchy). In such a case, the sum of the confidence values may be compared to a given threshold, and if the sum exceeds the threshold, locality-based processing may be selectively enabled.
[0068] In another embodiment, alternatively, the memory controller (and more specifically, the locality controller) may determine to selectively enable locality-based processing if multiple adjacent ones of these counters have non-zero values, indicating spatial locality. In still other embodiments, a combination of counter summing techniques and adjacent counter value techniques may be used. Thus, embodiments may use only spatial locality information, only temporal locality information, and / or a combination of temporal / spatial locality information to make full / partial access decisions.
[0069] Without the embodiments, simply bypassing all NL accesses may result in increased memory traffic and reduced performance due to loss of locality. By providing SAB according to the embodiments, high locality data can be selectively inserted into the cache so that re-references are serviced from the cache. Therefore, a dynamic policy based on SAB (which can be performed independently for each NL load on a given cache line basis) can provide significant memory data traffic reduction and performance improvement compared to always bypassing fine-grained accesses.
[0070] It should be noted that, although the embodiments described herein are primarily about load operations, the scope of the present invention is not limited in this respect. This is so because the embodiments can also be used to process write operations with no locality hints using the same selective enable operation. For conventional write operations, a full width cache line is received in the processor, and then at least a portion of the cache line is overwritten with new data. Thereafter, the full cache line width is written back to the memory. In contrast, for write operations with no locality hints, narrow write requests can be used to write only a portion of the cache line width to the memory, which can involve the sub-cache line processing discussed above. The selective enablement of full width processing of such write operations without locality hints can be equally applicable.
[0071] Embodiments for dynamically executing fine-grained memory access in different ways have many potential uses in HPC, big data analysis, machine learning, etc. Although the scope of the present invention is not limited in this regard, embodiments may be particularly suitable for specific workloads, such as page sorting algorithms, workloads based on sparse matrix-vector multiplication, or stochastic gradient descent algorithms. This is the case because irregular access to large data structures is very common in HPC, graphic analysis, machine learning, etc. Therefore, memory performance may become a bottleneck in these applications. Embodiments enable smaller granularity data to be obtained from memory and bypass cache when there is no locality. This operation improves cache utilization and reduces bandwidth waste, which can significantly improve the memory performance of such high-value applications while effectively utilizing the fine-grained access capabilities provided by these memories. Dynamic execution can detect locality possibilities and convert fine-grained access to regular full cache line access. Therefore, misuse of fine-grained features is dynamically corrected. This arrangement provides programmers with more freedom to use these advanced features without having to worry too much about negative performance impacts.
[0072] Fig. 7A is a block diagram illustrating an exemplary in-order pipeline and an exemplary register renaming, out-of-order issue / execution pipeline to be included in a processor according to an embodiment of the present invention. Figure 7Bis a block diagram illustrating an exemplary embodiment of an in-order architecture core and an exemplary register renaming, out-of-order issue / execution architecture core to be included in a processor according to an embodiment of the present invention. Fig. 7A and Figure 7B The solid boxes in show the in-order pipeline and in-order core, while the optional addition of dashed boxes shows the register renaming, out-of-order issue / execution pipeline and core. The out-of-order aspects will be described assuming that they are a subset of the out-of-order aspects.
[0073] exist Fig. 7A , the processor pipeline 700 includes a fetch stage 702, a length decode stage 704, a decode stage 706, an allocation stage 708, a rename stage 710, a schedule (also called dispatch or issue) stage 712, a register read / memory read stage 714, an execute stage 716, a write back / memory write stage 718, an exception handling stage 722, and a commit stage 724.
[0074] Figure 7B A processor core 790 is shown, the processor core comprising a front end unit 730 coupled to an execution engine unit 750, and the execution engine unit and the front end unit are both coupled to a memory unit 770. The core 790 may be a reduced instruction set computing (RISC) core, a complex instruction set computing (CISC) core, a very long instruction word (VLIW) core, or a hybrid or alternative core type. As yet another option, the core 790 may be a dedicated core, such as, for example, a network or communication core, a compression engine, a coprocessor core, a general purpose computing graphics processing unit (GPGPU) core, a graphics core, etc.
[0075] The front end unit 730 includes a branch prediction unit 732 coupled to an instruction cache unit 734, which is coupled to an instruction translation lookaside buffer (TLB) 736, which is coupled to an instruction fetch unit 738, which is coupled to a decode unit 740. The decode unit 740 (or decoder) can decode the instruction and generate one or more micro-operations, microcode entry points, microinstructions, other instructions or other control signals decoded from the original instruction or otherwise reflecting the original instruction or derived from the original instruction as output. The decode unit 740 can be implemented using a variety of different mechanisms. Examples of suitable mechanisms include, but are not limited to: a lookup table, a hardware implementation, a programmable logic array (PLA), a microcode read-only memory (ROM), etc. In one embodiment, the core 790 includes a microcode ROM or other medium that stores microcode for certain macroinstructions (e.g., in the decode unit 740 or within the front end unit 730). The decode unit 740 is coupled to a rename / allocator unit 752 in the execution engine unit 750.
[0076] The execution engine unit 750 includes a rename / allocator unit 752 coupled to a retirement unit 754 and a set of one or more scheduler units 756. The (multiple) scheduler units 756 represent any number of different schedulers, including reservation stations, central instruction windows, etc. The (multiple) scheduler units 756 are coupled to physical register file units 758. The (multiple) physical register file units 758 each represent one or more physical register files, where different physical register files store one or more different data types, such as scalar integers, scalar floating points, packed integers, packed floating points, vector integers, vector floating point states (e.g., instruction pointers as addresses of next instructions to be executed), etc. In one embodiment, the (multiple) physical register file units 758 include vector register units, write mask register units, and scalar register units. These register units can provide architectural vector registers, vector mask registers, and general registers. The physical register file(s) unit(s) 758 overlap with the retirement unit(s) 754 to illustrate various ways in which register renaming and out-of-order execution may be implemented (e.g., using reorder buffer(s) and retirement register file(s); using future group(s), history buffer(s) and retirement register file(s); using register maps and register pools; etc.). The retirement unit(s) 754 and the physical register file(s) unit(s) 758 are coupled to execution cluster(s) 760. The execution cluster(s) 760 include a set of one or more execution units 762 and a set of one or more memory access units 764. The execution units 762 may perform various operations (e.g., shifts, additions, subtractions, multiplications) and on various types of data (e.g., scalar floating point, packed integer, packed floating point, vector integer, vector floating point). While some embodiments may include multiple execution units dedicated to a particular function or set of functions, other embodiments may include only one execution unit or include multiple execution units that all perform all functions. Scheduler unit(s) 756, physical register file(s) units 758, and execution cluster(s) 760 are shown as possibly plural because some embodiments create separate pipelines for certain types of data / operations (e.g., scalar integer pipelines, scalar floating point / packed integer / packed floating point / vector integer / vector floating point pipelines, and / or memory access pipelines, each of which has its own scheduler unit, physical register file(s) units, and / or execution cluster, and in the case of separate memory access pipelines, certain embodiments are implemented in which only the execution cluster of that pipeline has memory access unit(s) 764). It should also be understood that where separate pipelines are used, one or more of these pipelines may be out-of-order issue / execution pipelines, and the rest are in-order pipelines.
[0077] The set of memory access units 764 is coupled to a memory unit 770, which includes a data TLB unit 772 coupled to a data cache unit 774, which is coupled to a level 2 (L2) cache unit 776. The instruction cache unit 734 and the data cache unit 774 may be considered together as a distributed L1 cache. In an exemplary embodiment, the memory access unit 764 may include a load unit, a store address unit, and a store data unit, each coupled to a data TLB unit 772 in the memory unit 770. The instruction cache unit 734 is further coupled to a level 2 (L2) cache unit 776 in the memory unit 770. The L2 cache unit 776 may be coupled to one or more other levels of cache and ultimately to the main memory.
[0078] By way of example, an exemplary register renaming, out-of-order issue / execution core architecture may implement pipeline 700 as follows: 1) instruction fetch unit 738 performs fetch and length decode stages 702 and 704; 2) decode unit 740 performs decode stage 706; 3) rename / allocator unit 752 performs allocate stage 708 and rename stage 710; 4) (multiple) scheduler units 756 perform schedule stage 712; 5) (multiple) physical register file units 758 and memory units 770 perform register read / memory read stage 714; execution cluster 760 implements execute stage 716; 6) memory unit 770 and (multiple) physical register file units 758 perform write back / memory write stage 718; 7) various units may be involved in exception handling stage 722; and 8) retire unit 754 and (multiple) physical register file units 758 perform commit stage 724.
[0079] Core 790 may support one or more instruction sets (e.g., the x86 instruction set (with some extensions that newer versions have added); the MIPS instruction set developed by MIPS Technologies, Inc. of Sunnyvale, California; the ARM instruction set (with optional additional extensions, such as NEON) of ARM Holdings, Inc. of Sunnyvale, California), including the instruction(s) described herein. In one embodiment, core 790 includes logic to support packed data instruction set extensions (e.g., AVX1, AVX2, and / or some form of universal vector friendly instruction format (U=0 and / or U=1)), thereby allowing operations used by many multimedia applications to be performed using packed data.
[0080] It should be understood that core 790 can support multithreading (executing two or more operations or sets of threads in parallel), and can accomplish such multithreading in a variety of ways, including time-division multithreading, simultaneous multithreading (where a single physical core provides a logical core for each of the threads that the physical core is simultaneously multithreading), or a combination thereof (e.g., time-division fetch and decode and subsequent operations such as Hyper-Threading (Simultaneous Multithreading).
[0081] While register renaming is described in the context of out-of-order execution, it should be understood that register renaming may be used in an in-order architecture. While the illustrated embodiment of the processor also includes separate instruction and data cache units 734 / 774 and a shared L2 cache unit 776, alternative embodiments may have a single internal cache for both instructions and data, such as an L1 internal cache, or multiple levels of internal caches. In some embodiments, the system may include a combination of internal caches and external caches external to the core and / or processor. Alternatively, all caches may be external to the core and / or processor.
[0082] exist Figure 7B As further shown in , the processor also includes a memory controller 780 that can perform the dynamic determination described herein to potentially selectively override the no-locality hint of a memory access instruction and execute the memory access instruction as if it had locality (e.g., full width load and return to core 790 via a cache hierarchy such as memory unit 770). Alternatively, when the memory controller 780 determines to process a memory access based on the no-locality hint, partial width data can be obtained and returned directly to core 790, thereby bypassing the cache hierarchy including memory unit 770. It should be noted that in Figure 7B In the illustrated embodiment, memory controller 780 includes SAB 785 .
[0083] Figure 8 is a block diagram of a processor 800 that may have more than one core, may have an integrated memory controller, and may have integrated graphics in accordance with an embodiment of the present invention. Figure 8The solid lined box in shows a processor 800 having a single core 802A, a system agent circuit 810, a set of one or more bus controller circuits 816, while the optional addition of the dashed lined box shows an alternative processor 800 having multiple cores 802A-N, and a set of one or more integrated memory controller circuits 814 in the system agent circuit 810. The integrated memory controller circuit 814 may include one or more SABs 815 as described herein to enable the memory controller to dynamically determine whether to selectively enable locality-based processing for incoming memory access requests with no locality hints. As shown in Figure 8 As further shown in FIG. 8 , processor 800 also includes graphics circuitry 808 to distribute graphics integrated within processor 800N.
[0084] The processor 800 may be a general purpose processor, a coprocessor, or a special purpose processor, for example, a network or communication processor, a compression engine, a graphics processor, a GPGPU (general purpose graphics processing unit), a high throughput integrated many core (MIC) coprocessor (including 30 or more cores), an embedded processor, an accelerator device, etc. The processor may be implemented on one or more chips. The processor 800 may be part of one or more substrates and / or may be implemented on one or more substrates using any of a variety of processing technologies such as, for example, BiCMOS, CMOS, or NMOS.
[0085] The memory hierarchy includes one or more levels of cache circuits 804A-N (including an L1 cache) within the cores 802A-N, a set of one or more shared cache circuits 1006, and external memory (not shown) coupled to the set of integrated memory controller circuits 814. The set of shared cache circuits 806 may include one or more mid-level caches, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, a last-ditch cache (LLC), and / or combinations thereof. While in one embodiment, a ring-based interconnect circuit 812 interconnects the graphics circuit 808, the set of shared cache units 806, and the system agent circuit 810 / (multiple) integrated memory controller units 814, alternative embodiments may interconnect such circuits using any number of well-known techniques. In one embodiment, coherence between the one or more cache circuits 806 and the cores 802A-N is maintained.
[0086] In some embodiments, one or more of the cores 802A-N can be multithreaded. System agent circuitry 810 includes those components that coordinate and operate cores 802A-N. System agent circuitry 810 may include, for example, a power control unit (PCU) and a display unit. The PCU may be or include logic and components for regulating the power state of cores 802A-N and / or graphics circuitry 808. The display unit may be for driving one or more externally connected displays.
[0087] The cores 802A-N may be homogeneous or heterogeneous in terms of the architectural instruction set; that is, two or more of the cores 802A-N may be capable of executing the same instruction set, while other cores may be capable of executing only a subset of the instruction set or a different instruction set. In one embodiment, the cores 802A-N are heterogeneous and include both "small" cores and "big" cores described below.
[0088] Fig. 9 is a block diagram of an exemplary computer architecture. Other system designs and configurations known in the art for laptop computers, desktop computers, tablet computers, handheld PCs, personal digital assistants, engineering workstations, servers, network devices, network hubs, switches, embedded processors, digital signal processors (DSPs), graphics devices, video game devices, set-top boxes, microcontrollers, cellular phones, smart phones, portable media players, handheld devices, and various other electronic devices are also suitable. In general, multiple systems or electronic devices that can incorporate the processors and / or other execution logic disclosed herein are generally suitable.
[0089] Reference now Fig. 9 , which is a block diagram of an exemplary system 900 according to an embodiment of the present invention. Fig. 9 As shown, multiprocessor system 900 is a point-to-point interconnect system and includes a first processor 970 and a second processor 980 coupled via a point-to-point interconnect 950. Processors 970 and 980 may each be Figure 8 A version of processor 800 of the present invention.
[0090] Processors 970 and 980 are shown as including integrated memory controller (IMC) units 972 and 982, respectively. Processor 970 also includes point-to-point (PP) interfaces 976 and 978 as part of its bus controller unit; similarly, second processor 980 includes PP interfaces 986 and 988. As seen, processors 970, 980 further include SABs 975, 985 as described herein. Processors 970, 980 may exchange information via point-to-point (PP) interface 950 using PP interface circuits 978, 988. As shown in FIG. Fig. 9As shown, IMCs 972 and 982 couple the processors to corresponding memories, namely, memory 932 and memory 934, which may be portions of main memory locally attached to the corresponding processors.
[0091] Processors 970, 980 may each use point-to-point interface circuits 976, 994, 986, 998 to exchange information with chipset 990 via separate PP interfaces 952, 954. Chipset 990 may optionally use point-to-point interface circuits 992 to exchange information with coprocessor 938 via high-performance interface 939. In one embodiment, coprocessor 938 is a special-purpose processor, such as a high-throughput MIC processor, a network or communication processor, a compression engine, a graphics processor, a GPGPU, an embedded processor, etc.
[0092] A shared cache (not shown) may be included in either processor or external to both processors but connected to the processors via the PP interconnect such that if the processors are placed in a low power mode, local cache information of either or both processors may be stored in the shared cache.
[0093] Chipset 990 may be coupled to first bus 916 via interface 996. In one embodiment, first bus 916 may be a peripheral component interconnect (PCI) bus, or a bus such as a PCI Express bus or another third generation I / O interconnect bus, although the scope of the invention is not limited in this regard.
[0094] like Fig. 9 As shown, different I / O devices 914 can be coupled to the first bus 916 along with a bus bridge 918, which can couple the first bus 916 to a second bus 920. In one embodiment, one or more additional processors 915 (e.g., a coprocessor, a high throughput MIC processor, a GPGPU, an accelerator (e.g., a graphics accelerator or a digital signal processing (DSP) unit), a field programmable gate array, or any other processor) are coupled to the first bus 916. In one embodiment, the second bus 920 can be a low pin count (LPC) bus. In one embodiment, various devices can be coupled to the second bus 920, including, for example, a keyboard and / or mouse 922, a communication device 927, and a storage unit 928 (such as a disk drive or other mass storage device), which in one embodiment may include instruction / code data 930. Further, an audio I / O 924 can be coupled to the second bus 920. It should be noted that other architectures are possible. For example, instead of Fig. 9 Instead of a point-to-point architecture, the system may implement a multi-point bus or other such architecture.
[0095] Reference now Fig.10 , shows a block diagram of a SoC 1000 according to an embodiment of the present invention. Moreover, the dashed box is an optional feature of a more advanced SoC. Fig.10 , interconnect circuit(s) 1012 are coupled to: an application processor 1010, which includes a set of one or more cores 1002A-N with cache circuit(s) 1004A-1004N, and shared cache circuit(s) 1006; system agent circuit 1010; bus controller circuit(s) 1016; integrated memory controller circuit(s) 1014, which may include SAB 1015 as described herein; a set of one or more coprocessors 1020, which may include integrated graphics logic, image processor, audio processor, and video processor; static random access memory (SRAM) circuit 1030; direct memory access (DMA) circuit 1032; and display circuit 1040, which is used to couple to one or more external displays. In one embodiment, coprocessor(s) 1020 are special purpose processors, such as network or communication processors, compression engines, GPGPUs, high throughput MIC processors, embedded processors, etc. For purposes of this application, a processing system includes any system having a processor, such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0096] The program code can be implemented in a high-level program or object-oriented programming language to communicate with the processing system. If desired, the program code can also be implemented in an assembly or machine language. In fact, the scope of the mechanism described herein is not limited to any specific programming language. In any case, the language can be a compiled or interpreted language.
[0097] One or more aspects of at least one embodiment may be implemented by representative instructions stored on a non-transitory machine-readable medium representing various logic within a processor, which, when read by a machine, causes the machine to manufacture logic to perform the techniques described herein. Such representations (referred to as "IP cores") may be stored on tangible, non-transitory machine-readable media and provided to various customers or manufacturing facilities to be loaded into a manufacturing machine that actually manufactures the logic or processor. Therefore, embodiments of the present invention also include non-transitory, tangible machine-readable media containing instructions or containing design data (e.g., hardware description language (HDL)), which defines the structures, circuits, devices, processors, and / or system features described herein. This embodiment may also be referred to as a program product.
[0098] In some cases, an instruction converter may be used to convert instructions from a source instruction set to a target instruction set. For example, the instruction converter may convert (e.g., using static binary translation, dynamic binary translation including dynamic compilation), deform, emulate, or convert instructions to one or more other instructions to be processed by the kernel. The instruction converter may be implemented in software, hardware, firmware, or a combination thereof. The instruction converter may be on the processor, outside the processor, or partially on the processor and partially outside the processor.
[0099] Fig.11 1 is a block diagram of the use of a software instruction converter for converting binary instructions in a source instruction set into binary instructions in a target instruction set according to an embodiment of the present invention. In the illustrated embodiment, the instruction converter is a software instruction converter, however, alternatively, the instruction converter may be implemented in software, firmware, hardware, or various combinations thereof. Fig.11 It is shown that a program in a high-level language 1102 can be compiled using an x86 compiler 1104 to generate x86 binary code 1106, which can be natively executed by a processor having at least one x86 instruction set core 1116. A processor having at least one x86 instruction set core 1116 represents any processor that can perform substantially the same functions as an Intel processor having at least one x86 instruction set core by compatibly executing or otherwise processing the following: (1) (1) an application or target of an object code version of an x86 instruction set core that is a substantial portion of the instruction set of an x86 instruction set core, or (2) other software that is run on an Intel processor having at least one x86 instruction set core, so as to implement a program that is compatible with a program having at least one x86 instruction set core. The x86 compiler 1104 represents a compiler that can operate to generate x86 binary code 1106 (e.g., object code) that can be executed on a processor having at least one x86 instruction set core 1116 with or without additional link processing. Similarly, Fig.11It is shown that a program in a high-level language 1302 can be compiled using an alternative instruction set compiler 1108 to generate an alternative instruction set binary code 1110 that can be natively executed by a processor 1114 that does not have at least one x86 instruction set core (e.g., a processor that has multiple cores that execute the MIPS instruction set of MIPS Technologies, Inc. of Sunnyvale, California and / or execute the ARM instruction set of ARM Holdings, Inc. of Sunnyvale, California). The instruction converter 1112 is used to convert the x86 binary code 1106 into code that can be natively executed by the processor 1114 that does not have an x86 instruction set core. This converted code is unlikely to be the same as the alternative instruction set binary code 1110 because it is difficult to make an instruction converter that can achieve this; however, the converted code will complete the general operation and be composed of instructions from the alternative instruction set. Therefore, the instruction converter 1112 represents software, firmware, hardware, or a combination thereof that allows a processor or other electronic device that does not have an x86 instruction set processor or core to execute the x86 binary code 1106 through simulation, emulation, or any other process.
[0100] As described above, embodiments may dynamically schedule non-local (e.g., streaming) load instructions. In the above embodiments, dynamic prediction is performed on each NL memory access instruction to determine whether the associated data has sufficient locality. If not, the hardware performs a narrow memory access and bypasses the cache in return. If sufficient locality is detected, the hardware treats the access as a regular load and fetches the full cache line from memory and inserts it into the cache. In the above embodiments, this prediction technique uses a specific access history to independently predict the locality of each line.
[0101] As described herein, for large input data sets with certain locality distributions, selectively converting fine-grained accesses to full memory accesses to exploit locality can work well. However, this technique incurs the expense of learning locality for each line separately because the hardware initially bypasses the cache and later accesses to the requested address are converted into full cache line memory accesses. Therefore, learning locality patterns can be a slow process when cross-address information is helpful. For example, when: (i) the working set or even the entire input data set unexpectedly fits in the on-chip cache; or (ii) a misused non-local (or streaming) load instruction touches data with locality very frequently, multiple accesses to the same line may be required to install the line into the cache.
[0102] To reduce this penalty, some embodiments further provide techniques based on memory-side performance counter tracking to predict whether cache bypassing for no-locality loads is efficient. If cache bypassing is dynamically determined to be inefficient, the processor is configured to dynamically override no-locality behavior at core-side instruction issuance. In this way, processors according to embodiments can learn certain locality patterns much faster, recovering lost performance by returning to baseline behavior (of full data access and cache storage) more quickly.
[0103] It should be noted that NL loading is only useful when cache utilization is low (high miss rate) and memory bandwidth utilization is high. Embodiments can use hardware counters to determine whether the processor operates in a system that can benefit from no locality loading, and the hardware counters include, for example, final level cache (LLC) miss rate counters (specifically misses per thousand instructions, MPKI) and optional bandwidth utilization. Of course, embodiments are not limited to these specific performance counters, and in other embodiments, the information of additional or different performance monitors can be used. If cache utilization is higher than a given threshold (and bandwidth utilization is lower than another threshold), the processor can transcend no locality behavior so that all NL loading is considered as regular loading. However, if cache utilization is lower than a threshold (and bandwidth utilization is higher than the described another threshold), the processor may benefit from the NL loading operation.
[0104] These metrics may not be enough to infer that NL loading is really useful (e.g., NL loading may still be misused in applications with high bandwidth requirements) alone. In this way, embodiments can also utilize SAB to track the addresses of NL loadings of caches that have been recently bypassed. If the total hit rate in SAB is high, then for data with locality, applications will consistently use NL loading. In this case, even if cache / bandwidth utilization indicates that NL loading may be helpful, NL behavior can still be surpassed. SAB and performance monitors can be located in or associated with a memory controller. However, the transcendence decision can be sent to the core and stored at the core. The core can use this transcendence decision to dynamically convert future NL requests in the time window into regular loading for a given time window (e.g., 10K cycles). In different embodiments, a transcendence decision can be made for all cores, a subset of cores of threads from the same process that are known to be running, a core that only executes the most recent NL loading, a thread that only executes the most recent NL loading, and / or a static instruction that only triggers the most recent NL loading.
[0105] Selective enabling (SE) based on sparse access buffers as discussed above works well for memory accesses generated via a power-law-like locality distribution, where there are a few data elements that exhibit locality, but many data elements are not reused (e.g., processing a social network graph). However, for requested addresses that are to be converted to full cache line memory accesses, this technique cannot fully recover the lost locality due to the initial bypass and (multiple) subsequent hits. An embodiment that provides an override (OR) for NL behavior can mitigate the lost locality for this situation. When the processor dynamically predicts that NL loads are inefficient and enables the override feature, the NL loads can be converted to regular loads at the core at issue time without checking any entries in the SAB. Therefore, in override mode, converting NL loads to regular loads does not incur the loss of initial bypass and (at least one) consecutive hits.
[0106] In addition, with the SE technique, a dynamic decision based on SAB tracking information occurs after a request is generated and received at the SAB. Therefore, the processor includes a microarchitectural infrastructure to handle both bypassing fine-grained replies and inserting full access replies for requests that have already been outstanding. However, in some embodiments, the transcendence technique may not implement this infrastructure in order to dynamically change requests that have already been outstanding based on memory controller determinations. This is because through the OR mechanism, requests are made regularly or without locality within the core at issue time and completed as expected, thereby simplifying microarchitectural support.
[0107] In one embodiment, the SAB structure can be simplified because the total hit rate in the SAB can be used as a statistic for identifying locality. In this way, embodiments can abandon separate confidence indicators for each fine-grained block. In other embodiments, SE techniques can complement OR techniques so that for specific data that exhibit locality, when no override is detected (e.g., no locality behavior is useful), SE can still selectively enable full access.
[0108] In an embodiment, epoch-based monitoring can be performed, where time is divided into multiple epochs. At the beginning of an epoch, statistical information collected from the epoch just completed (and possible additional previous epochs) about whether to surpass NL behavior is used to make a new surpass (or not surpass) decision. This determination can be based on one or more performance monitors, including those mentioned above. At the beginning of each epoch, the surpass logic (which can be present in the locality controller of the memory controller) can determine whether the statistical information from the previous epoch indicates an execution system that can benefit from NL loading. For example, the surpass logic can determine whether the LLC MPKI and memory bandwidth counters are higher than a predetermined threshold. Since fine-grained memory access provides benefits when the LLC miss rate is high and there is a high demand for memory bandwidth, NL loading is allowed to be performed as fine-grained access if the threshold is exceeded. Otherwise, NL loading will be converted to regular loading. In some embodiments, SAB statistics can also be analyzed at the epoch boundary. Such SAB statistics are only collected when NL loading is enabled. In some embodiments, the SAB statistics collection epoch is different from the LLC / MC statistics collection epoch.
[0109] Reference now Fig.12 , which is a flow chart of a method according to an embodiment of the present invention. More specifically, Fig.12 The method 1200 shown in the embodiment can be performed by hardware, software, firmware and / or a combination thereof, such as control logic for determining whether to exceed the NL hint of one or more memory access instructions within an epoch based on the performance monitoring information described herein. As can be seen, the method 1200 begins by receiving performance monitoring information (block 1210) on an epoch. Although the scope of the present invention is not limited in this regard, in embodiments, this performance monitoring information may include cache miss rate information such as LLC miss rate and memory bandwidth information such as memory access times per second. Control then passes to diamond 1220 to determine whether one or more of these performance monitoring values of the performance monitoring information exceeds a corresponding threshold. In some examples, a single performance monitoring value less than a threshold may be sufficient to cause control to pass to block 1240 next time to override the processing of non-local hints. In other cases, before this override processing occurs, it may be determined that more than one and possibly all performance monitoring values are less than their corresponding thresholds.
[0110] Based on the determination at diamond 1220, the non-locality hints in all memory access instructions may be overridden at the next epoch if control passes to block 1240. In this way, these memory access instructions with non-locality hints may, for example, be converted to and processed like normal load operations, e.g., so that full width data may be returned and insertion into the cache hierarchy may occur.
[0111] Still reference Fig.12 , conversely, if it is determined at diamond 1220 that one or more of these performance monitoring values exceeds the corresponding threshold, then control passes to block 1230. There, non-locality processing can be enabled at the next epoch. In this way, memory access instructions with non-locality hints can be processed accordingly, i.e., partial-width data is obtained and returned directly to the core without insertion into the cache hierarchy. It should be noted that in this example, for normal load processing, individual memory access instructions with non-locality hints can still be selectively enabled based on the SAB information of such instructions (where the SAB remains active during the epoch). It should be understood that although in Fig.12 The embodiments are shown at this high level, but many variations and alternatives are possible.
[0112] Reference now Fig.13 , shown is a flow chart of a method according to another embodiment of the present invention. More specifically, method 1300 describes further details of a dynamic non-locality override decision process. In a specific embodiment, method 1300 may be performed by a memory controller, and more specifically, may be performed by a locality controller of such a memory controller. As can be seen, method 1300 begins by receiving a plurality of performance monitoring values (box 1305) within a given epoch (i.e., the epoch just completed), and comparing these values with corresponding thresholds (diamond 1310). In an embodiment, these performance monitoring values may be obtained from LLC MPKI and memory bandwidth counters to determine whether the processor is in an operating mode that can benefit from the NL load feature. If not, the NL load behavior is overrided, and the release logic releases the incoming NL load as a regular load. More specifically, in this case (e.g., in the case where the cache miss rate and / or memory bandwidth are relatively low), control is transferred from diamond 1310 to box 1320, in which non-local load behavior override is enabled. To this end, the locality controller may send control signals to the core (eg, to issue logic, decode logic, etc.) to cause incoming memory access instructions with non-locality hints in the core itself to be converted into regular memory access instructions, such as regular load requests.
[0113] Still reference Fig.13, if at least one of the performance counters exceeds a given threshold, control passes to diamond 1330 to determine whether an override decision is currently in effect. If there is no previously enabled override decision (and there is no SAB statistics available from the previous epoch (as determined at diamond 1340)), NL load processing is enabled and SAB monitoring is started (box 1350). Such NL loading is enabled until SAB statistics are collected over at least one epoch. When sufficient SAB statistics are collected (e.g., there are sufficient statistics from the previous epoch), the SAB hit rate can be compared to a threshold (diamond 1360). Although the scope of the present invention is not limited in this regard, in an embodiment, this SAB hit rate can be set at a relatively low level, for example, about 20% or less. In a particular embodiment, a SAB hit rate of about 11% can be used as a threshold.
[0114] Based on the determination at diamond 1360, control passes to either block 1370 or block 1380. When it is determined that the SAB hit rate from the previous epoch is above this given threshold, there is a need for high bandwidth, but NL loads are localized. This may be caused by incorrect use of NL load instructions in high bandwidth applications. If the SAB hit rate is determined to be high, then NL loads are overridden at block 1370. Otherwise, if it is determined that the SAB hit rate from the previous epoch is below the given threshold, then control passes from diamond 1360 to block 1380, where NL loads are enabled on the next epoch.
[0115] It should be noted that if the decision is made to proceed to box 1370 so that all NL loads are disabled (i.e., overrided) at the next epoch, it will not be possible to use SAB monitoring to check whether program behavior has changed. Therefore, provided that the performance monitoring value is high, NL loads may be enabled periodically but infrequently at an epoch to detect changes in program behavior. To this end, in the event that NL loads are overriden, control may pass from diamond 1330 to diamond 1390 to determine whether NL load processing is periodically re-enabled at the next epoch. If so, control passes to box 1350 discussed above. Otherwise, control passes to box 1395, in which the NL load override may remain in its enabled state. It should be noted that in the event that periodic re-enabling occurs at the next epoch, the SAB hit rate may continue to be monitored to detect changes in program behavior. It should be understood that although in Fig.13 The embodiments are shown at this high level, but many variations and alternatives are possible.
[0116] It should be noted that Fig.13The simplest option is assumed where NL loads are globally disabled. However, based on the availability of the core / thread ID and instruction pointer (IP) of the load at the memory controller, override decisions can be made for individual cores, threads, or instructions. In this case, the bypassed addresses are further marked with core ID, thread ID, and / or IP, and the SAB hit / miss ratio can be tracked per core, per thread, or per IP. The override decision flow follows Fig.13 The same path shown in . If the performance counters indicate that NL loads may not be efficient, the NL behavior is globally overridden. Otherwise, if SAB statistics were collected in the previous epoch, the SAB hit rate per core / thread / IP is checked. The override decision is then passed to the core that has the core / thread / IP information. Overriding the NL behavior of a core / thread / IP does not block the NL behavior of other cores / threads / IPs. Therefore, appropriately used NL loads can be enabled while overriding incorrectly used NL loads at the core / thread / IP granularity.
[0117] In some cases, always making fine-grained accesses and bypassing caches may result in significant locality and performance loss for certain workloads. SE technology dynamically selects accesses with locality and converts them into regular memory accesses to restore lost locality and improve performance. However, SE cannot fully restore lost locations for situations where NL loads are almost always counterproductive. An embodiment with a transcendence operation can detect this situation and transcend NL loads, causing performance to fall back to the baseline. However, when NL loads do help (when some rows have locality and other rows do not), OR technology cannot fully utilize selective bypassing. A combination of OR and SE techniques can provide the benefits of both approaches. More specifically, combining these techniques can minimize outliers while providing significant performance improvements for the workloads that benefit.
[0118] Referring now to Table 1, examples of various workloads and operations thereof are shown, using: (1) selectively enabling locality-based processing of individual instructions with no locality hints (NL Enable equals "True" in Column 3); and (2) global override of no locality processing (NL Enable equals "False" in Column 3). More specifically, Table 1 shows in Column 1 whether the first performance monitoring value (i.e., LLC MPKI) exceeds the corresponding threshold for a given workload, and shows in Column 2 whether the sparse access buffer performance metric (i.e., SAB hit rate) is below the corresponding threshold. As discussed above, Column 3 indicates the override decision, where NL Enable (True) means that the global override feature is disabled. In turn, Column 4 identifies the impact of the selective enabling of locality-based hints on performance (compared to a baseline implementation followed by all NL hints). Therefore, when NL is enabled, the resulting performance will be the corresponding value from this column. On the other hand, if NL is disabled (override enabled), the resulting performance will be the baseline performance.
[0119] It is observed that in Table 1, override was enabled and therefore "on" (i.e., NL enabled was false) for 7 workloads. It is also observed that for all of these cases, the performance impact was below 1. Therefore, if NL loads were enabled, they would result in a performance loss. Thus, using the override techniques described herein, these cases can be successfully predicted and NL behavior disabled accordingly. Furthermore, it should be noted that for workloads with override operations disabled (i.e., NL enabled was true), most of the performance improvements were above 1. However, there were two outliers where NL processing was predicted to be useful and therefore override was turned off, but this resulted in a performance loss. However, as seen in Column 5, providing the override techniques as described herein was most successful in using performance monitoring information to predict positive and negative outcomes of NL load execution.
[0120] Table 1
[0121]
[0122]
[0123] Embodiment can set the selective enabling and transcending operation of global enabling / disabling NL processing by control register and / or basic input / output system (BIOS).Dynamic execution as described herein can detect locality possibility, and fine-grained access is converted into regular complete cache line access.In addition, if prediction has no benefit, then described dynamic execution can transcend such access at core.Therefore, the misuse of fine-grained features is dynamically corrected.This gives programmer more freedom to use these advanced features, without having to worry too much about negative performance impact.
[0124] The following examples relate to further embodiments.
[0125] In one example, a processor includes: a core including a decoding unit, the decoding unit being used to decode a memory access instruction with a non-locality hint, the non-locality hint being used to indicate that data associated with the memory access instruction has at least one of non-spatial locality and non-temporal locality; and a memory controller for issuing a request to a memory, the memory controller including a locality controller, the locality controller being used to determine whether to override the non-locality hint based at least in part on one or more performance monitoring values.
[0126] In an example, the one or more performance monitoring values include cache memory miss rate and memory bandwidth.
[0127] In an example, the locality controller is to override the no-locality hint in response to a comparison of at least one of the cache miss rate and the memory bandwidth to respective thresholds.
[0128] In an example, the processor further includes a sparse access buffer having a plurality of entries, each entry for storing address information and count information for a memory access instruction to a specific address.
[0129] In an example, the locality controller is further configured to override the no locality hint when a hit rate of the sparse access buffer exceeds a second threshold.
[0130] In an example, the locality controller is to obtain the one or more performance monitoring values over a first time period and override the non-locality hint over a second time period, including overriding a plurality of non-locality hints for a plurality of memory access instructions during the second time period.
[0131] In an example, the processor further includes a sparse access buffer having a plurality of entries, each entry for storing address information and count information for a memory access instruction to a specific address, the locality controller disabling the sparse access buffer during the second time period.
[0132] In an example, the locality controller is to issue an override signal to the core to cause the core to convert one or more memory access instructions with the no locality hint to one or more memory access instructions without the no locality hint.
[0133] In an example, the locality controller is used for a first memory access instruction for a first thread to override the no locality hint, and for a second memory access instruction for a second thread to not override the no locality hint.
[0134] In an example, the no-locality hint is used to cause data to be returned to the core, the return bypassing a cache memory of the processor, and in response to the overriding of the no-locality hint, the memory controller is used to cause full-width data portions to be obtained from the memory and provided to the core.
[0135] In an example, in response to the no locality hint, the memory controller is to cause a sub-cache line data portion to be obtained from the memory and provided to the core.
[0136] In another example, a method includes: receiving performance monitoring information in a controller of a processor over a first time period; comparing one or more performance monitoring values of the performance monitoring information to corresponding thresholds; and in response to at least one of the one or more performance monitoring values not exceeding the corresponding threshold, causing the processor to override a non-locality hint for one or more memory access instructions during a second time period.
[0137] In an example, causing the processor to override the no-locality hint for the one or more memory access instructions during the second time period includes sending a signal to issue logic of the processor to cause the issue logic to convert the one or more memory access instructions with the no-locality hint to one or more memory access instructions without the no-locality hint during the second time period.
[0138] In an example, the method further comprises enabling non-locality memory access instruction processing over the second time period in response to the one or more performance monitoring values exceeding the respective thresholds.
[0139] In an example, the non-locality memory access instruction processing for the first memory access instruction with the non-locality hint includes one or more of: returning data to the core, the return bypassing a cache memory of the processor; and returning a sub-cache line portion of data to the core.
[0140] In an example, the method further comprises enabling non-locality memory access instruction processing on a next time cycle after a number of time cycles in which the non-locality hint is exceeded.
[0141] In an example, the method further comprises: obtaining at least one performance metric for the sparse access buffer at the next time period; and enabling the locality-free memory access instruction processing at a time period after the next time period based at least in part on the at least one performance metric for the sparse access buffer.
[0142] In another example, a computer readable medium including instructions is used to perform the method of any of the above examples.
[0143] In another example, a computer readable medium including data is for use by at least one machine to fabricate at least one integrated circuit for performing the method of any of the above examples.
[0144] In another example, an apparatus includes means for performing the method of any of the above examples.
[0145] In yet another embodiment, a system includes: a processor having a core for processing a memory access instruction with a non-locality hint, the non-locality hint being used to indicate non-locality of data associated with the memory access instruction, the core having one or more performance monitors; a memory controller for issuing requests to a system memory, the memory controller including a locality controller for receiving the memory access instruction with the non-locality hint and for overriding the non-locality hint of the memory access instruction with the non-locality hint at a second time period based at least in part on at least one performance metric obtained from the one or more performance monitors at a first time period; and the system memory coupled to the memory controller.
[0146] In an example, during the second time period and in response to the override of the no locality hint for the memory access instruction, the memory controller is operable to return a plurality of full width cache lines to the core via a cache memory hierarchy, and during a third time period in which the no locality hint will not be overriden, the memory controller is operable to bypass cache storage and return sub-cache line width data to the core for one or more memory access instructions with the no locality hint.
[0147] In an example, in response to determining that the no locality hint of the memory access instruction with the no locality hint is overridden over the second time period, the memory controller is to issue an override signal to the core to cause the core to convert the memory access instruction with the no locality hint to a memory access instruction without the no locality hint.
[0148] In another example, an apparatus includes: a device for receiving performance monitoring information of a processor over a first time period; a device for comparing one or more performance monitoring values of the performance monitoring information with corresponding thresholds; and a device for causing the processor to override a non-locality hint for one or more memory access instructions during a second time period based at least in part on a first result of comparing the one or more performance monitoring values of the performance monitoring information with the corresponding thresholds.
[0149] In an example, the apparatus further comprises means for sending a signal to an issue device to cause the issue device to convert one or more memory access instructions with the no locality hint to one or more memory access instructions without the no locality hint during the second time period.
[0150] In an example, the apparatus further comprises means for enabling non-locality memory access instruction processing on the second time period based at least in part on a second result of comparing the one or more performance monitoring values of the performance monitoring information to the corresponding threshold value.
[0151] In an example, the apparatus further comprises means for returning data to a core means of the processor, the returning bypassing a cache memory means of the processor.
[0152] In an example, the apparatus further comprises means for returning the sub-cache line portion of the data to a core device of the processor.
[0153] It should be understood that various combinations of the above examples are possible.
[0154] It should be noted that the terms "circuit" and "circuitry" are used interchangeably herein. As used herein, these terms and the term "logic" are used to refer to analog circuitry, digital circuitry, hardwired circuitry, programmable circuitry, processor circuitry, microcontroller circuitry, hardware logic circuitry, state machine circuitry, and / or any other type of physical hardware component, either alone or in any combination. Embodiments may be used in a variety of different types of systems. For example, in one embodiment, a communication device may be arranged to perform various methods and techniques described herein. Of course, the scope of the present invention is not limited to communication devices, and on the contrary, other embodiments may relate to other types of devices for processing instructions, or one or more machine-readable media including instructions, which, in response to being executed on a computing device, cause the device to perform one or more of the methods and techniques described herein.
[0155] Embodiments may be implemented in code and may be stored on a non-transitory storage medium having stored thereon instructions that may be used to program a system to perform the instructions. Embodiments may also be implemented in data and may be stored on a non-transitory storage medium that, if executed by at least one machine, causes the at least one machine to fabricate at least one integrated circuit for performing one or more operations. Still further embodiments may be implemented in a computer-readable storage medium that includes information for configuring a SoC or other processor when fabricated into a SoC or other processor to perform one or more operations. The storage medium may include, but is not limited to, any type of disk including: a floppy disk, an optical disk, a solid-state drive (SSD), a compact disk-read only memory (CD-ROM), a compact disk-rewritable (CD-RW), and a magneto-optical disk; semiconductor devices such as read-only memory (ROM), random access memory (RAM) such as dynamic random access memory (DRAM) and static random access memory (SRAM); erasable programmable read-only memory (EPROM); flash memory; electrically erasable programmable read-only memory (EEPROM); magnetic or optical cards; or any other type of medium suitable for storing electronic instructions.
[0156] While the present invention has been described with respect to a limited number of embodiments, those skilled in the art will appreciate numerous modifications and variations therefrom. It is intended that the appended claims cover all such modifications and variations as fall within the true spirit and scope of the present invention.
Claims
1. A processor for executing instructions, the processor comprising: a core, comprising a decoding unit, the decoding unit being configured to decode a memory access instruction having a non-locality hint, the non-locality hint being configured to indicate that data associated with the memory access instruction has at least one of non-spatial locality and non-temporal locality, the non-spatial locality implying that another data near the data is unlikely to be accessed within a time period, and the non-temporal locality implying that the data is unlikely to be accessed again within a time period; as well as A memory controller is provided for issuing requests to a memory, the memory controller comprising a locality controller for determining whether to override the no-locality hint based at least in part on one or more performance monitoring values.
2. The processor according to claim 1, wherein: The one or more performance monitoring values include cache miss rate and memory bandwidth.
3. The processor according to claim 2, wherein: The locality controller is to override the no-locality hint in response to a comparison of at least one of the cache miss rate and the memory bandwidth to a respective threshold.
4. The processor according to claim 1, wherein: Further included is a sparse access buffer having a plurality of entries, each entry being used to store address information and count information for a memory access instruction to a specific address.
5. The processor according to claim 4, wherein: The locality controller is further configured to override the no locality hint when a hit rate of the sparse access buffer exceeds a second threshold.
6. The processor according to claim 1, wherein: The locality controller is operable to obtain the one or more performance monitoring values over a first time period and to override the non-locality hint over a second time period, including a plurality of non-locality hints for overriding a plurality of memory access instructions during the second time period.
7. The processor according to claim 6, wherein: The processor further includes a sparse access buffer having a plurality of entries, each entry for storing address information and count information for a memory access instruction to a specific address, the locality controller for disabling the sparse access buffer during the second time period.
8. The processor of claim 1, wherein: The locality controller is used to issue an override signal to the core to cause the core to convert one or more memory access instructions with the no-locality hint into one or more memory access instructions without the no-locality hint.
9. The processor of claim 1, wherein: The locality controller is used for a first memory access instruction for a first thread to override the no locality hint, and for a second memory access instruction for a second thread to not override the no locality hint.
10. The processor of claim 1, wherein: The no-locality hint is operable to cause data to be returned to the core, the return bypassing a cache memory of the processor, and in response to the overriding of the no-locality hint, the memory controller is operable to cause full-width data portions to be obtained from the memory and provided to the core.
11. The processor of claim 1, wherein: In response to the no-locality hint, the memory controller is operative to cause a sub-cache line data portion to be obtained from the memory and provided to the core.
12. A method for executing an instruction, the method comprising: receiving, in a controller of the processor, performance monitoring information over a first time period; comparing one or more performance monitoring values of the performance monitoring information with corresponding thresholds; as well as In response to at least one of the one or more performance monitoring values not exceeding the corresponding threshold, causing the processor to override a non-locality hint for one or more memory access instructions during a second time period, the non-locality hint being used to indicate one of non-spatial locality and non-temporal locality, the non-spatial locality suggesting that another data near the data of the one or more memory access instructions is unlikely to be accessed within a time period, and the non-temporal locality suggesting that the one or more memory access instruction data is unlikely to be accessed again within a time period.
13. The method according to claim 12, characterized in that The step of causing the processor to override the no locality hint for the one or more memory access instructions during the second time period includes sending a signal to issue logic of the processor to cause the issue logic to convert the one or more memory access instructions with the no locality hint to one or more memory access instructions without the no locality hint during the second time period.
14. The method according to claim 12, characterized in that Further comprising enabling non-locality memory access instruction processing over the second time period in response to the one or more performance monitoring values exceeding the corresponding threshold.
15. The method according to claim 14, characterized in that The non-locality memory access instruction processing for the first memory access instruction with the non-locality hint includes one or more of the following: returning data to a core of the processor, the return bypassing a cache memory of the processor; and The sub-cache line portion of data is returned to the core.
16. The method according to claim 12, characterized in that Further including: After a number of time cycles in which the no locality hint is exceeded, no locality memory access instruction processing is enabled on a next time cycle.
17. The method according to claim 16, characterized in that Further including: obtaining at least one performance metric for the sparse access buffer over the next time period; as well as Based at least in part on the at least one performance metric for the sparse access buffer, the non-locality memory access instruction processing is enabled at a time period following the next time period.
18. A computer-readable storage medium comprising computer-readable instructions, which when executed are used to implement the method of any one of claims 12 to 17.
19. A system for executing instructions, the system comprising: A processor having a core for processing a memory access instruction having a non-locality hint, the non-locality hint being used to indicate non-locality of data associated with the memory access instruction, the core having one or more performance monitors, the non-locality hint comprising at least one of non-spatial locality and non-temporal locality, the non-spatial locality implying that another data near the data is unlikely to be accessed within a time period and the non-temporal locality implying that the data is unlikely to be accessed again within a time period; a memory controller for issuing requests to a system memory, the memory controller comprising a locality controller for receiving the memory access instruction with the no locality hint and for overriding the no locality hint of the memory access instruction with the no locality hint at a second time period based at least in part on at least one performance metric obtained from the one or more performance monitors at a first time period; as well as The system memory is coupled to the memory controller.
20. The system of claim 19, wherein: During the second time period and in response to the override of the no locality hint for the memory access instruction, the memory controller is operable to return a plurality of full width cache lines to the core via a cache memory hierarchy, and during a third time period in which the no locality hint will not be overriden, the memory controller is operable to bypass cache storage and return sub-cache line width data to the core for the one or more memory access instructions with the no locality hint.
21. The system of claim 19, wherein: In response to determining that the no locality hint of the memory access instruction with the no locality hint is overridden at the second time period, the memory controller is configured to issue an override signal to the core to cause the core to convert the memory access instruction with the no locality hint to a memory access instruction without the no locality hint.
22. A device for executing an instruction, the device comprising: means for receiving performance monitoring information of a processor over a first time period; means for comparing one or more performance monitoring values of the performance monitoring information with corresponding thresholds; as well as A device for causing the processor to override a non-locality hint for one or more memory access instructions during a second time period based at least in part on a first result of comparing the one or more performance monitoring values of the performance monitoring information with the corresponding threshold, the non-locality hint being used to indicate one of non-spatial locality and non-temporal locality, the non-spatial locality suggesting that another data near the data of the one or more memory access instructions is unlikely to be accessed within a time period, and the non-temporal locality suggesting that the one or more memory access instruction data is unlikely to be accessed again within a time period.
23. The device according to claim 22, characterized in that Further including: Means for sending a signal to an issue device to cause the issue device to convert one or more memory access instructions with the no locality hint to one or more memory access instructions without the no locality hint during the second time period.
24. The device according to claim 22, characterized in that Further including: Means for enabling non-locality memory access instruction processing over the second time period based at least in part on a second result of comparing the one or more performance monitoring values of the performance monitoring information to the corresponding thresholds.
25. The device according to claim 22, characterized in that Further including: Means for returning data to a core device of the processor, the return bypassing a cache memory device of the processor.
