Tracking memory block access frequency in processor-based devices
The processor-based device uses an access count table with tracking and clearing indicators to efficiently differentiate memory block access frequencies, addressing inefficiencies in existing methods and optimizing memory allocation.
Patent Information
- Application Number
- JP2024518970
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-09-28
- Filing Date
- 2022-07-22
- Publication Date
- 2024-09-12
AI Technical Summary
Existing methods for determining memory block access frequency in processor-based devices lack sufficient granularity, leading to inefficient bandwidth usage, cache pollution, and increased processor cycles, especially when dealing with heterogeneous memory devices of varying latencies and bandwidths.
A processor-based device employs a processing element (PE) that maintains an access count table with packed access count values for each memory block, using access tracking and clearing indicators to differentiate between extremely hot and cold memory blocks, thereby reducing unnecessary incremental operations and cache thrashing.
The solution provides accurate discrimination between frequently and infrequently accessed memory blocks, optimizing memory allocation and reducing overhead by minimizing unnecessary operations and cache pollution.
Smart Images

Figure 2024533744000001
Abstract
Description
[Technical field]
[0001] TECHNICAL FIELD The techniques of this disclosure relate to memory management in processor-based devices, and more particularly, to determining the frequency of memory block accesses. [Background technology]
[0002] The memory provided by a memory device of a processor-based device may be subdivided into memory blocks. As used herein, the term "memory block" refers to any contiguous range of memory provided by a memory device of a processor-based device. A memory block in some of the embodiments may be aligned with a memory page, which is a contiguous range of memory associated with an address translation from a virtual memory address (or intermediate physical memory address) to a physical address within the contiguous range of memory. A memory block according to some of the embodiments may include a strict subset of a memory page, or conversely, a strict subset of a memory page may include a memory block.
[0003] A processor-based device that employs multiple heterogeneous memory devices with different latencies or bandwidths may encounter situations in which it is desirable to understand which blocks of memory are accessed more or less frequently over time. For example, a processor-based device may provide both low latency (i.e., having faster memory access times) memory in the form of Double Data Rate (DDR) Dynamic Random Access Memory (DRAM) memory devices with which the processor-based device having that memory can natively communicate, and high latency (i.e., having slower memory access times) memory in the form of memory devices that reside behind a media-abstracted interface or transactional interface, such as a Compute Express Link (CXL). In one potential use case, a hypervisor executing on such a processor-based device may need to determine whether to dynamically allocate guest virtual machine (VM) memory pages into low latency memory or high latency memory based on how frequently the guest VM memory pages are accessed.Similarly, for use cases where memory is oversubscribed, the software may need to identify a subset of distant memory that is sufficiently "cold" (i.e., infrequently accessed) to be a eligible candidate for transfer to swap space in a data store such as a solid state device (SSD).
[0004] One conventional approach to determining memory block access frequency uses a software solution that retrieves the value of an access indicator bit from each page table entry (PTE) of a page table used for virtual-to-physical memory address mapping or intermediate-physical-to-physical memory address mapping. However, this approach provides only a coarse indication of access frequency (i.e., accessed or not accessed), which may not provide sufficient granularity unless the access indicator bit is observed over a large window of time. This approach also requires that processor hardware, which typically manages consistency at multi-byte granularity, read multiple multi-byte PTEs to access some single bits of interest within those multiple multi-byte PTEs, which can waste bandwidth and processor cycles and cause heavier cache pollution. Another approach adds a hardware-incremented count field in each PTE, which can reduce the burden on software when counting memory block accesses. This approach, however, typically leads to similar bandwidth consumption and cache pollution problems when accessing a small subset of the contents of each PTE to determine access frequency.Yet another approach involves hardware-managed caching solutions, such as using DDR media that the host memory controller manages as one large last-level cache (LLC). This approach is not ideal as it can lead to thrashing of the cache when traditional hardware-managed caching solutions for DRAM caches are directly mapped.
[0005] Therefore, a more efficient mechanism for tracking memory block access frequency in processor-based devices is desirable. Summary of the Invention
[0006] Exemplary embodiments disclosed herein track memory block access frequency in a processor-based device. In this regard, in one exemplary embodiment, the processor-based device provides a processing element (PE) that includes an access count table for tracking accesses to the memory block. The access count table is a packed table that includes a plurality of access count values, each of which corresponds to a memory block of the plurality of memory blocks. Upon detecting a memory access operation (i.e., a data-side memory access, such as a memory load operation, a memory store operation, an atomic increment operation, and a set operation, or an instruction-side memory access, such as a code fetch operation) to a given memory block, the PE increments the access count value corresponding to the memory block. The access count value may then be accessed by a first process executing on the processor-based device and may be used to determine an access frequency for the memory block.
[0007] To reduce the number of incremental operations that a PE performs, some of the embodiments may increment the access count only for memory access operations that result in a translation lookaside buffer (TLB) miss and / or a cache miss. In such embodiments, a situation may arise where an access count that is zero (0) is ambiguous with respect to the access frequency for the corresponding memory block, and the access count may indicate either an "extremely hot" (i.e., very frequently accessed) memory block or an "extremely cold" (i.e., very infrequently accessed) memory block. This is because the translation for a memory access operation to an extremely hot memory block may be satisfied using the TLB, which may lead to the corresponding access count for the memory block not being incremented even for the extremely hot memory block.
[0008] Accordingly, such an embodiment provides an access-track table that is a packed table, the access-track table including a plurality of access-track indicators and a plurality of access-cleared indicators, each corresponding to a memory block of a plurality of memory blocks. An access-track indicator corresponding to a memory block may be set when a memory access operation to the memory block occurs and cleared at a time separate from when a corresponding page table entry (PTE) access indicator is cleared. When an access-track indicator is cleared by a process executing a processor-based device, a corresponding access-cleared indicator is also set by the process. The process may then employ the access-track indicator and the access-cleared indicator to disambiguate an access count value that is zero (0) in indicating a memory block that is extremely cool, by using the access-track indicator as a disqualifier of an otherwise qualified access count value that is zero (0) (when the access-cleared indicator is set).
[0009] In another exemplary embodiment, a processor-based device is disclosed that includes a PE, the PE including an access count table, the access count table being a packed table including a plurality of access count values, each of the plurality of access count values corresponding to a memory block of the plurality of memory blocks. The PE is configured to detect a memory access operation directed to the one of the plurality of memory blocks. The PE is further configured to increment an access count value of the plurality of access count values in response to detecting the memory access operation, the one of the plurality of access count values corresponding to the memory block.
[0010] In another exemplary embodiment, a method for tracking memory block access frequency in a processor-based device is provided, the method including detecting a memory access operation directed to a memory block of a plurality of memory blocks by a PE of the processor-based device, the method further including incrementing an access count value of a plurality of access count values of an access count table in response to detecting the memory access operation, the access count table being a packed table, the access count value corresponding to the memory block.
[0011] In another exemplary embodiment, a non-transitory computer-readable medium is disclosed that stores computer-executable instructions that, when executed by a processor-based device, cause the processor-based device to detect a memory access operation directed to a memory block of a plurality of memory blocks, the computer-executable instructions further causing the processor-based device to increment an access count value of a plurality of access count values of an access count table in response to detecting the memory access operation, the access count table being a packed table, and the access count value corresponding to the memory block.
[0012] Those skilled in the art will appreciate the scope of the present disclosure and realize additional embodiments of the preferred embodiments after reading the following detailed description of the preferred embodiments in conjunction with the accompanying drawing figures. [Brief description of the drawings]
[0013] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate some of the embodiments of the present disclosure and, together with the description, serve to explain the principles of the disclosure.
[0014] [Figure 1] 1 is a schematic diagram of an example processor-based device that includes a processing element (PE) configured to track memory block access frequency. [Figure 2A] 2 is a block diagram illustrating an example implementation of the access count table and the access-track table of FIG. 1 according to some of the embodiments. [Figure 2B]2 is a block diagram illustrating an example implementation of the access counting table and the access tracking table of FIG. 1 according to some of the embodiments. [Figure 3A] 1 is a flowchart illustrating example operations for tracking memory block access frequency according to some of the embodiments. [Figure 3B] 1 is a flowchart illustrating example operations for tracking memory block access frequency according to some of the embodiments. [Figure 3C] 1 is a flowchart illustrating example operations for tracking memory block access frequency according to some of the embodiments. [Figure 4] 1 is a flowchart illustrating example operations for determining an access frequency for a memory block based on an access count value, an access-track indicator, and an access-cleared indicator according to some of the embodiments. [Diagram 5] 2 is a block diagram of an example processor-based device, such as the processor-based device of FIG. 1, configured to track memory block access frequency. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] Exemplary embodiments disclosed herein track memory block access frequency in a processor-based device. In this regard, in one exemplary embodiment, the processor-based device provides a processing element (PE) that includes an access count table for tracking accesses to a memory block. The access count table is a packed table that includes a plurality of access count values, each of which corresponds to a memory block of a plurality of memory blocks. Upon detecting a memory access operation (i.e., a data-side memory access, such as a memory load operation, a memory store operation, an atomic increment operation, a set operation, or an instruction-side memory access, such as a code fetch operation) directed to a given memory block, the PE increments the access count value corresponding to the memory block. The access count may then be accessed by a first process executing on the processor-based device and used to determine an access frequency for the memory block.
[0016] To reduce the number of increment operations that a PE performs, some of the embodiments may increment the access count only for memory access operations that result in a translation lookaside buffer (TLB) miss and / or a cache miss. In such embodiments, a situation may arise where an access count that is zero (0) is ambiguous with respect to the access frequency for the corresponding memory block, and the access count may indicate either an "extremely hot" (i.e., very frequently accessed) memory block or an "extremely cold" (i.e., very infrequently accessed) memory block. This is because the translation for a memory access operation to an extremely hot memory block may be satisfied using the TLB, which may lead to the corresponding access count for the memory block not being incremented even for the extremely hot memory block.
[0017] Accordingly, such an embodiment provides an access-track table that is a packed table, the access-track table including a plurality of access-track indicators and a plurality of access-cleared indicators, each corresponding to a memory block of the plurality of memory blocks. An access-track indicator corresponding to a memory block may be set when a memory access operation to the memory block occurs and cleared at a time decoupled from when a corresponding page table entry (PTE) access indicator is cleared. When an access-track indicator is cleared by a process executing a processor-based device, the corresponding access-cleared indicator is also set by the process. The process may then employ an access tracking indicator and an access clear indicator to disambiguate an access count value that is zero (0) in indicating a memory block that is extremely cool by using the access tracking indicator as a disqualifier of an otherwise qualified access count value that is zero (0) (when the access clear indicator is set).
[0018] In this regard, Figure 1 illustrates an example processor-based device 100 providing a PE 102 for processing executable instructions. The PE 102 may include individual processor cores, which include central processing unit (CPU) logical execution units and associated caches and functional units. The example PE 102 in Figure 1 includes an execution pipeline circuit 104 that is configured to execute an instruction stream that includes computer-executable instructions. Although not shown in FIG. 1 , the execution pipeline circuitry 104 may include, by way of non-limiting example, a fetch stage for retrieving instructions for execution, a rename stage for allocating physical register file (PRF) registers from the PRF (not shown), an instruction decode stage for translating a number of fetched instructions into a number of control signals for instruction execution, a dispatch stage for issuing instructions for execution, an execute stage for actually performing the instruction execution, and / or a commit stage for irrevocably updating the architectural state of the PE 102 based on the results of the instruction execution.It should be understood that some of the embodiments of the processor-based device 100 may include multiple PEs 102 rather than the single PE 102 shown in the example of FIG. 1, and further, it should be understood that some of the embodiments of the PE 102 may include fewer or more stages in the execution pipeline circuitry 104 than those described above.
[0019] 1 further includes a memory management unit (MMU) 106, which provides virtual memory functionality by performing address translations of virtual memory addresses or intermediate physical addresses to physical memory addresses. MMU 106 includes a TLB 108, which provides TLB entries 110(0)-110(T) for caching recent translations of virtual memory addresses or intermediate physical addresses to physical memory addresses for subsequent reuse. The PE 102 is also communicatively coupled to a first memory device 112 including a memory, and to a second memory device 116 including a memory, the memory of which is subdivided into a plurality of memory blocks 114(0)-114(M) and the memory of the second memory device 116 being subdivided into a plurality of memory blocks 118(0)-118(Y). In the example of FIG. 1, each of the memory blocks 114(0)-114(M) and 118(0)-118(Y) may include a memory page having a size corresponding to a size used for address translation. However, it should be understood that in some embodiments, the total range covered by the memory blocks 114(0)-114(M) and 118(0)-118(Y) may be larger or smaller than the size corresponding to the size used for address translation.Some of the embodiments may provide that memory blocks 114(0)-114(M) and 118(0)-118(Y) may include multiple memory blocks, each of which covers a contiguous range that is discontinuous from the ranges occupied by the other memory blocks.
[0020] 1, the first memory device 112 has a smaller latency (i.e., memory access time) than the latency of the second memory device 116. Thus, as a non-limiting example, the first memory device 112 may include a Double Data Rate (DDR) Dynamic Random Access Memory (DRAM) memory device with which the PE 102 can natively communicate, while the second memory device 116 may include a Compute Express Link (CXL) memory device. In some of the embodiments, instead of or in addition to having lower latency, the first memory device 112 may provide higher bandwidth than the second memory device 116 (e.g., as a non-limiting example, the first memory device 112 may include a High Bandwidth Memory (HBM) device, while the second memory device 116 may include a DDR or CXL memory device). Although FIG. 1 illustrates the first memory device 112 and the second memory device 116 as integral elements of the processor-based device 100, it should be understood that in some of the embodiments, one or both of the first memory device 112 and the second memory device 116 may include memory devices that are external to the processor-based device 100 and communicatively coupled via an external interface (not shown). The PE 102 also includes one or more caches, such as cache 120, which include memory in which the PE 102 can store frequently used instructions and / or data for faster access.Cache 120 may represent one level of a cache hierarchy, which may include additional caches (not shown), such as a level 1 (L1) cache and a level 2 (L2) cache.
[0021] In the example of FIG. 1, the first memory device 112 stores a page table 122 including a plurality of page table entries 124(0)-124(P) (labeled as “PTE” in FIG. 1), each of which stores a mapping between a virtual memory address (or intermediate physical address) and a corresponding physical memory address in the first memory device 112 or the second memory device 116. When the PE 102 needs to translate a virtual memory address or intermediate physical address to a physical memory address, the PE 102 accesses the page table 122 to find a PTE among the PTEs 124(0)-124(P) associated with the virtual memory address or intermediate physical address, and then reads the corresponding physical memory address from the PTE. A PTE among the PTEs 124(0)-124(P) that has been accessed recently may also be cached by the PE 102 in the TLB 108 for subsequent reuse to avoid repeating the translation process. Each of PTEs 124(0)-124(P) includes a corresponding PTE access indicator 126(0)-126(P) (labeled "ACC" in FIG. 1), which may include a bit indicator that PE 102 sets when accessing the memory page corresponding to the PTE. It should be understood that PTEs 124(0)-124(P) may include other indicators and / or data fields that are not shown in FIG. 1 for clarity.
[0022] The processor-based device 100 of FIG. 1 and its components may include any one or combination of known digital logic elements, semiconductor circuits, processing cores, and / or memory structures, among other elements. The embodiments described herein are not limited to any particular arrangement of elements, and the disclosed techniques may be readily extended to various configurations and layouts in a semiconductor socket or package. It should be understood that some of the embodiments of the processor-based device 100 may include elements in addition to those illustrated in FIG. 1. For example, the PE 102 may further include one or more instruction caches, unified caches, memory controllers, interconnect buses, and / or additional memory devices, caches, and / or controller circuits.
[0023] In the example of FIG. 1, PE 102 is executing process 128, which may include, by way of non-limiting example, an application such as a hypervisor for providing virtualization functionality or an operating system (OS) exception level application. It should be understood that in embodiments including more than one PE, process 128 may execute in any one of the PEs. In the course of execution, process 128 may need to determine whether a memory block of multiple memory blocks 114(0)-114(M) and 118(0)-118(Y) should be located in either first memory device 112 or second memory device 116. For example, if the process 128 is a hypervisor, the process 128 may need to determine whether to allocate a guest virtual machine (VM) memory page to a lower-latency and / or higher-bandwidth first memory device 112 or to a higher-latency and / or lower-bandwidth second memory device 116 based on how frequently the guest VM memory page is accessed.This determination can be facilitated by understanding how frequently memory blocks 114(0)-114(M) and 118(0)-118(Y) are accessed, whereby "hot" (i.e., frequently accessed) memory blocks may be distinguished from "cold" (i.e., infrequently accessed or unaccessed) memory blocks. In contrast, as described above, conventional approaches to determining memory block access frequency may not provide sufficient granularity and / or may incur unacceptable costs in terms of bandwidth and processor consumption and heavier cache pollution.
[0024] In this regard, the PE 102 is configured to track memory block access frequency. In one exemplary embodiment, the PE 102 is configured to provide an access count table 130, which is a packed table including a plurality of access count values 132(0)-132(C) (labeled "ACC COUNT VAL" in FIG. 1), each of which corresponds to a memory block of the plurality of memory blocks 114(0)-114(M) and 118(0)-118(Y). The term "packed table" and its derivatives are used herein to refer to a table data structure in which each bit represents or is part of a data value, as opposed to being unused bits or bits intended to pad data fields to a predetermined length. In some embodiments, each of the access counts 132(0)-132(C) may be 4 bytes in size, such that the 16 access counts 132(0)-132(C) may be packed into a conventional 64-byte cache line. In some embodiments, the intermediate physical address or physical address of a memory access operation may be used as an index into the access count table 130 relative to a starting intermediate physical address or starting physical address of the memory range that the access count table 130 occupies.
[0025] In an exemplary operation, PE 102 is configured to detect a memory access operation (i.e., a data-side memory access, such as a memory load operation, a memory store operation, an atomic increment operation, and a set operation, or an instruction-side memory access, such as a code fetch operation) directed to a memory block, such as memory block 114(0). In an embodiment, such as FIG. 1, in which the memory access operation is a data-side memory access, the memory access operation may be detected upon execution of a memory access instruction 134 in execution pipeline circuit 104 of PE 102. In response to detecting the memory access operation, PE 102 increments an access count (e.g., access count 132(0)) corresponding to memory block 114(0).
[0026] In this manner, PE 102 may determine (e.g., by executing process 128) an access frequency for any given one of memory blocks 114(0)-114(M) and 118(0)-118(Y) and may transfer the memory block to either first memory device 112 or second memory device 116 based on the access frequency. For example, a memory block corresponding to an access count value that is zero (0) or above another specified threshold may be considered to be a “hot” block and may therefore be transferred to first memory device 112. Conversely, a memory block corresponding to an access count value that is zero (0) or below a specified threshold may be considered to be a “cold” block and may be transferred to second memory device 116.
[0027] In some of the embodiments, an accounting interval may be triggered by, for example, a hardware interrupt or exception event generated by one or more of the access count values 132(0)-132(C) reaching an access count threshold value 136, or by the expiration of a timer 138. During the accounting interval, process 128 according to some of the embodiments may inspect the access count values 132(0)-132(C) to determine the access frequency for the memory blocks and perform any necessary transfers (e.g., migration or remapping) of memory blocks (e.g., between “near” (low latency and / or high bandwidth) memory and “far” (high latency and / or low bandwidth) memory). The access counts 132(0)-132(C) may be reset to a value of zero (0) by process 128 in such an embodiment during the accounting interval to prepare those access counts 132(0)-132(C) for counting during the next accounting cycle.
[0028] Because the access counts 132(0)-132(C) represent the actual number of memory access operations for memory blocks 114(0)-114(M) and 118(0)-118(Y) during a given accounting interval, an embodiment of a PE 102 that relies solely on the access count table 130 to determine the access frequency for memory blocks 114(0)-114(M) and 118(0)-118(Y) can accurately distinguish between hot and cold memory blocks. However, it may be desirable to reduce the overhead incurred by incrementing the access counts 132(0)-132(C) for every memory access operation. Thus, some of the embodiments may increment the access counts 132(0)-132(C) in the access count table 130 only in response to detecting a memory access operation that results in a miss in the cache 120 and / or the TLB 108. Such an embodiment allows for disambiguation of extremely hot memory blocks and extremely cold memory blocks from the time frame (in frequency and offset in time) in which the corresponding PTE access indicators 126(0)-126(P) are cleared by the PE 102 (e.g., by executing process 140, as a non-limiting example).In these embodiments, PE 102 may provide access-track table 142, which is a packed table that includes a plurality of access track indicators 144(0)-144(C) (labeled in FIG. 1 as “ACC-TRK IND”) and, optionally, a plurality of access-cleared indicators 146(0)-146(C) (labeled in FIG. 1 as “ACC-CLR IND”). Each of access track indicators 144(0)-144(C) and (if present) access cleared indicators 146(0)-146(C) corresponds to a memory block of a plurality of memory blocks 114(0)-114(M) and 118(0)-118(Y). According to some of the embodiments, an intermediate physical address or a physical address of a memory access operation relative to a starting intermediate physical address or a starting physical address of a memory range covered by the access tracking table 142 may be used as an index into the access tracking table 142.
[0029] Each of the access tracking indicators 144(0)-144(C) may be set by the PE 102 upon detecting a memory access operation directed to a corresponding one of the plurality of memory blocks 114(0)-114(M). In some of the embodiments, the access tracking indicators 144(0)-144(C) may be cleared upon every accounting cycle, in which case the access clear indicators 146(0)-146(C) may not track clearing of the access tracking indicators 144(0)-144(C) across accounting cycles. In an embodiment in which the access tracking indicators 144(0)-144(C) may not be cleared upon every accounting cycle, the PE 102 in FIG. 1 may execute a process 128 that, upon clearing one of the access tracking indicators 144(0)-144(C), also sets an access clear indicator of a corresponding one of the access clear indicators 146(0)-146(C). According to some of the embodiments, each of the access tracking indicators 144(0)-144(C) and the access clear indicators 146(0)-146(C) may comprise a single bit. The access tracking table 142 may comprise a standalone data structure, as shown in FIG 1, may be combined into the same data structure as the access count table 130, as described in more detail below with reference to FIG 2A, or may be implemented as two separate data structures, as described in more detail below with reference to FIG 2B.
[0030] 1, process 128 may use access tracking table 142 in conjunction with access count table 130 to perform disambiguation between memory blocks that are too hot and memory blocks that are too cool. In particular, process 128 may set one of access clear indicators 146(0)-146(C) corresponding to a memory block and determine whether to set one of access tracking indicators 144(0)-144(C) corresponding to the memory block if the access count value for the memory block is zero (0) (or if access tracking indicators 144(0)-144(C) are always cleared during each accounting cycle, in which case the memory block may be considered to have an access clear indicator that represents a logical true value). If the access tracking indicator is not set, process 128 may conclude that the access count value of zero (0) indicates an access frequency of zero (0) (i.e., the memory block is too cool). If the access tracking indicator is set, process 128 may determine that the access frequency for the memory block is greater than zero (0) (i.e., the memory block is too hot). One example logic flow for determining a memory block access frequency based on access count values 132(0)-132(C), access tracking indicators 144(0)-144(C), and access clear indicators 146(0)-146(C) is described in more detail below with reference to FIG.
[0031] It should be appreciated that some of the embodiments of the processor-based device 100 of FIG. 1 may provide multiple instances of the access count table 130 and / or the access tracking table 142 for use in tracking multiple memory address ranges, each of which includes a contiguous set of addresses, for example. Such memory address ranges may or may not have overlapping addresses, and the memory block granularity associated with each range may vary across the ranges. Additionally, while FIG. 1 illustrates the access count table 130 and the access tracking table 142 as elements within the PE 102, it should be appreciated that in some of the embodiments, the access count table 130 and the access tracking table 142 may be located in the memory of a memory device external to the PE 102, such as the first memory device 112 or the second memory device 116. Additionally, as noted above, FIG. 1 illustrates the access count table 130 and the access tracking table 142 as separate elements. In contrast, some of the embodiments may provide that the access count table 130 and the access tracking table 142 may be combined into a single data structure. Similarly, some of the embodiments may provide that the access tracking table 142 is implemented as two separate data structures. According to some of the embodiments, the PE 102 may provide one or more memory registers (not shown), each of which points to one or more base locations in memory where the access count table 130 and / or the access tracking table 142 start.In embodiments in which multiple contiguous address ranges are covered by memory blocks 114(0)-114(M) and 118(0)-118(Y), there may be one set of registers per contiguous address range, with each of the registers pointing to one or more reference locations, and one set of registers per contiguous address range for configuring a starting address for each range, configuring the contiguous address range size (i.e., number of memory blocks), and configuring the memory block granularity.
[0032] In this regard, Figures 2A and 2B illustrate several example implementations of access count table 130 and access tracking table 142 of Figure 1. In the example of Figure 2A, a pack table 200 provides functionality corresponding to the functionality of both access count table 130 and access tracking table 142 of Figure 1. The pack table 200 includes a number of table entries 202(0)-202(C), each of which corresponds to a memory block of memory blocks 114(0)-114(M) and 118(0)-118(Y) of Figure 1. Table entries 202(0)-202(C) include corresponding access tracking indicators 204(0)-204(C) (labeled "ACC-TRK IND" in FIG. 2A ), optional access clearing indicators 206(0)-206(C) (labeled "ACC-CLR IND" in FIG. 2A ), and access count values 208(0)-208(C) (labeled "ACC COUNT VAL" in FIG. 2A ). Access tracking indicators 204(0)-204(C) correspond functionally to access tracking indicators 144(0)-144(C) of Figure 1, while access clear indicators 206(0)-206(C) correspond functionally to access clear indicators 146(0)-146(C) of Figure 1, and access counts 208(0)-208(C) correspond functionally to access counts 132(0)-132(C) of Figure 1. In embodiments according to Figure 2A, the term "access count table" refers to the access counts 208(0)-208(C) of pack table 200, while the term "access tracking table" refers to the access tracking indicators 204(0)-204(C) and access clear indicators 206(0)-206(C) of pack table 200.2A illustrates both access tracking indicators 204(0)-204(C) and access clear indicators 206(0)-206(C) as a single data structure having access count values 208(0)-208(C), while some embodiments may provide that only one of access tracking indicators 204(0)-204(C) and access clear indicators 206(0)-206(C) is a single data structure having access count values 208(0)-208(C) and others are provided by separate data structures (not shown). Additionally, it should be understood that in embodiments in which access tracking indicators 204(0)-204(C) are cleared upon every accounting cycle, access clear indicators 206(0)-206(C) may be omitted.
[0033] 2B, some embodiments may provide that access tracking table 142 is implemented as up to two separate data structures. Accordingly, FIG. 2B illustrates two pack tables 210 and 212. Pack table 210 includes a number of table entries 214(0)-214(C), each of which corresponds to a memory block of memory blocks 114(0)-114(M) and 118(0)-118(Y) of FIG. 1. Table entries 214(0)-214(C) include a number of corresponding access tracking indicators 216(0)-216(C) (labeled "ACC-TRK IND" in FIG. 2B), which functionally correspond to access tracking indicators 144(0)-144(C) of FIG. 1. Similarly, optional pack table 212 includes a number of table entries 218(0)-218(C), each of which corresponds to a memory block of memory blocks 114(0)-114(M) and 118(0)-118(Y) of FIG. 1. Table entries 218(0)-218(C) include a number of corresponding access clear indicators 220(0)-220(C) (labeled "ACC-CLR IND" in FIG. 2B), which correspond functionally to access clear indicators 146(0)-146(C) of FIG. 1. In embodiments according to FIG. 2B, the term "access tracking table" refers collectively to access tracking indicators 216(0)-216(C) of pack table 210 and collectively to access clear indicators 220(0)-220(C) of pack table 212. Furthermore, it should be appreciated that in embodiments in which the access tracking indicators 214(0)-214(C) are cleared upon every accounting cycle, the pack table 212 may be omitted.
[0034] 3A-3C provide a flowchart 300 illustrating exemplary operations for tracking memory block access frequency by the PE 102 of FIG. 1 according to some of the embodiments. For clarity, reference is made to elements of FIG. 1 in describing FIG. 3A-3C. It should be understood that some of the operations illustrated in FIG. 3A-3C may occur in a different order than illustrated in FIG. 3A-3C in some of the embodiments and / or may be omitted in some of the embodiments. In FIG. 3A, operations according to some of the embodiments begin with the PE 102 detecting a memory access operation directed to a memory block (e.g., memory block 114(0) of the memory blocks 114(0)-114(M) of FIG. 1) (block 302). Some of the embodiments (e.g., an embodiment using access tracking table 142 of FIG. 1 ) may provide that the operation of block 302 to detect a memory access operation may include PE 102 detecting a memory access operation that results in at least one of a cache miss and a TLB miss (block 304). In response to detecting the memory access operation, PE 102 increments an access count value, such as access count value 132(0) of a plurality of access count values 132(0)-132(C) of access count table 130 of FIG. 1 , where access count table 130 is a packed table and access count value 132(0) corresponds to memory block 114(0) (block 306).
[0035] In some of the embodiments that include an access tracking table 142, the PE 102 may detect another memory access operation that results in a cache hit or a TLB hit and is directed to memory block 114(0) (block 308). In response to that detection, the PE 102 may set an access tracking indicator, such as access tracking indicator 144(0) of access tracking indicators 144(0)-144(C) of the access tracking table 142 of FIG. 1, where the access tracking table 142 is a packed table and the access tracking indicator 144(0) corresponds to the memory block 114(0) (block 310). Operation in some of such embodiments may then continue at block 312 of FIG. 3B.
[0036] 3B, some of the embodiments may perform a series of operations in response to an accounting interval being triggered (such as, for example, by a hardware interrupt or exception event caused by one or more of access count values 132(0)-132(C) reaching access count threshold 136, or by expiration of timer 138) (block 312). In some of the embodiments, PE 102 may determine an access frequency of memory block 114(0) based on access count value 132(0) (e.g., by executing process 128, also referred to herein as “first process 128”) (block 314). Some of the embodiments using access tracking table 142 of FIG. 1 may provide that the operation of block 314 to determine the access frequency of memory block 114(0) may be further based on one or more of access tracking indicator 144(0) and access clear indicator 146(0) (block 316). PE 102 may then transfer memory block 114(0) to one of first memory device 112 and second memory device 116 based on the access frequency (e.g., by executing first process 128) (block 318). For example, if the access frequency indicates that memory block 114(0) is hot and memory block 114(0) is not already resident in first memory device 112, PE 102 may transfer memory block 114(0) to first memory device 112.
[0037] Some of the embodiments may further provide that PE 102 performs additional operations during the accounting interval. In some of the embodiments, PE 102 may reset access counts 132(0)-132(C) (e.g., by executing first process 128) (block 320). PE 102 according to some of the embodiments (e.g., an embodiment using access tracking table 142 of FIG. 1) may clear access tracking indicator 144(0) corresponding to memory block 114(0) (e.g., by executing first process 128) (block 322). After clearing access tracking indicator 144(0), PE 102 sets an access clear indicator, such as access clear indicator 146(0) of access clear indicators 146(0)-146(C) in access tracking table 142 (e.g., by executing first process 128), where access clear indicator 146(0) corresponds to memory block 114(0) (block 324). It should be noted that in embodiments in which access tracking indicator 144(0) is always cleared during an accounting interval, the operations of block 324 to clear access clear indicator 146(0) may be omitted. Operations in some of the embodiments may continue at block 326 of FIG. 3C.
[0038] Referring now to FIG. 3C, some of the embodiments may perform further operations in response to a subsequent accounting interval being triggered (i.e., an accounting interval occurring at a time following the accounting interval referred to in block 312 of FIG. 3B) (block 326). Some of the embodiments, such as those using access tracking table 142 of FIG. 1, may provide that PE 102 clears access clear indicator 146(0) (e.g., by performing a process such as process 128) (block 328). It should be noted that in embodiments in which access tracking indicator 144(0) is always cleared during an accounting interval, the operation of block 324 to clear access clear indicator 146(0) may be omitted.
[0039] PE 102 according to some of the embodiments provides access tracking table 142 of FIG. 1 to provide disambiguation between memory blocks that are too hot and memory blocks that are too cool within a timeframe that is decoupled from a timeframe in which one or more of PTE-accessed indicators 126(0)-126(P) are cleared by PE 102 (e.g., by executing process 140, as a non-limiting example). FIG. 4 thus provides a flowchart 400 illustrating one exemplary logic flow that may be used by process 128 in such an embodiment, for example. The operations begin with process 128 first determining whether an access count for a memory block (such as access count 132(0) corresponding to memory block 114(0) of FIG. 1) is equal to zero (0) (block 402). If the access count value for the memory block is not equal to zero (0), process 128 may conclude that memory block 114(0) is either moderately hot or moderately cool, with the magnitude of the access count value 132(0) indicating to what extent (block 404).
[0040] On the other hand, if process 128 determines in decision block 402 that access count value 132(0) is equal to zero (0), process 128 then determines whether an access tracking indicator corresponding to memory block 114(0), such as access tracking indicator 144(0) in FIG. 1, is set (block 406). If the access tracking indicator is not set, process 128 may determine that the access frequency of memory block 114(0) is zero (0) (i.e., memory block 114(0) is a very cool memory block) (block 408). If access tracking indicator 144(0) is determined to be set in decision block 406, process 128 determines whether an access clear indicator corresponding to memory block 114(0), such as access clear indicator 146(0) in FIG. 1, is set (block 410). If the access clear indicator is not set, then the access frequency of memory block 114(0) is indeterminate (block 412) because memory block 114(0) may be either a very hot memory block or a very cool memory block. Conversely, if process 128 determines in decision block 410 that access clear indicator 146(0) is set, then process 128 may determine that the access frequency of memory block 114(0) is greater than zero (0) (i.e., memory block 114(0) is a very hot memory block) (block 414). It should be noted that in embodiments in which access tracking indicator 144(0) is always cleared during accounting intervals, the operations of decision block 410 may be omitted and operations may proceed directly from block 406 to block 414.
[0041] 5 is a block diagram of an exemplary processor-based device 500, such as the processor-based device 100 of FIG. 1, that tracks memory block access frequency. The processor-based device 500 may represent one or more circuits contained in an electronic board card, such as a printed circuit board (PCB), a server, a personal computer, a desktop computer, a laptop computer, a personal digital assistant (PDA), a computing pad, a mobile device, or any other device, for example, a server or a user's computer. In this example, the processor-based device 500 includes a processor 502. The processor 502 represents one or more general-purpose processing circuits, such as a microprocessor or a central processing unit, and may correspond to the PE 102 of FIG. 1. The processor 502 is configured to execute processing logic in instructions to perform operations and steps described herein. In this example, the processor 502 includes an instruction cache 504 for temporary fast access memory storage of instructions and an instruction processing circuit 510. Instructions that are fetched or prefetched from a memory, such as system memory 508 via system bus 506, are stored in instruction cache 504. Instruction processing circuitry 510 is configured to process instructions that have been fetched into instruction cache 504, as well as to process instructions for execution.
[0042] The processor 502 and the system memory 508 are coupled to a system bus 506, which may interconnect peripheral devices included in the processor-based device 500. As is well known, the processor 502 communicates with these other devices by exchanging address, control, and data information via the system bus 506. For example, the processor 502 may communicate bus transaction requests to a memory controller 512 in the system memory 508, as one example of a peripheral device. Although not shown in FIG. 5, multiple system buses 506 may be provided, each system bus comprising a different fabric. In this example, the memory controller 512 is configured to provide memory access requests to a memory array 514 in the system memory 508. The memory array 514 comprises an array of storage bit cells for storing data. The system memory 508 may be, by way of non-limiting examples, a read only memory (ROM), a flash memory, a dynamic random access memory (DRAM), such as a synchronous DRAM (SDRAM), and a static memory (e.g., a flash memory, a static random access memory (SRAM), etc.).
[0043] Other devices may be connected to the system bus 506. As shown in FIG. 5, these devices may include, by way of example, a system memory 508, one or more input devices 516, one or more output devices 518, a modem 524, and one or more display controllers 520. The one or more input devices 516 may include any type of input device, including but not limited to input keys, switches, voice processors, etc. The one or more output devices 518 may include any type of output device, including but not limited to audio, video, other visual indicators, etc. The modem 524 may be any device configured to enable the exchange of data with a network 526. The network 526 may be any type of network, including but not limited to a wired or wireless network, a private or public network, a local area network (LAN), a wireless local area network (WLAN), a wide area network (WAN), a BLUETOOTH™ network, and the Internet. The modem 524 may be configured to support any type of desired communication protocol. The processor 502 may be configured to access one or more display controllers 520 via the system bus 506 to control information sent to one or more displays 522. The one or more displays 522 may include any type of display, including, but not limited to, a cathode ray tube (CRT), a liquid crystal display (LCD), a plasma display, etc.
[0044] 5 may include a set of instructions 528 that the processor 502 executes for any desired application according to the instructions. The instructions 528 may be stored in the system memory 508, the processor 502, and / or the instruction cache 504 as examples of non-transitory computer-readable medium 530. The instructions 528 may also reside, completely or at least partially, in the system memory 508 and / or the processor 502 during execution of the instructions. The instructions 528 may also be transmitted or received over the network 526 via the modem 524 such that the network 526 includes the computer-readable medium 530.
[0045] Although computer-readable medium 530 is shown in one exemplary embodiment to be a single medium, the term "computer-readable medium" should be considered to include a single medium or multiple media (e.g., a centralized or distributed database, and / or associated caches and servers) that store one or more sets of instructions 528. The term "computer-readable medium" should also be considered to include any medium capable of storing, encoding, or carrying a set of instructions for execution by a processing device and causing the processing device to perform any one or more of the methodologies of the embodiments disclosed herein. Thus, the term "computer-readable medium" should be considered to include, but is not limited to, solid-state memory, optical media, and magnetic media.
[0046] The embodiments disclosed herein include various steps that may be formed by hardware components or embodied in machine-executable instructions that may be used to cause a general-purpose or special-purpose processor that is programmed with the instructions to perform the steps. Alternatively, the steps may be performed by a combination of hardware and software processes.
[0047] The embodiments disclosed herein may be provided as a computer program product or software process, which may include a machine-readable medium (or computer-readable media) having instructions stored thereon that may be used to program a computer system (or other electronic device) to perform a process according to the embodiments disclosed herein. A machine-readable medium includes any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer). For example, machine-readable media include machine-readable storage media (e.g., ROM, random access memory ("RAM"), magnetic disk storage media, optical storage media, flash memory devices, etc.).
[0048] Unless otherwise noted, and as will be apparent from the preceding description, throughout the description, descriptions using words such as "processing," "computing," "determining," or "displaying" will be understood to refer to operations and processes of a computer system or similar electronic computing device that manipulates and transforms data and memory, represented as physical (electronic) quantities in the computer system's registers, to other data, also represented as physical quantities in the computer system's memory or registers or other such information storage, transmission, or display device.
[0049] The algorithms and displays presented herein are not inherently related to any particular computer or other apparatus. A variety of systems may be used with programs in accordance with the teachings herein, or it may prove useful to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will be apparent from the above description. In addition, the embodiments described herein are not described with reference to any particular programming language. It will be understood that a variety of programming languages may be used to implement the teachings of the embodiments described herein.
[0050] Those skilled in the art will further appreciate that the various exemplary logic blocks, modules, circuits, and algorithms described in connection with the embodiments disclosed herein may be implemented as electronic hardware, instructions stored in a memory or other computer-readable medium and executed by a processor or other processing device, or a combination of both. The components of the processor-based devices described herein may be used in any circuit, hardware component, integrated circuit (IC), or IC chip, by way of example. The memories disclosed herein may be any type and size of memory and may be configured to store any type of information desired. To clearly illustrate this interchangeability, various exemplary components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. How to implement such functionality depends on the particular application, design choices, and / or design constraints imposed on the overall system. Those skilled in the art may implement the described functionality in various ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments.
[0051] The various example logic blocks, modules, and circuits described in connection with the embodiments disclosed herein may be implemented or performed by a processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. Furthermore, the controller may be a processor. The processor may be a microprocessor, but alternatively, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices (e.g., a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration).
[0052] The embodiments disclosed herein may be implemented by hardware and instructions stored therein, such as in a RAM, flash memory, ROM, electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, removable disk, CD-ROM, or any other form of computer readable medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from and write information to the storage medium. Alternatively, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a remote station. Alternatively, the processor and the storage medium may reside as discrete components in a remote station, base station, or server.
[0053] It should also be noted that the operational steps described in any of the exemplary embodiments herein are described to provide examples and explanations. The described operations may be performed in many different orders other than the order shown. Furthermore, an operation described in a single operational step may actually be performed in multiple different steps. Additionally, one or more operational steps described in the exemplary embodiments may be combined. Those skilled in the art will also appreciate that information and signals may be represented using any of a variety of technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that may be referenced throughout the above description may be represented by voltages, currents, electromagnetic waves, magnetic fields, or particles, optical fields or particles, or any combination thereof.
[0054] Unless expressly stated otherwise, it is in no way intended that any method described herein be construed as requiring that the steps of the method be performed in a particular order. Thus, where a method claim does not actually recite the order in which the steps of the method should be followed, or where it is not specifically stated in the claim or detailed description that the steps of the method are to be limited to a particular order, it is in no way intended that any particular order should be inferred.
[0055] It will be apparent to those skilled in the art that various modifications and variations can be made without departing from the spirit or scope of the present invention. Since those skilled in the art can think of modifications, combinations, subcombinations, and variations of the disclosed embodiments that incorporate the spirit and content of the present invention, the present invention should be considered to include all within the scope of the appended claims and the equivalents of the inventions described in the claims.
Claims
1. 1. A processor-based device, comprising: a processing element (PE) including an access count table, the access count table being a packed table including a plurality of access counts, each of the plurality of access counts corresponding to a memory block of a plurality of memory blocks; The PE is Detecting a memory access operation directed to a memory block of the plurality of memory blocks; and and configured to increment an access count of the plurality of access counts in response to detecting the memory access operation, the access count including a processing element (PE) corresponding to the memory block. Processor-based devices.
2. further comprising a first memory device and a second memory device; In response to an accounting interval being triggered, the processor-based device: determining an access frequency of the memory block based on the access count; and 2. The processor-based device of claim 1, configured to transfer the memory block to one of the first memory device and the second memory device based on the access frequency.
3. The PE further includes an access tracking table, the access tracking table being a packed table including a plurality of access tracking indicators, each of the plurality of access tracking indicators corresponding to a memory block of the plurality of memory blocks; The PE is configured to detect the memory access operation directed to the memory block of the plurality of memory blocks by detecting that the memory access operation results in at least one of a cache miss and a translation lookaside buffer (TLB) miss; The PE further comprises: Detecting the memory access operation that results in a cache hit or a TLB hit and is directed to the memory block; and in response to detecting the memory access operation that results in the cache hit or the TLB hit and is directed to the memory block, setting an access tracking indicator corresponding to the memory block; It is configured as follows: The processor-based device of claim 1 , wherein the processor-based device is configured to clear the access tracking indicator corresponding to the memory block in response to an accounting interval being triggered.
4. the access tracking table further includes a plurality of access tracking indicators, each of the plurality of access tracking indicators corresponding to a memory block of the plurality of memory blocks; 4. The processor-based device of claim 3, further configured to set an access tracking indicator corresponding to the memory block in response to the accounting interval being triggered.
5. the access tracking table further includes a plurality of access clear indicators, each of the plurality of access clear indicators corresponding to a memory block of the plurality of memory blocks; 4. The processor-based device of claim 3, further configured to clear an access clear indicator corresponding to the memory block in response to a subsequent accounting interval being triggered.
6. further comprising a first memory device and a second memory device; The processor-based device further comprises, in response to the accounting interval being triggered, determining an access frequency of the memory block based on the access count and one or more of the access tracking indicator and the access clearing indicator; and transferring the memory block to one of the first memory device and the second memory device based on the access frequency; 4. The processor-based device of claim 3, configured to:
7. The processor-based device comprises: determining that the access count value is equal to zero (0); determining that the access tracking indicator is not set; and determining that the access frequency of the memory block is zero (0) based on the access count and the access tracking indicator; 7. The processor-based device of claim 6, configured to determine the access frequency of the memory block based on the access count and one or more of the access tracking indicator and the access clear indicator.
8. The processor-based device comprises: determining that the access count is zero (0); determining that the access tracking indicator is set; determining that the access clear indicator is set; and determining that the access frequency of the memory block is greater than zero (0) based on the access count, the access tracking indicator, and the access clear indicator; 7. The processor-based device of claim 6, configured to determine the access frequency of the memory block based on the access count and one or more of the access tracking indicator and the access clear indicator.
9. The processor-based device of claim 1 , further configured to reset the plurality of access counts in response to an accounting interval being triggered.
10. 1. A method, comprising: detecting, by a processing element (PE) of the processor-based device, a memory access operation directed to a memory block of the plurality of memory blocks; incrementing an access count value of a plurality of access count values in an access count table in response to detecting the memory access operation, the access count table being a packed table and the access count value corresponding to the memory block. method.
11. In response to an accounting interval being triggered, determining an access frequency of the memory block based on the access count; 11. The method of claim 10, further comprising: transferring the memory block to one of a first memory device and a second memory device based on the access frequency.
12. detecting a memory access operation that results in a cache hit or a translation lookaside buffer (TLB) hit and is directed to the memory block; in response to detecting the memory access operation that results in the cache hit or the TLB hit and is directed to the memory block, setting an access tracking indicator of a plurality of access tracking indicators in an access tracking table, the access tracking table being a packed table and the access tracking indicator corresponding to the memory block; and in response to an accounting interval being triggered, clearing the access tracking indicator corresponding to the memory block; 11. The method of claim 10, wherein detecting the memory access operation directed to the memory block of the plurality of memory blocks comprises detecting a memory access operation that results in at least one of a cache miss and a TLB miss.
13. 13. The method of claim 12, further comprising: in response to the accounting interval being triggered, setting an access clear indicator of a plurality of access clear indicators in the access tracking table, the access clear indicator corresponding to the memory block.
14. 13. The method of claim 12, further comprising the step of clearing an access clear indicator of a plurality of access clear indicators in the access tracking table in response to a subsequent accounting interval being triggered, the access clear indicator corresponding to the memory block.
15. in response to the accounting interval being triggered, determining an access frequency of the memory block based on the access count and one or more of the access tracking indicator and the access clearing indicator; 13. The method of claim 12, further comprising: transferring the memory block to one of a first memory device and a second memory device based on the access frequency.
Citation Information
Patent Citations
Address translation buffer device
JP1994124237A
Hierarchical storage device and its controller
JP2003216460A
A dynamic performance-monitoring-based approach to memory management
JP2007513437A
Calculator, memory management method, and program
JP2014167700A
Optimizing processor memory via page access count.
JP2015534200A
