Method and system for implementing a data structure with a dynamic array in a cache memory row
By configuring a cache line with a metadata and elements field to manage atomic memory operations, the method addresses performance and hardware efficiency challenges in multi-threaded systems, enhancing data access and preventing corruption.
Patent Information
- Application Number
- DE112014003226
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2013-07-11
- Filing Date
- 2014-07-01
- Publication Date
- 2024-11-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing multi-threaded computer systems face challenges in achieving higher performance while maintaining lower hardware requirements, particularly in managing shared data access through cache memory operations.
Implementing a dynamic array data structure in a cache line by configuring it with a metadata field and an elements field, allowing for atomic memory operations that can handle concurrent requests without interference, and providing a unified interface for multiple threads.
This approach enhances data access efficiency by allowing faster operations on a single cache line, preventing data corruption, and supporting seamless integration into existing storage systems, thus improving computational performance and flexibility.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Field of invention
[0001] The invention relates to data processing systems and in particular to a method for implementing a data structure with a dynamic array in a cache memory row. background
[0002] Many multithreaded computing systems or workloads are becoming one of the most important technologies for companies of all sizes. They improve the computational efficiency and flexibility of a data processing hardware platform. However, the need for higher performance while simultaneously striving to reduce hardware requirements remains.
[0003] US 2008 / 0256303 A1 describes data processing in a system with a cache memory, where a central processing unit (CPU) is responsible for data processing and accesses the cache memory, in particular individual cache memory rows.
[0004] JP 2003-30 051 A describes how a CPU performs read and write operations on a cache memory. The CPU also sends a command to a control unit associated with the cache memory, which executes a lock / unlock procedure with respect to a cache memory row. Brief description of the invention
[0005] One objective of embodiments of the invention is to provide an improved method, a computer system, and a computer program product.
[0006] The objective is achieved through the subject matter of the independent claims. Advantageous embodiments are described in the dependent claims.
[0007] An atomic memory operation (AMO) used here refers to a read-modify-write operation on shared data. An AMO is atomic in that the read-modify-write operation of one thread is executed without interference from another thread. In other words, for threads or processors accessing shared data (e.g., accessing it concurrently), each read, write, or AMO access is executed atomically, without interference from other accesses.
[0008] In one aspect, the invention relates to a method for implementing a data structure with a dynamic array in a cache memory row in a storage system that includes a memory and a control unit. At least a part of the cache memory row can be accessed as a data structure with a dynamic array (or it can be treated as such).
[0009] The procedure involves configuring the cache memory row in memory as a cache memory row containing a Metadata field and an Elements field, where the Metadata field contains metadata of the dynamic array data structure. The Elements field can contain element values of each element of the dynamic array data structure.
[0010] The procedure further involves the control unit receiving a request for an operation on the dynamic array data structure, where the request specifies a memory location in the cache memory row and information that defines the request. This information can include details specifying elements of the dynamic array data structure that are requested by the operation.
[0011] The procedure further features the marking of one or more actions on the data structure with dynamic array using the information for the operation by the control unit, wherein the one or more actions are encoded in the control unit and the request is executed in response to receiving the request by performing the one or more encoded actions.
[0012] The control unit can code multiple actions. Identifying one or more actions can involve selecting one or more actions from among the available options.
[0013] The requested operation could be, for example, an atomic memory operation. The received request might be one of several concurrent requests received by multiple threads through the control unit for operations on the dynamic array data structure. The received concurrent requests can be executed sequentially.
[0014] These features can be advantageous because they may provide a simplified method for accessing data stored in memory. The method can be seamlessly integrated into existing storage systems.
[0015] The fact that metadata and the field elements may fit into a single cache memory row can facilitate the reconfiguration of the control unit and the storage system. Using this storage system allows for the configuration of multiple dynamic arrays up to the limit of the storage capacity.
[0016] Another advantage is that the request can be directed to the dynamic array structure without requiring the addresses of the elements to be accessed. For example, the request can be directed to the first element of the dynamic array data structure, the last element of the dynamic array data structure, or the element at a specific index. This allows for the implementation of new AMOs beyond traditional AMOs to utilize the aforementioned dynamic array data structure.
[0017] Another advantage may lie in the fact that accessing a single cache memory line to perform a predefined operation can be faster than accessing multiple cache memory lines to perform the same operation.
[0018] These features can provide a single interface for multiple users or threads to utilize the dynamic array data structure, for example, in a multithreaded application where multiple threads simultaneously issue requests such as the request to access the dynamic array data structure.
[0019] According to one embodiment, the configuration further includes: defining an element size for the dynamic array data structure in the metadata; defining the number of elements in the dynamic array data structure in the metadata; and defining the value of each element in the dynamic array data structure in the Elements field.
[0020] This embodiment can be advantageous because it can provide sufficient information to the control unit for autonomous execution of received requests.
[0021] According to one embodiment, the requirement further specifies an element size of an element in the data structure with a dynamic array. This can be advantageous because the metadata does not contain any information about the element size.
[0022] In some embodiments, a metadata parameter can enable or disable an indication of an error condition. For example, the control unit can cause a break if the request specifies an element size that is smaller or larger than the value defined in the metadata. The control unit can also cause a break in response to a push request to a dynamic array data structure that already contains the maximum number of elements supported by the Elements field. Similarly, the control unit can cause a break in response to a set request that specifies an index of an element that is not in the dynamic array data structure.
[0023] In some embodiments, the control unit can respond to a request that cannot be fulfilled with a predefined error value. For example, the control unit can respond with a predefined error value in response to a GET request that specifies the index of an element not contained in the dynamic array data structure. In some embodiments, the predefined error value can be specified by a configurable field in the metadata. The control unit can return one of several predefined error values to further indicate why a request cannot be fulfilled. The metadata can, for example, also include a parameter of a failed POP operation.The parameter of a failed pop operation may have a value that may be contained in a response returned by the control unit to the requester of a pop operation for the empty dynamic array data structure.
[0024] According to one embodiment, the request comprises a number of elements in the operation request, wherein executing the request involves performing one or more actions: reading the metadata of the metadata field; determining the number of elements in the data structure with a dynamic array; sending the determined number of elements as a response to the requester of the operation.
[0025] According to one embodiment, the configuration further includes defining a start index and an end index in the metadata, which allows the Elements field to be used as a ring buffer that holds the elements of the data structure with a dynamic array, thus avoiding the need to move elements within the Elements field for some requirements.
[0026] The information specifying the requirement can specify a selected element, where the selected element can be specified as the first element in the dynamic array data structure, the last element in the dynamic array data structure, or the element at a specified index in the dynamic array data structure.
[0027] According to one embodiment, the requirement includes a request for a get-value operation on the dynamic array data structure to obtain a value for a selected element in the dynamic array data structure, wherein executing the requirement includes performing one or more actions: reading the metadata of the metadata field in the memory; determining a memory location of the selected element in the elements field; the procedure further includes: reading the value of the selected element using the memory location; sending the value of the selected element as a response to the requester of the operation; and updating the cache memory line, wherein the update includes decrementing the number of elements in the metadata and moving the elements into the elements field to remove the selected element from the dynamic array data structure.
[0028] According to one embodiment, the request includes a set-value operation, wherein the request provides a value for a selected element in the dynamic array data structure; wherein executing the request involves performing one or more actions: reading the metadata in the Metadata field, determining a memory location in the Elements field of the cache memory row for the selected element in the dynamic array data structure, and writing the value to the selected element.
[0029] According to one embodiment, the request includes a push-value operation, wherein the request provides a value to be inserted into the dynamic array data structure; wherein executing the request involves performing one or more actions: reading the metadata in the metadata field, updating the cache memory row, wherein updating involves decrementing the number of elements in the metadata and moving the elements into the elements field to insert a selected element of the dynamic array data structure, and writing the value to the selected element.
[0030] In one embodiment, the push-value operation request can be a Push AMO request based on the processor's conditional store instruction, where the condition contained in the response to the request indicates to the user whether the push action was successful. In yet another embodiment, the Push AMO request is based on the processor's swap or compare and swap instruction, where the value in the response indicates to the user whether the push action was successful.
[0031] The AMO requirement may be similar to the processor's conditional store instruction, or it may be similar to the processor's swap or compare and swap instruction.
[0032] According to one embodiment, the request includes a request for a get-minimum-value operation or a get-maximum-value operation, wherein executing the request involves performing one or more actions: reading the metadata of the Metadata field; determining the memory locations in the Elements field for all elements in the dynamic array data structure; using the determined memory locations, reading the values of all elements in the dynamic array data structure and marking the element with the minimum or maximum value; and sending the marked minimum or maximum value as a response to the requester of the operation.
[0033] According to one embodiment, the requirement includes a requirement for a get-minimum-value operation or a get-maximum-value operation, wherein the requirement specifies a flagging of an element that has the minimum or maximum value by treating each element of the dynamic array data structure as an unsigned integer, a signed integer, or a floating-point number.
[0034] According to one embodiment, the request includes a request for a pop-minimum-value operation or a pop-maximum-value operation, wherein executing the request involves performing one or more of the following actions: reading the metadata of the Metadata field, determining the memory locations in the cache memory row for all elements in the dynamic array data structure, using the determined memory locations, reading the values of all elements in the dynamic array data structure and marking the element with the minimum or maximum value, sending the marked minimum or maximum value as a response to the requester of the operation, and updating the cache memory row, wherein the update involves decreasing the number of elements in the metadata and moving the elements into the Elements field to remove the marked element from the dynamic array data structure.
[0035] According to one embodiment, the configuration further includes defining in the metadata a position and size of an instance field in each element of the dynamic array data structure, wherein the request includes a pop instance request, and the procedure further includes reducing an instance field of a selected element, whereby the selected element is moved back into the dynamic array data structure with the reduced instance field based on a reduced instance that is greater than zero.
[0036] For example, in response to a request for a number of elements, the control unit can return the number of elements in the dynamic array data structure containing all instances in a response.
[0037] According to one embodiment, the request corresponds to a single load instruction or a single store instruction, wherein the single load or single store instruction has an atomic storage operation that is received and executed by the control unit, and the single load or single store instruction supports simultaneous requests that have the same requirement.
[0038] The atomic nature of the control unit can fulfill any requirement for using the dynamic array data structure and can prevent data corruption of the dynamic array data structure that can occur when multiple threads access the dynamic array data structure.
[0039] According to one embodiment, the Elements field and the Metadata field share assigned bits of the cache memory row, wherein assigning a bit of the cache memory row to the Metadata field involves releasing another bit from the Elements field.
[0040] The dynamic array data structure can, for example, be implemented in two or more cache memory rows of the storage system, where the two or more cache memory rows are adjacent. A request for an operation on the dynamic array data structure can specify the two or more adjacent cache memory rows and the memory location of the first of the two or more cache memory rows in the storage system.
[0041] In another aspect, the invention relates to a computer program product that includes instructions executable by a computer to carry out the process steps of the method according to one of the preceding embodiments.
[0042] In another aspect, the invention relates to a system for implementing a data structure with a dynamic array, wherein the system comprises a memory and a control unit, the system is configured in the memory to configure the cache memory row as a cache memory row with a metadata field and an elements field, wherein the metadata field contains metadata of the data structure with a dynamic array and wherein the elements field contains a value for each element of the data structure with a dynamic array; receives a request for an operation on the data structure with a dynamic array through the control unit, wherein the request specifies a memory location of the cache memory row in the memory and information that specifies the request; and designates one or more actions on the data structure with a dynamic array for the operation using the information;and, in response to receiving the request, executes the request by performing one or more coded actions.
[0043] The storage system may be a level in a cache memory hierarchy, so that when the control unit executes a request, the storage system accesses one or more lower levels in the cache memory hierarchy to cache the metadata and elements in memory. A storage system may be divided into two or more parts, with a control unit in one part able to operate a dynamic array data structure using memory in that part. A cache memory level may be represented as two or more units, with the control unit able to access each part of the underlying cache memory or memory levels within a cache memory unit.
[0044] A “computer-readable storage medium,” as used here, includes any physical storage medium capable of storing instructions executable by a processor of a data processing unit. The computer-readable storage medium may be described as a computer-readable non-volatile storage medium. It may also be described as a physical computer-readable medium. In some embodiments, a computer-readable storage medium may also be capable of storing data accessible by the processor of the data processing unit. Examples of computer-readable storage media include, but are not limited to, a floppy disk, a USB drive, random-access memory (RAM), read-only memory (ROM), an optical disk, a magneto-optical disk, and the processor's register file.Examples of optical discs include Compact Discs (CDs) and Digital Versatile Discs (DVDs), such as CD-ROM, CD-RW, CD-R, DVD-ROM, DVD-RW, or DVD-R discs. The term computer-readable storage medium also refers to various types of recording media that can be accessed by a computer unit via a network or data transmission connection. The data can be accessed, for example, via a modem, the internet, or a local area network. Computer-executable code embodied on a computer-readable medium can be transmitted using any suitable medium, including, but not limited to, wireless, wired, fiber optic, RF media, etc., or any suitable combination thereof.
[0045] A computer-readable signal medium can contain a propagating data signal with a computer-readable code embodied therein, for example, in the baseband or as part of a carrier wave. Such a propagating signal can take any of a variety of forms, including, but not limited to, electromagnetic, optical, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium that is not a computer-readable storage medium and that can transmit, propagate, or transport a program for use by or in conjunction with a system, device, or unit for instruction execution.
[0046] "Computer RAM" or "RAM" is an example of a computer-readable storage medium. Computer RAM is any memory that can be directly accessed by a processor. "Computer storage" or "memory" is another example of a computer-readable storage medium. Computer storage is any non-volatile, computer-readable storage medium. In some configurations, computer storage can also be computer RAM, or vice versa.
[0047] A "processor," as used here, comprises an electronic component capable of executing a program or machine-executable instruction or computer-executable code. References to the data processing unit that includes a "processor" should be interpreted to mean that it may contain more than one processor or data processing core. For example, the processor may be a multi-core processor. A processor may also refer to a collection of processors located in a single computer system or distributed across multiple computer systems. The term "data processing unit" should also be interpreted to mean a collection or network of data processing units, each containing one or more processors.The code executable by a computer can be executed by multiple processors, which may be located in the same data processing unit or may even be distributed across multiple data processing units.
[0048] Computer-executable code may comprise machine-executable instructions or a program that causes a processor to execute an aspect of the present invention. Computer-executable code for performing operations on aspects of the present invention may be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, Smalltalk, C++, or the like, and conventional procedural programming languages such as the programming language "C" or similar programming languages compiled into machine-executable instructions. In some cases, the computer-executable code may be in the form of a higher-level language or in a pre-compiled form and used in conjunction with an interpreter that spontaneously generates the machine-executable instructions.
[0049] Code executable by a computer can run only on the user's computer, partially on the user's computer as a standalone software package, partially on the user's computer and partially on a remote computer, or only on the remote computer or server. In the last scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, via the internet using an internet service provider).
[0050] Aspects of the present invention are described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the invention. It is clear that each block or part of the blocks of the flowchart, diagrams, and / or block diagrams can be implemented by computer program instructions, which may optionally be in the form of computer-executable code. It is further clear that combinations of blocks in different flowcharts, diagrams, and / or block diagrams can be linked, provided they are not mutually exclusive.These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or any other programmable data processing device to form a machine such that the instructions executed through the processor of the computer or other programmable data processing device generate means for implementing the functions / effects specified in the block or blocks of the flowchart and / or block diagram.
[0051] These computer program instructions may also be stored in a computer-readable medium that can instruct a computer, other programmable data processing device, or other unit to function in a particular manner, such that the instructions stored in the computer-readable medium produce a manufactured item containing instructions that implement the function / effect specified in the block(s) of the flowchart and / or block diagram.
[0052] The computer program instructions can also be loaded into a computer, other programmable data processing devices, or other units to effect a series of operational steps to be performed on the computer, other programmable data processing device, or other units to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide processes for implementing the functions / effects specified in the block or blocks of the flowchart and / or block diagram.
[0053] It is clear to a person skilled in the art that aspects of the present invention can be embodied as a device, a method, or a computer program product. Accordingly, aspects of the present invention can take the form of a purely hardware embodiment, a purely software embodiment (comprising firmware, resident software, microcode, etc.), or an embodiment combining software and hardware aspects, all of which may herein be referred to as a "circuit," "module," or "system." Furthermore, aspects of the present invention can take the form of a computer program product embodied in one or more computer-readable media comprising computer-readable program code executed therein.
[0054] It is clear that one or more of the above-mentioned embodiments can be combined, provided that the combined embodiments do not mutually exclude each other. Brief description of the drawings
[0055] Preferred embodiments of the invention are described in more detail below by way of example, with reference to the drawings in which: Fig. 1 illustrates a system architecture that makes it possible to execute a procedure for converting a data structure with a dynamic array into a cache memory row in main memory; Fig. 2. An exemplary block diagram of a storage system is illustrated; Fig. 3 shows a representation illustrating a sequence of operations on a data structure with a dynamic array; and Fig. 4 is a flowchart of a procedure for converting a data structure with a dynamic array into a cache memory row in main memory. Detailed description
[0056] In the figures, elements with the same number subsequently denote either similar elements or elements that perform an equivalent function. Elements previously explained are not necessarily explained in later figures if their function is equivalent.
[0057] Fig. Figure 1 shows a computer system (or server) 112 within the data processing system 100, which is represented in the form of a universal data processing unit. The components of the computer system 112 may include, but are not limited to, one or more processors or data processing units 116, a storage system 128, and a bus 118 that connects various system components, including the storage system 128, to the processor 116.
[0058] Computer System 112 typically contains a variety of data storage media readable by the computer system. These storage media can be any commercially available data storage medium accessible to Computer System 112, including both volatile and non-volatile media, as well as removable and non-removable media.
[0059] The storage system 128 can contain data carriers readable by the computer system in the form of volatile memory, such as random-access memory (RAM) and / or cache memory. The storage system can contain one or more active buffered memory units. The active buffered units can include a plurality of memory elements (e.g., chips). The active buffered unit can contain memory levels that form a three-dimensional ("3D") memory unit, with individual columns of chips forming management units that exchange data with the processing units 116. The active buffered memory unit can have partitions that can be accessed simultaneously by a plurality of processing elements, the partitions being any suitable memory segments, including, but not limited to, management units.
[0060] The processing units 116 can issue requests to the storage system, using the dynamic array data structure and associated metadata to implement an application.
[0061] The computer system 112 can also exchange data with one or more external units 114, such as a keyboard, a pointing device, a display 124, etc.; one or more units that enable a user to interact with the computer system 112; and / or any units (e.g., network card, modem, etc.) that enable the computer system 112 to exchange data with one or more other data processing units. Such data exchange can take place via one or more I / O interfaces 122. Furthermore, the computer system 112 can exchange data with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or a public network (e.g., the Internet), via a network adapter 120. As shown, the network adapter 120 exchanges data with the other components of the computer system / server 112 via the bus 118.
[0062] Fig. Figure 2 shows an example block diagram of the memory system 128 in more detail. The memory system 128 has a control unit 206 and a memory 208. The memory 208 can be, for example, any suitable physical memory such as a cache memory or a random access memory (RAM).
[0063] The control unit 206 contains a receiver 214 for a request 210 and a sender 216 for a response 212, which are configured to exchange data with the bus 118, with the receiver 214 and the sender 216 each containing SILO buffers (FIFOs). In response to a request 210, the control unit 206 performs read and write accesses to the memory 208 and can return a response 212.
[0064] Memory 208 has one or more cache memory rows 211. A data structure with a dynamic array 255 can be implemented in cache memory row 211 by, for example, setting up at least a part of cache memory row 211 as a dynamic array for access. Such a cache memory row 211 has a metadata field 213 and an elements field 215. The metadata field 213 and the elements field 25 of the data structure with a dynamic array 225 can be set up in memory 208, for example, by a user.
[0065] The field Metadata 213 contains metadata for the data structure with dynamic array 225. The field Metadata 213 can store one or more parameter values that describe, for example, the element size for the data structure with dynamic array 225 and the number of elements in the data structure with dynamic array 225.
[0066] The field Elements 215 and the field Metadata 213 share allocated bits from the cache memory line 211. Therefore, allocating a bit from the cache memory line to the field Metadata 213 results in the release of another bit from the field Elements 215.
[0067] For example, the size of the Metadata 213 field can be controlled by a release bit that can be assigned to the Metadata 213 field. The release bit can be associated with a predefined parameter, such as a parameter that describes the element size of the data structure with dynamic array 225. When the release bit is set, the parameter value of the predefined parameter can be stored in the Metadata 213 field, thus increasing its size.
[0068] The described structure of the storage system can provide a single interface for multiple users or threads to use the dynamic array data structure, for example in a multithreaded application where several threads simultaneously issue requests such as request 210 to access the cache memory row.
[0069] The request 210 for an operation on the data structure with dynamic array 225 is executed by the control unit 206 by performing actions that correspond to the operation request. These actions are coded in the control unit. After the request has been executed, the control unit 206 can, during a data exchange 220, update the metadata, e.g., the number of element parameters in the field Metadata 213, and update the data structure with dynamic array 225 in the field Elements 215.
[0070] The request 210 from a requester or user is received by the receiver 214 of the control unit 206 from the bus 118. The requester can be a thread running an application, for example, a thread performing an AMO operation. The request 210 specifies a memory location of the cache memory row in memory. The metadata 213 of this specified cache memory row is read by the control unit 206 to determine parameters of the dynamic array data structure 225. These parameters are used by the control unit 206 to determine a memory location in memory 208 for a selected element in the dynamic array data structure 225, where the selected element from the request 210 is used.
[0071] Request 210 can be any suitable request for an operation on the data structure with dynamic array 225, such as a push request that assigns an element to the field Elements 215 and stores a value there. The assigned element can be any element of the field Elements 215, including an element located in the middle of the data structure with dynamic array 225.
[0072] An element of the data structure with dynamic array 225 can be accessed by the control unit 206 during a data exchange 218, where access is based on the operation in the request 210. In the example where the request 210 is a pop operation request, the value of the selected element, which is read during the data exchange 218, is transferred by the control unit 206 to the user in the response 212. In an example where the request 210 is a push operation request, the request 210 provides a value that the control unit 206 writes to the selected element during a data exchange 218.
[0073] Fig. Figure 3 shows a diagram illustrating a sequence of operations on a dynamic array data structure (e.g., 225). The dynamic array data structure 325.1 is initially empty with 0 elements. Operations on the dynamic array data structure can add elements until all elements of the array 215 are filled. Each element of the array 315.1 marked with an "X" indicates an empty element that stores no element for the dynamic array data structure. The operations can be requested and received by the storage system's control unit (e.g., 206) as concurrent requests.
[0074] The metadata field 313.1 of the cache memory line 311 has a subfield 317.1 for storing a value that indicates the number of elements in the data structure with dynamic array 315.1.
[0075] The first operation of the sequence 301 pushFirst(A) corresponds to a Push Value operation. The Push Value operation request provides a value "A" to be inserted into the dynamic array data structure 225. The control unit 206 determines a memory location for the first element 321 in the dynamic array data structure 325.1 where the value "A" is to be inserted. The Push Value operation request can, for example, specify the first element 321. The control unit 206 writes the value "A" to the Elements field 315.2, resulting in the dynamic array data structure 325.2 now having one element. The control unit also updates the metadata of the Metadata field 313.1 to increase the number of element values. The control unit reads the value 0 from subfield 317.1, increments it by one, and writes the incremented value 1 to subfield 317.2.
[0076] A second operation of the sequence 303 pushFirst(B) corresponds to another push-value operation to insert the value "B" into the first element 321 of the dynamic array data structure 325.2. To do this, the controller moves the value "A" from the first element 321 to the second element 323 of the Elements array 315.2 to free the first element 321 of the Elements array 315.2. The controller then writes a value "B" into the first element 321, resulting in the dynamic array data structure 325.3 having two elements. Additionally, the controller updates the metadata of the Metadata array 313.2 to increase the number of element values. The controller reads the value 1 from subfield 317.2, increments it by one, and writes the incremented value 2 into subfield 317.3.
[0077] A third operation in the sequence 305 pushFirst(C) is another push-value operation to insert the value "C" into the first element 321 of the dynamic array data structure 325.3. To do this, the controller moves the value "A" from the second element 323 to the third element 324 to free up the second element 323, and moves the value "B" from the first element 321 to the second element 323 to free up the first element of array 315.3. The controller then writes the value "C" into the first element 321, resulting in the dynamic array data structure 325.4 having three elements. The controller also updates the metadata of array 313.3 to increase the number of element values. The control unit 206 reads the value 2 from subfield 317.3, increases it by one and writes the increased value 3 into subfield 317.4.
[0078] A fourth operation in the sequence 303 pushLast(D) is another push-value operation to insert the value "D" into the last element of the dynamic array data structure 325.4. To do this, the control unit reads the value 3 from the number of elements stored in subarray 317.4 to determine the number of elements. The control unit then identifies an element that has a memory location in the element array 315.4 corresponding to the read value of the number of elements plus one. Finally, the control unit writes the value "D" into element 327, resulting in the dynamic array data structure 325.5 having five elements.
[0079] Furthermore, the control unit updates the metadata of field 313.4 to increase the number of element values. Control unit 206 reads the value 3 from subfield 317.4, increments it by one, and writes the incremented value 4 to subfield 317.5.
[0080] A fifth operation in the sequence 309 popFirst() corresponds to a pop operation to read and delete a value from the first element of the dynamic array data structure 325.5. The controller reads the value "C" and sends it back to the requester of the operation and removes the value "C" from the elements array 315.5. The controller then moves the values "B", "A", and "D" from the second, third, and fourth elements, respectively, to the first, second, and third elements, resulting in the dynamic array data structure 325.6 having three elements.
[0081] Furthermore, the control unit updates the metadata of field 313.5 to reduce the number of element values. The control unit reads the value 4 from subfield 317.5, decrements it by one, and writes the reduced value 3 to subfield 317.6.
[0082] Fig. Figure 4 is a flowchart of an exemplary procedure and system for operating a storage system such as the one described in Fig. 1 shown storage system to implement a data structure with a dynamic array in a cache memory row, for example a single cache memory row in the storage system.
[0083] In step 401, the cache storage row in the storage system is configured to have a Metadata field and an Elements field. This configuration also includes defining an element size and the number of elements in the dynamic array data structure within the Metadata field. Furthermore, the Elements field defines the value of each element within the dynamic array data structure. The parameters in the Metadata field and the element values in the Elements field can be received by a user.
[0084] In step 403, the control unit receives a request for an operation on the dynamic array data structure from a user or requester. Request 210 specifies the address of the cache memory row for the operation. The requester issuing the request can be any suitable user, such as a thread running in a processor, a processing element contained in a buffered memory stack, or a thread exchanging data over a network using network interface logic.
[0085] In step 405, the control unit for the operation designates one or more actions on the data structure with a dynamic array using the information. The one or more actions are encoded in the control unit.
[0086] In step 407, the control unit performs one or more actions to execute the request. For example, the request might be for a pop operation on the dynamic array data structure to retrieve a value for a selected element within the structure. In this case, the control unit might perform the following actions: read the metadata of the metadata field, locate a memory location for the selected element, read the value of the selected element using that memory location, send the value of the selected element as a response to the operator requesting the operation, and update the cache memory line.Updating the cache memory line involves decreasing the number of elements in the metadata and moving the elements in the Elements field to remove the selected element from the dynamic array data structure.
[0087] As shown in the illustration, after step 407 the control unit waits to serve the next request 210 and returns to block 403.
[0088] Step 401 of the initial configuration can be executed once during the initial configuration, while steps 403 to 407 can be repeated each time a request for an operation is served by the control unit 206. Reference symbol list 100 Data processing systems 112 servers 114 external units 116 processor 120 network adapters 122 I / O interface 124 display 128 storage system 206 Control unit 208 storage 210 requirement 211 Cache memory line 212 Answer 213 Field Metadata 214 recipients 215 Field Elements 216 transmitters 218 to 220 Data exchange 225 Data structure with dynamic array 301 to 309 operations 311 Cache memory line 313 Field Metadata 315 Field Elements 317 subfield 321, 323, 324, 327 elements 325 Data structure with dynamic array 401 to 407 steps.
Claims
[1] A method for implementing a dynamic array data structure (225, 325) in a cache line (211, 311) in a memory system (128) including a memory (208) and a control unit (206), the method comprising: - in the memory (208) setting up the cache line (211, 311) as a cache line having a metadata field (213) and an elements field (215, 315), wherein the metadata field (213, 313) comprises metadata of the dynamic array data structure (225, 325) and the elements field (215, 315) comprises a value of each element of the dynamic array data structure, - receiving, by the control unit (206), a request (210) for an operation on the dynamic array data structure (225, 325), the request specifying a location of the cache line (211, 311) in the memory (208) and information specifying the request (210); - by the control unit (206), identifying one or more actions on the dynamic array data structure (225, 325) for operation using the information, wherein the one or more actions are encoded in the control unit (206); and - in response to receiving the request (210), executing the request by performing the one or more coded actions. [2] The method of claim 1, wherein the setting further comprises: - in the metadata, define an element size for the data structure with dynamic array (225, 325); and - in the metadata defining the number of elements (317.1) in the data structure with dynamic array (225, 325); and - in the Elements field (215, 315) define the value of each element in the dynamic array data structure (225, 325). [3] The method of claim 1 or 2, wherein the request comprises a plurality of request element operations, wherein executing the request comprises executing one or more actions: - Reading the metadata of the Metadata field (213, 313); - Determine the number of elements in the data structure using a dynamic array (225, 325); - Send the determined number of elements as a response to the requester of the operation. [4] The method of claim 1 or 2, wherein the request comprises a request for a get-value operation on the dynamic array data structure (225, 325) to obtain a value for a selected element in the dynamic array data structure (225, 325), wherein executing the request comprises executing one or more actions: - Reading the metadata of the Metadata field (213, 313); - determining a memory location of the selected element in the array of elements (215, 315) in the memory (208); - Reading the value of the selected element using the memory location; - Send the value of the selected item as a response to the requester of the operation. [5] The method of claim 1 or 2, wherein the request comprises a request pop operation on the dynamic array data structure to obtain a value and remove a selected element in the dynamic array data structure (225, 325), wherein executing the request comprises executing one or more actions: - Reading the metadata of the Metadata field (213, 313); - determining a memory location of the selected element in the array of elements (215, 315) in the memory (208); - Reading the value of the selected element using the memory location; - Sending the value of the selected element as a response to the requester of the operation; and - updating the cache line, wherein the updating comprises decreasing the number of elements in the metadata and moving the elements in the elements array (215, 315) to remove the selected element from the dynamic array data structure (225, 325). [6] The method of claim 1 or 2, wherein the request comprises a set-value operation request, the request providing a value for a selected element in the dynamic array data structure (225, 325); wherein executing the request comprises: executing the one or more actions; reading the metadata of the metadata field, determining a location in the elements field of the cache line for the selected element in the dynamic array data structure (225, 325), and writing the value to the selected element. [7] The method of claim 1 or 2, wherein the request comprises a push value operation request, the request providing a value to be inserted into the dynamic array data structure (225, 325); wherein executing the request comprises performing the actions of the one or more actions: reading the metadata of the metadata field (213, 313), updating the cache line, wherein updating comprises increasing the number of elements in the metadata and moving the elements in the elements field (215, 315) to insert a selected element of the dynamic array data structure, and writing the value of the selected element. [8] The method of claim 1 or 2, wherein the request comprises a request for a get-minimum-value operation or a get-maximum-value operation; wherein executing the request comprises executing the one or more actions: - Reading the metadata of the Metadata field (213, 313); - Determining the storage locations in the array of elements (215, 315) for all elements in the dynamic array data structure (225, 325); - using the determined memory locations, reading values of all elements in the dynamic array data structure (225, 325) and marking the element with the minimum value or the maximum value; and - Send the marked minimum or maximum value as a response to the requester of the operation. [9] The method of claim 1 or 2, wherein the request comprises a request for a pop minimum value operation or pop maximum value operation; wherein executing the request comprises executing the actions of the one or more actions: - Reading the metadata of the Metadata field (213, 313); - Determining the storage locations in the array of elements (215, 315) for all elements in the dynamic array data structure (225, 325); - using the determined memory locations, reading values of all elements in the dynamic array data structure (225, 325) and marking the element with the minimum value or the maximum value; - Sending the marked minimum or maximum value as a response to the requestor of the operation and updating the cache line, wherein the updating comprises decreasing the number of elements in the metadata and moving the elements in the Elements field to remove the marked element from the dynamic array data structure. [10] The method of any preceding claim, wherein establishing further comprises defining in the metadata a position and a size of a field instance in each element of the dynamic array data structure (225, 325), the request comprising a request pop instance, the method further comprising decreasing a field instance of a selected element by moving the selected element with the decreased field instance back into the dynamic array data structure (225, 325) based on the decreased instance being greater than zero. [11] The method of any preceding claim, wherein the request corresponds to a single load instruction or a single store instruction, the single load or single store instruction comprising an atomic store operation received and executed by the control unit (206), and the single load or single store instruction supporting concurrent requests comprising the request. [12] The method of any preceding claim, wherein the elements field (215, 315) and the metadata field (213, 313) share associated bits of the cache line, wherein allocating a bit of the cache line for the metadata field comprises releasing another bit from the elements field. [13] A computer program product comprising computer-executable instructions for carrying out the method steps of the method according to any one of the preceding claims. [14] A system (128) for implementing a dynamic array data structure (225, 325), the system comprising a memory (208) and a control unit (206), the system (128) being configured to implement the dynamic array data structure (225, 325) in a cache line (211, 311) by: - setting up the cache line (211, 311) in the memory 208 as a cache line having a metadata field (213) and an elements field (215), wherein the metadata field (213) comprises metadata of the dynamic array data structure (225, 325) and wherein the elements field (215, 315) comprises a value of each element of the dynamic array data structure; - receiving, by the control unit (206), a request (210) for an operation on the dynamic array data structure (225, 325), the request specifying a location of the cache line (211, 311) in the memory and information specifying the request; - for the operation, identifying one or more actions on the dynamic array data structure (225, 325) using the information, wherein the one or more actions are encoded in the control unit (206); and - in response to receiving the request (210), executing the request (210) by performing the one or more coded actions.
Citation Information
Patent Citations
Data processor and data access method
JP2003030051A
Cache memory
US20080256303A1
JP002003030051A
