WO2015004570A1 - Method and system for implementing a dynamic array data structure in a cache line - Google Patents

Method and system for implementing a dynamic array data structure in a cache line Download PDF

Info

Publication number
WO2015004570A1
WO2015004570A1 PCT/IB2014/062756 IB2014062756W WO2015004570A1 WO 2015004570 A1 WO2015004570 A1 WO 2015004570A1 IB 2014062756 W IB2014062756 W IB 2014062756W WO 2015004570 A1 WO2015004570 A1 WO 2015004570A1
Authority
WO
WIPO (PCT)
Prior art keywords
data structure
request
array data
dynamic array
elements
Prior art date
Application number
PCT/IB2014/062756
Other languages
French (fr)
Inventor
Burkhard Steinmacher-Burow
Original Assignee
International Business Machines Corporation
Ibm Japan, Ltd.
Ibm Deutschland Gmbh
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Business Machines Corporation, Ibm Japan, Ltd., Ibm Deutschland Gmbh filed Critical International Business Machines Corporation
Priority to CN201480038913.0A priority Critical patent/CN105359145B/en
Priority to DE112014003226.3T priority patent/DE112014003226T5/en
Priority to JP2016524920A priority patent/JP6333370B2/en
Priority to GB1601478.9A priority patent/GB2530234B/en
Publication of WO2015004570A1 publication Critical patent/WO2015004570A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0875Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/76Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data

Definitions

  • the invention relates to computing systems, and more particularly to a method for implementing a dynamic array data structure in a cache line.
  • An atomic memory operation refers to a read-modify-write operation on shared data.
  • An AMO is atomic in the sense that the read-modify-write operation of a thread is performed without interference by another thread.
  • each read or write or AMO access is performed atomically, without interference from another access.
  • the invention relates to a method for implementing a dynamic array data structure in a cache line in a memory system that includes a memory storage and a controller. At least part of the cache line may be accessed (or treated) as a dynamic array data structure.
  • the method comprises configuring in the memory storage the cache line as a cache line comprising a metadata field and an elements field, wherein the metadata field comprises metadata of the dynamic array data structure.
  • the elements field may comprise element values of each element of the dynamic array data structure .
  • the method further comprises receiving, by the controller, a request for an operation on the dynamic array data structure, wherein the request is indicative of a location of the cache line in the memory storage and information specifying the request.
  • the information that specifies the request may comprise information specifying elements of the dynamic array data structure required by the operation.
  • the method further comprises identifying, by the controller, for the operation one or more actions on the dynamic array data structure using the information, wherein the one or more actions are encoded in the controller and in response to receiving the request, performing the request by executing the one or more encoded actions.
  • Multiple actions may be encoded in the controller.
  • the identification of the one or more actions may comprise selecting the one or more actions from the multiple actions. - -
  • the requested operation may be an atomic memory operation.
  • the received request may be one of multiple concurrent requests received from multiple threads by the controller for operations on the dynamic array data structure.
  • the received concurrent requests may be sequentially performed.
  • These features may be advantageous as they may provide a simplified method for accessing data stored in a memory.
  • the method may be seamlessly integrated in existing memory systems.
  • metadata and the elements field may fit within a single cache-line may facilitate the implementation of the controller and the memory system.
  • the use of the memory system allows the configuration of multiple dynamic arrays up to the capacity of the memory.
  • the request may be directed to the dynamic array structure without requiring addresses of elements to be accessed.
  • the request may be directed to the first element of the dynamic array data structure, the last element of the dynamic array data structure as well as the element at a specified index.
  • new AMOs beyond conventional AMOs, may be implemented to use the above dynamic array data structure.
  • a further advantage may reside in the fact that accessing a single cache line for performing a given operation may be faster than accessing multiple cache lines for performing the same operation .
  • These features may provide a single interface for a plurality of users or threads to utilize the dynamic array data structure, for example with a multi-threaded application where multiple - - threads concurrently issue requests, such as the request, to access the dynamic array data structure.
  • the configuring further comprises defining, in the metadata, an element size for the dynamic array data structure; defining, in the metadata, the number of elements in the dynamic array data structure, and defining, in the elements field, the value of each element in the dynamic array data structure.
  • This embodiment may be advantageous as it may provide sufficient information to the controller for an autonomous execution of received requests.
  • the request is further indicative of an element size of an element of the dynamic array data structure. This may be advantageous as the metadata may not comprise data on the element size.
  • a metadata parameter may enable or disable an indication of an error condition.
  • the controller may raise an interrupt when the request specifies an element size smaller or larger, respectively, than that defined in the metadata.
  • the controller may raise an interrupt in response to a push request to a dynamic array data structure already with the maximum number of elements supported by the elements field.
  • the controller may raise an interrupt in response to a set request specifying an index of an element not in the dynamic array data structure.
  • the controller may reply with a predefined failure value.
  • the controller may reply with a predefined failure value in response to a get request specifying an index - - of an element not in the dynamic array data structure.
  • the predefined failure value may be determined by a configurable field in the metadata.
  • the controller may return one of multiple predefined failure values in order to further identify why a request cannot be satisfied.
  • the metadata may further comprise a failed pop parameter.
  • the failed pop parameter may have a value that may be comprised in a reply returned by the controller to the requester of a pop operation for the dynamic array data structure being empty.
  • the request comprises a number of elements operation request, the performing of the request comprising performing the one or more actions: reading the metadata of the metadata field; determining the number of elements in the dynamic array data structure; sending as reply to the requester of the operation the determined number of elements .
  • the configuring further comprises defining, in the metadata, a head index and a tail index allowing the elements field to be used as a circular buffer holding the elements of the dynamic array data structure, thus for some requests avoiding the movement of elements within the elements field.
  • the information specifying the request may specify a selected element, where the selected element may 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.
  • the request comprises a get value operation request on the dynamic array data structure, for obtaining a value for a selected element in the dynamic array - - data structure
  • the performing of the request comprises performing the one or more actions: reading the metadata of the metadata field, determining a location in the memory of the selected element in the elements field, reading the value of the selected element using the location, sending as reply the value of the selected element to the requester of the operation.
  • the request comprises a pop operation request on the dynamic array data structure, for obtaining a value and removing a selected element in the dynamic array data structure
  • the performing of the request comprises performing the one or more actions: reading the metadata of the metadata field, determining a location in the memory of the selected element in the elements field, wherein the method further comprises: reading the value of the selected element using the location, sending as reply the value of the selected element to the requester of the operation, and updating the cache line, the updating comprising decrementing 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.
  • the request comprises a set value operation request, the request providing a value for a selected element in the dynamic array data structure; wherein the performing of the request comprises performing 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, and writing the value to the selected element.
  • the request comprises a push value operation request, the request providing a value to be inserted in the dynamic array data structure; wherein the performing of the request comprises performing the actions of the one or more - - actions: reading the metadata of the metadata field, updating the cache line, the updating comprising incrementing the number of elements in the metadata and moving the elements in the elements field to insert a selected element of the dynamic array data structure and writing the value to the selected element.
  • the push value operation request may be a push AMO request which is based on the processor' s store-conditional instruction, where the condition included in a reply to the request indicates to the user if the push succeeded.
  • the push AMO request is based on the processor' s swap or compare-and-swap instruction where the value in the reply indicates to the user if the push succeeded.
  • the AMO request may be similar to the processor' s store- conditional instruction or may be similar to the processor' s swap or compare-and-swap instruction.
  • the request comprises a get minimum value or get maximum value operation request; wherein the performing of the request comprises performing the one or more actions reading the metadata of the metadata field; determining the locations in the elements field for all elements in the dynamic array data structure, reading, using the determined locations, values of all the elements in the dynamic array data structure and identifying the element with the minimum value or the maximum value, and sending as reply to the requester of the operation the identified minimum or maximum value.
  • the request comprises a get minimum value or get maximum value operation request, wherein the request specifies identifying an element having the minimum or maximum value by treating each element of the dynamic array data structure as one of an unsigned integer, signed integer or floating point number.
  • the request comprises a pop minimum value or pop maximum value operation request
  • the performing of the request comprises performing the actions of the one or more actions reading the metadata of the metadata field, determining the locations in the cache line for all elements in the dynamic array data structure, reading, using the determined locations, values of all the elements in the dynamic array data structure and identifying the element with the minimum value or the maximum value, sending as reply to the requester of the operation the identified minimum or maximum value and updating the cache line, the updating comprising decrementing the number of elements in the metadata and moving the elements in the elements field to remove the identified element from the dynamic array data structure.
  • the configuring further comprises defining, in the metadata, a position and size of an instance field in each element of the dynamic array data structure, the request comprising a pop instance request, the method further comprising decrementing an instance field of a selected element, pushing the selected element with the decremented instance field back onto the dynamic array data structure based on a decremented instance being greater than zero.
  • the controller may return in a reply the number of elements in the dynamic array data structure, including all instances.
  • the request corresponds to a single load instruction or a single store instruction, wherein the single load or single store instruction comprises an atomic memory operation received and performed by the controller and the single load or single store instruction supports concurrent requests comprising the request.
  • the single load or single store instruction comprises an atomic memory operation received and performed by the controller and the single load or single store instruction supports concurrent requests comprising the request.
  • the atomic nature of the controller may satisfy each request to use the dynamic array data structure and may avoid corruption of data of the dynamic array data structure that may occur with multiple threads accessing the dynamic array data structure.
  • the elements field and the metadata field share allocated bits of the cache line allocating a bit of the cache line for the metadata field comprises de-allocating another bit from the elements field.
  • the dynamic array data structure may be implemented in two or more cache lines of the memory system, wherein the two or more cache lines are contiguous cache lines.
  • a request for an operation on the dynamic array data structure may be indicative of the two or more contiguous cache lines and a location of a first cache line of the two or more cache lines in the memory system.
  • the invention in another aspect, relates a computer program product comprising computer executable instructions to perform the method steps of the method of any one of the preceding embodiments .
  • the invention in another aspect, relates to a system for implementing a dynamic array data structure, the system comprising a memory storage and a controller, the system being configured for configuring in the memory storage the cache line as a cache line comprising a metadata field and an elements field, wherein the metadata field comprises metadata of the dynamic array data structure and wherein the elements field comprises a value of each element of the dynamic array data structure; receiving, by the controller, a request for an operation on the dynamic array data structure, wherein the request is indicative of a location of the cache line in the memory and information specifying the request; identifying for - - the operation one or more actions on the dynamic array data structure using the information, wherein the one or more actions are encoded in the controller; and in response to receiving the request, performing the request by executing the one or more encoded actions.
  • the memory system may be a level in a cache hierarchy, so that the controller performing a request may result in memory system access to lower level (s) in the cache hierarchy to establish the metadata and elements in memory cache.
  • a memory system may be split into two or more parts, where a controller in a part may operate a dynamic array data structure using memory in that part.
  • a cache level may be replicated as two or more units, where the controller may access any part of the underlying cache or memory levels within a cache unit.
  • a Computer-readable storage medium' as used herein encompasses any tangible storage medium which may store instructions which are executable by a processor of a computing device.
  • the computer-readable storage medium may be referred to as a computer-readable non-transitory storage medium.
  • the computer- readable storage medium may also be referred to as a tangible computer readable medium.
  • a computer- readable storage medium may also be able to store data which is able to be accessed by the processor of the computing device.
  • Examples of computer-readable storage media include, but are not limited to: a floppy disk, a magnetic hard disk drive, a solid state hard disk, flash memory, a USB thumb drive, Random Access Memory (RAM) , Read Only Memory (ROM) , an optical disk, a magneto-optical disk, and the register file of the processor.
  • Examples of optical disks include Compact Disks (CD) and Digital Versatile Disks (DVD) , for example CD-ROM, CD-RW, CD-R, DVD-ROM, DVD-RW, or DVD-R disks.
  • the term computer readable-storage medium also refers to various types of recording media capable - - of being accessed by the computer device via a network or communication link.
  • a data may be retrieved over a modem, over the internet, or over a local area network.
  • Computer executable code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • a computer readable signal medium may include a propagated data signal with computer executable code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof.
  • a computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
  • Computer memory' or 'memory' is an example of a computer- readable storage medium.
  • Computer memory is any memory which is directly accessible to a processor.
  • Computer storage is any non-volatile computer-readable storage medium. In some embodiments computer storage may also be computer memory or vice versa.
  • a 'processor' as used herein encompasses an electronic component which is able to execute a program or machine executable instruction or computer executable code.
  • References to the computing device comprising "a processor” should be interpreted as possibly containing more than one processor or processing core.
  • the processor may for instance be a multi-core processor.
  • a processor may also refer to a collection of processors within - - a single computer system or distributed amongst multiple computer systems.
  • the term computing device should also be interpreted to possibly refer to a collection or network of computing devices each comprising a processor or processors.
  • the computer executable code may be executed by multiple processors that may be within the same computing device or which may even be distributed across multiple computing devices.
  • Computer executable code may comprise machine executable instructions or a program which causes a processor to perform an aspect of the present invention.
  • Computer executable code for carrying out operations for 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 "C" programming language or similar programming languages and compiled into machine executable instructions.
  • the computer executable code may be in the form of a high level language or in a pre-compiled form and be used in conjunction with an interpreter which generates the machine executable instructions on the fly.
  • the computer executable code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer may 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 may be made to an external computer (for example, through the Internet using an Internet Service Provider) .
  • LAN local area network
  • WAN wide area network
  • Internet Service Provider for example, AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
  • These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks .
  • These computer program instructions may also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks .
  • the computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable - - apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
  • aspects of the present invention may be embodied as an apparatus, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a "circuit,” “module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium (s) having computer executable code embodied thereon.
  • Fig. 1 illustrates system architecture operable to execute method for implementing a dynamic array data structure in a cache line in a memory
  • Fig. 2 illustrates an exemplary block diagram of a memory system
  • Fig. 3 shows a diagram illustrating a sequence of operations on a dynamic array data structure
  • Fig. 4 is a flowchart of a method for implementing a dynamic array data structure in a cache line in a memory.
  • Fig.l shows a computer system (or server) 112 in computing system 100 is shown in the form of a general-purpose computing device.
  • the components of computer system 112 may include, but are not limited to, one or more processors or processing units 116, a memory system 128, and a bus 118 that couples various system components including memory system 128 to processor 116.
  • Computer system 112 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer system 112, and it includes both volatile and non-volatile media, removable and non-removable media .
  • Memory system 128 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and/or cache memory.
  • the memory system may include one or more active buffered memory devices.
  • the active buffered devices may include a plurality of memory elements (e.g., chips) .
  • the active buffered memory device may include layers of memory that form a three dimensional ("3D") memory device where individual columns of chips form vaults in communication with the processing units 116.
  • the active buffered memory device may comprise partitions - - that may be concurrently accessed by a plurality of processing elements, where the partitions may be any suitable memory segment, including but not limited to vaults.
  • the processing units 116 may issue requests to the memory system, utilizing the dynamic array data structure and associated metadata to implement an application.
  • Computer system 112 may also communicate with one or more external devices 114 such as a keyboard, a pointing device, a display 124, etc.; one or more devices that enable a user to interact with computer system 112; and/or any devices (e.g., network card, modem, etc.) that enable computer system 112 to communicate with one or more other computing devices. Such communication can occur via I/O interface (s) 122. Still yet, computer system 112 can communicate with one or more networks such as a local area network (LAN) , a general wide area network (WAN), and/or a public network (e.g., the Internet) via network adapter 120. As depicted, network adapter 120 communicates with the other components of computer system/server 112 via bus 118.
  • LAN local area network
  • WAN wide area network
  • public network e.g., the Internet
  • Fig. 2 shows in details an exemplary block diagram of the memory system 128.
  • the memory system 128 comprises a controller 206 and storage 208.
  • the storage 208 may be for example any suitable physical memory, such as a cache or random access memory (RAM) .
  • the controller 206 includes a receiver 214 of a request 210 and a transmitter 216 of a reply 212 configured to communicate with the bus 118, where the receiver 214 and transmitter 216 each include first-in-first-out buffers (FIFOs) .
  • the controller 206 performs read and write accesses to the storage 208 and may return a reply 212. - -
  • the storage 208 comprises one or more cache lines 211.
  • a dynamic array data structure 225 may be implemented in the cache line 211, by, for example, configuring at least part of the cache line 211 for accessing as a dynamic array said at least part of the cache line 211.
  • Such a cache line 211 comprises a metadata field 213 and an elements field 215.
  • the metadata field 213 and the elements field 215 of the dynamic array data structure 225 may be configured within memory storage 208 by a user .
  • the metadata field 213 comprises metadata of the dynamic array data structure 225.
  • the metadata field 213 may store one or more parameter values of parameters describing, for example, an element size for the dynamic array data structure 225 and the number of elements in the dynamic array data structure 225.
  • the elements field 215 and the metadata field 213 share allocated bits of the cache line 211.
  • allocating a bit of the cache line for the metadata field 213 comprises de ⁇ allocating another bit from the elements field 215.
  • the size of the metadata field 213 may be controlled by an enable bit that may be allocated in the metadata field 213.
  • the enable bit may be associated with a given parameter, such as, a parameter describing the element size of the dynamic array data structure 225. If the enable bit is set, the parameter value of the given parameter may be stored in the metadata field 213, and thus, increases the size of the metadata field 213.
  • the described structure of the memory system may provide a single interface for a plurality of users or threads to utilize the dynamic array data structure, for example with a multi- - - threaded application where multiple threads concurrently issue requests, such as request 210, to access the cache line.
  • the request 210 for an operation on the dynamic array data structure 225 is performed by the controller 206 by executing actions that correspond to said operation request. These actions are encoded in the controller. After performing the request, the controller 206 may update in communication 220, the metadata e.g. the number of elements parameter in the metadata field 213 and update the dynamic array data structure 225 in the elements field 215.
  • the request 210 from a requester or user is received from the bus 118 by the receiver 214 of the controller 206.
  • the requester may be a thread executing an application e.g. a thread executing an AMO operation.
  • the request 210 is indicative of a location of the cache line in the memory.
  • the metadata 213 of said indicated cache line is read by the controller 206 to determine parameters of the dynamic array data structure 225. These parameters are used by the controller 206 to determine a location in memory storage 208 for a selected element in the dynamic array data structure 225, where the selected element is used by the request 210.
  • the request 210 may be any suitable request for an operation on the dynamic array data structure 225, such as a push request that allocates an element in the elements fields 215 and stores a value there.
  • the allocated element may be any element of the elements field 215 including an element located in the middle of the dynamic array data structure 225.
  • An element of the dynamic array data structure 225 may be accessed by the controller 206 in communication 218, where the accessing is based on the operation in request 210.
  • the request 210 is a pop operation request
  • the value of the selected element read in communication 218 is transmitted by the controller 206 to the user in the reply 212.
  • the request 210 provides a value which the controller 206 writes in communication 218 to the selected element.
  • Fig. 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 may add elements up to occupying all elements of the elements field 215. Each element of the elements field 315.1 marked "X" indicates an empty element storing no element for the dynamic array data structure.
  • the operations may be requested and received by the controller (e.g. 206) of the memory system as concurrent requests .
  • the metadata field 313.1 of the cache line 311 comprises a subfield 317.1 for storing value indicative of the number of elements in the dynamic array data structure 315.1.
  • a 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 in the dynamic array data structure 325.1.
  • the controller 206 determines a location of a first element 321 in the dynamic array data structure 325.1 into which the value "A" is to be inserted.
  • the push value operation request may indicate of said first element 321.
  • the controller 206 writes the value "A" in the elements field 315.2 which results in the dynamic array data structure 325.2 with one element.
  • the controller updates the metadata of the metadata field 313.1 to increase the number of elements value.
  • the controller reads the value 0 of the subfield - -
  • a second operation of the sequence 303 pushFirst (B) corresponds to another push value operation for inserting the value "B" in the first element 321 of the dynamic array data structure 325.2.
  • the controller moves the value "A” from the first element 321 to the second element 323 of the elements field
  • controller writes a value "B" in the first element 321, which results in the dynamic array data structure
  • the controller updates the metadata of the metadata field 313.2 to increase the number of elements value.
  • the controller reads the value 1 of the subfield 317.2, increments by one and writes the incremented value 2 in the subfield 317.3.
  • a third operation of the sequence 305 pushFirst (C) corresponds to a further push value operation for inserting the value "C" in the first element 321 of the dynamic array data structure 325.3.
  • 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 the elements field 315.3.
  • the controller writes the value "C" in the first element 321, which results in the dynamic array data structure 325.4 with three elements.
  • the controller updates the metadata of the metadata field 313.3 to increase the number of elements value.
  • the controller 206 reads the value 2 of the subfield 317.3, increments it by one and writes the incremented value 3 in the subfield 317.4.
  • a fourth operation of the sequence 303 pushLast (D) corresponds to another push value operation for inserting the value "D" in a - - last element of the dynamic array data structure 325.4.
  • the controller reads the value 3 of the number of elements stored in the subfield 317.4 to determine the number of elements. Further, the controller determines an element having a location in the elements field 315.4 that corresponds to the read value of the number of elements plus one. Next, the controller writes the value "D" in the element 327, which results in the dynamic array data structure 325.5 with four elements .
  • the controller updates the metadata of the metadata field 313.4 to increase the number of elements value.
  • the controller 206 reads the value 3 of the subfield 317.4, increments it by one and writes the incremented value 4 in the subfield 317.5.
  • a fifth operation of the sequence 309 popFirst() corresponds to a pop operation for reading and deleting a value of the first element of the dynamic array data structure 325.5.
  • the controller reads the value "C” and sends it back to the operation requestor and removes the value "C” from the elements field 315.5.
  • the controller moves the values "B", "A” and "D” from the second, third and fourth element to the first, second and the third element respectively, which results in the dynamic array data structure 325.6 with three elements.
  • the controller updates the metadata of the metadata field 313.5 to decrease the number of elements value.
  • the controller reads the value 4 of the subfield 317.5, decrements it by one and writes the decremented value 3 in the subfield 317.6.
  • Fig. 4 is a flow chart of an exemplary method and system for operating a memory system, such as the memory system shown in FIG. 1 to implement a dynamic array data structure in a cache line e.g. in a single cache line in the memory system. - -
  • the cache line is configured in the memory such that the cache line comprises a metadata field and an elements field.
  • the configuring further includes defining, in the metadata, an element size for the dynamic array data structure the number of elements in the dynamic array data structure.
  • the configuring further includes defining, in the elements field, the value of each element in the dynamic array data structure.
  • the parameters in metadata and the element values in the elements field may be received from a user.
  • a request for an operation on the dynamic array data structure from a user or requestor is received by the controller.
  • the request 210 provides the address location of the cache line for the operation.
  • the requestor issuing the request may be any suitable user, such as a thread running on a processor, a processing element included in a buffered memory stack or a thread communicating over a network via network interface logic.
  • step 405 the controller identifies for the operation one or more actions on the dynamic array data structure using the information.
  • the one or more actions are encoded in the controller .
  • the controller executes the one or more actions to perform the request.
  • the request may comprise a pop operation request on the dynamic array data structure, for obtaining a value for a selected element in the dynamic array data structure.
  • the actions may be executed by the controller as follows: reading the metadata of the metadata field, determining a location in the memory of the selected element, reading the value of the selected element using the location, sending as reply the value of the selected element to - - the requester of the operation, and updating the cache line.
  • the updating of the cache line comprises decrementing 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 .
  • step 407 the controller waits to serve the next request 210 and returns to block 403.
  • the initial configuration step 401 may be performed once during initial configuration, while steps 403 to 407 may be repeated when each request for an operation is served by the controller 206.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The present invention relates to a method for implementing a dynamic array data structure (225, 325) in a cache line (211, 311) in a memory system (128) that includes a memory storage (208) and a controller (206). The method comprises: configuring in the memory (206) the cache line (211, 311) as a cache line comprising a metadata field (213, 313) and an elements field (215, 315), wherein the metadata field (213, 313) 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 controller (206), a request (210) for an operation on the dynamic array data structure (225, 325), wherein the request is indicative of a location of the cache line (211, 311) in the memory storage (208) and information specifying the request (210); identifying, by the controller (206), for the operation 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 controller (206); and in response to receiving the request, performing the request by executing the one or more encoded actions.

Description

- -
D E S C R I P T I O N
Method and system for implementing a dynamic array data structure in a cache line
Field of the invention
The invention relates to computing systems, and more particularly to a method for implementing a dynamic array data structure in a cache line.
Background
Many multithreaded computer systems or workloads become one of the more important technologies for different sized companies. They increase the computational efficiency and flexibility of a computing hardware platform. However, there is still a need for higher performance while maintaining a lower hardware effort.
SuiranarY of the invention
It is an objective of embodiments of the invention to provide for an improved method, a computer system and a computer program product. Said objective is solved by the subject matter of the independent claims. Advantageous embodiments are described in the dependent claims.
An atomic memory operation (AMO) as used herein refers to a read-modify-write operation on shared data. An AMO is atomic in the sense that the read-modify-write operation of a thread is performed without interference by another thread. In other terms, for threads or processors accessing (e.g. concurrently accessing) shared data, each read or write or AMO access is performed atomically, without interference from another access. - -
In one aspect, the invention relates to a method for implementing a dynamic array data structure in a cache line in a memory system that includes a memory storage and a controller. At least part of the cache line may be accessed (or treated) as a dynamic array data structure.
The method comprises configuring in the memory storage the cache line as a cache line comprising a metadata field and an elements field, wherein the metadata field comprises metadata of the dynamic array data structure. The elements field may comprise element values of each element of the dynamic array data structure .
The method further comprises receiving, by the controller, a request for an operation on the dynamic array data structure, wherein the request is indicative of a location of the cache line in the memory storage and information specifying the request. The information that specifies the request may comprise information specifying elements of the dynamic array data structure required by the operation.
The method further comprises identifying, by the controller, for the operation one or more actions on the dynamic array data structure using the information, wherein the one or more actions are encoded in the controller and in response to receiving the request, performing the request by executing the one or more encoded actions.
Multiple actions may be encoded in the controller. The identification of the one or more actions may comprise selecting the one or more actions from the multiple actions. - -
For example, the requested operation may be an atomic memory operation. The received request may be one of multiple concurrent requests received from multiple threads by the controller for operations on the dynamic array data structure. The received concurrent requests may be sequentially performed.
These features may be advantageous as they may provide a simplified method for accessing data stored in a memory. The method may be seamlessly integrated in existing memory systems.
The fact that metadata and the elements field may fit within a single cache-line may facilitate the implementation of the controller and the memory system. The use of the memory system allows the configuration of multiple dynamic arrays up to the capacity of the memory.
Another advantage may be that the request may be directed to the dynamic array structure without requiring addresses of elements to be accessed. For example, the request may be directed to the first element of the dynamic array data structure, the last element of the dynamic array data structure as well as the element at a specified index. Thus, new AMOs, beyond conventional AMOs, may be implemented to use the above dynamic array data structure.
A further advantage may reside in the fact that accessing a single cache line for performing a given operation may be faster than accessing multiple cache lines for performing the same operation .
These features may provide a single interface for a plurality of users or threads to utilize the dynamic array data structure, for example with a multi-threaded application where multiple - - threads concurrently issue requests, such as the request, to access the dynamic array data structure.
According to one embodiment, the configuring further comprises defining, in the metadata, an element size for the dynamic array data structure; defining, in the metadata, the number of elements in the dynamic array data structure, and defining, in the elements field, the value of each element in the dynamic array data structure.
This embodiment may be advantageous as it may provide sufficient information to the controller for an autonomous execution of received requests.
According to one embodiment, the request is further indicative of an element size of an element of the dynamic array data structure. This may be advantageous as the metadata may not comprise data on the element size.
According to embodiments, a metadata parameter may enable or disable an indication of an error condition. For example, the controller may raise an interrupt when the request specifies an element size smaller or larger, respectively, than that defined in the metadata. For example, the controller may raise an interrupt in response to a push request to a dynamic array data structure already with the maximum number of elements supported by the elements field. For example, the controller may raise an interrupt in response to a set request specifying an index of an element not in the dynamic array data structure.
According to embodiments, for a request which cannot be satisfied, the controller may reply with a predefined failure value. For example, the controller may reply with a predefined failure value in response to a get request specifying an index - - of an element not in the dynamic array data structure. According to embodiments, the predefined failure value may be determined by a configurable field in the metadata. The controller may return one of multiple predefined failure values in order to further identify why a request cannot be satisfied. For example, the metadata may further comprise a failed pop parameter. The failed pop parameter may have a value that may be comprised in a reply returned by the controller to the requester of a pop operation for the dynamic array data structure being empty.
According to one embodiment, the request comprises a number of elements operation request, the performing of the request comprising performing the one or more actions: reading the metadata of the metadata field; determining the number of elements in the dynamic array data structure; sending as reply to the requester of the operation the determined number of elements .
According to one embodiment, the configuring further comprises defining, in the metadata, a head index and a tail index allowing the elements field to be used as a circular buffer holding the elements of the dynamic array data structure, thus for some requests avoiding the movement of elements within the elements field.
The information specifying the request may specify a selected element, where the selected element may 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.
According to one embodiment, the request comprises a get value operation request on the dynamic array data structure, for obtaining a value for a selected element in the dynamic array - - data structure, wherein the performing of the request comprises performing the one or more actions: reading the metadata of the metadata field, determining a location in the memory of the selected element in the elements field, reading the value of the selected element using the location, sending as reply the value of the selected element to the requester of the operation.
According to one embodiment, the request comprises a pop operation request on the dynamic array data structure, for obtaining a value and removing a selected element in the dynamic array data structure, wherein the performing of the request comprises performing the one or more actions: reading the metadata of the metadata field, determining a location in the memory of the selected element in the elements field, wherein the method further comprises: reading the value of the selected element using the location, sending as reply the value of the selected element to the requester of the operation, and updating the cache line, the updating comprising decrementing 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.
According to one embodiment, the request comprises a set value operation request, the request providing a value for a selected element in the dynamic array data structure; wherein the performing of the request comprises performing 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, and writing the value to the selected element.
According to one embodiment, the request comprises a push value operation request, the request providing a value to be inserted in the dynamic array data structure; wherein the performing of the request comprises performing the actions of the one or more - - actions: reading the metadata of the metadata field, updating the cache line, the updating comprising incrementing the number of elements in the metadata and moving the elements in the elements field to insert a selected element of the dynamic array data structure and writing the value to the selected element.
In an embodiment, the push value operation request may be a push AMO request which is based on the processor' s store-conditional instruction, where the condition included in a reply to the request indicates to the user if the push succeeded. 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 reply indicates to the user if the push succeeded.
The AMO request may be similar to the processor' s store- conditional instruction or may be similar to the processor' s swap or compare-and-swap instruction.
According to one embodiment, the request comprises a get minimum value or get maximum value operation request; wherein the performing of the request comprises performing the one or more actions reading the metadata of the metadata field; determining the locations in the elements field for all elements in the dynamic array data structure, reading, using the determined locations, values of all the elements in the dynamic array data structure and identifying the element with the minimum value or the maximum value, and sending as reply to the requester of the operation the identified minimum or maximum value.
According to one embodiment, the request comprises a get minimum value or get maximum value operation request, wherein the request specifies identifying an element having the minimum or maximum value by treating each element of the dynamic array data structure as one of an unsigned integer, signed integer or floating point number. - -
According to one embodiment, the request comprises a pop minimum value or pop maximum value operation request, wherein the performing of the request comprises performing the actions of the one or more actions reading the metadata of the metadata field, determining the locations in the cache line for all elements in the dynamic array data structure, reading, using the determined locations, values of all the elements in the dynamic array data structure and identifying the element with the minimum value or the maximum value, sending as reply to the requester of the operation the identified minimum or maximum value and updating the cache line, the updating comprising decrementing the number of elements in the metadata and moving the elements in the elements field to remove the identified element from the dynamic array data structure.
According to one embodiment, the configuring further comprises defining, in the metadata, a position and size of an instance field in each element of the dynamic array data structure, the request comprising a pop instance request, the method further comprising decrementing an instance field of a selected element, pushing the selected element with the decremented instance field back onto the dynamic array data structure based on a decremented instance being greater than zero.
For example, in response to a request of number of elements, the controller may return in a reply the number of elements in the dynamic array data structure, including all instances.
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 comprises an atomic memory operation received and performed by the controller and the single load or single store instruction supports concurrent requests comprising the request. - -
The atomic nature of the controller may satisfy each request to use the dynamic array data structure and may avoid corruption of data of the dynamic array data structure that may occur with multiple threads accessing the dynamic array data structure.
According to one embodiment, the elements field and the metadata field share allocated bits of the cache line allocating a bit of the cache line for the metadata field comprises de-allocating another bit from the elements field.
For example, the dynamic array data structure may be implemented in two or more cache lines of the memory system, wherein the two or more cache lines are contiguous cache lines. A request for an operation on the dynamic array data structure may be indicative of the two or more contiguous cache lines and a location of a first cache line of the two or more cache lines in the memory system.
In another aspect, the invention relates a computer program product comprising computer executable instructions to perform the method steps of the method of any one of the preceding embodiments .
In another aspect, the invention relates to a system for implementing a dynamic array data structure, the system comprising a memory storage and a controller, the system being configured for configuring in the memory storage the cache line as a cache line comprising a metadata field and an elements field, wherein the metadata field comprises metadata of the dynamic array data structure and wherein the elements field comprises a value of each element of the dynamic array data structure; receiving, by the controller, a request for an operation on the dynamic array data structure, wherein the request is indicative of a location of the cache line in the memory and information specifying the request; identifying for - - the operation one or more actions on the dynamic array data structure using the information, wherein the one or more actions are encoded in the controller; and in response to receiving the request, performing the request by executing the one or more encoded actions..
The memory system may be a level in a cache hierarchy, so that the controller performing a request may result in memory system access to lower level (s) in the cache hierarchy to establish the metadata and elements in memory cache. A memory system may be split into two or more parts, where a controller in a part may operate a dynamic array data structure using memory in that part. A cache level may be replicated as two or more units, where the controller may access any part of the underlying cache or memory levels within a cache unit.
A Computer-readable storage medium' as used herein encompasses any tangible storage medium which may store instructions which are executable by a processor of a computing device. The computer-readable storage medium may be referred to as a computer-readable non-transitory storage medium. The computer- readable storage medium may also be referred to as a tangible computer readable medium. In some embodiments, a computer- readable storage medium may also be able to store data which is able to be accessed by the processor of the computing device. Examples of computer-readable storage media include, but are not limited to: a floppy disk, a magnetic hard disk drive, a solid state hard disk, flash memory, a USB thumb drive, Random Access Memory (RAM) , Read Only Memory (ROM) , an optical disk, a magneto-optical disk, and the register file of the processor. Examples of optical disks include Compact Disks (CD) and Digital Versatile Disks (DVD) , for example CD-ROM, CD-RW, CD-R, DVD-ROM, DVD-RW, or DVD-R disks. The term computer readable-storage medium also refers to various types of recording media capable - - of being accessed by the computer device via a network or communication link. For example a data may be retrieved over a modem, over the internet, or over a local area network. Computer executable code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with computer executable code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Computer memory' or 'memory' is an example of a computer- readable storage medium. Computer memory is any memory which is directly accessible to a processor. 'Computer storage' or
'storage' is a further example of a computer-readable storage medium. Computer storage is any non-volatile computer-readable storage medium. In some embodiments computer storage may also be computer memory or vice versa.
A 'processor' as used herein encompasses an electronic component which is able to execute a program or machine executable instruction or computer executable code. References to the computing device comprising "a processor" should be interpreted as possibly containing more than one processor or processing core. The processor may for instance be a multi-core processor. A processor may also refer to a collection of processors within - - a single computer system or distributed amongst multiple computer systems. The term computing device should also be interpreted to possibly refer to a collection or network of computing devices each comprising a processor or processors. The computer executable code may be executed by multiple processors that may be within the same computing device or which may even be distributed across multiple computing devices.
Computer executable code may comprise machine executable instructions or a program which causes a processor to perform an aspect of the present invention. Computer executable code for carrying out operations for 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 "C" programming language or similar programming languages and compiled into machine executable instructions. In some instances the computer executable code may be in the form of a high level language or in a pre-compiled form and be used in conjunction with an interpreter which generates the machine executable instructions on the fly.
The computer executable code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may 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 may be made to an external computer (for example, through the Internet using an Internet Service Provider) . - -
Aspects of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block or a portion of the blocks of the flowchart, illustrations, and/or block diagrams, can be implemented by computer program instructions in form of computer executable code when applicable. It is further under stood that, when not mutually exclusive, combinations of blocks in different flowcharts, illustrations, and/or block diagrams may be combined. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks .
These computer program instructions may also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks .
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable - - apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as an apparatus, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a "circuit," "module" or "system." Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium (s) having computer executable code embodied thereon.
It is understood that one or more of the aforementioned embodiments may be combined as long as the combined embodiments are not mutually exclusive.
Brief description of the drawings
In the following, preferred embodiments of the invention will be described in greater detail by way of example only making reference to the drawings in which:
Fig. 1 illustrates system architecture operable to execute method for implementing a dynamic array data structure in a cache line in a memory;
Fig. 2 illustrates an exemplary block diagram of a memory system;
Fig. 3 shows a diagram illustrating a sequence of operations on a dynamic array data structure; and - -
Fig. 4 is a flowchart of a method for implementing a dynamic array data structure in a cache line in a memory.
Detailed description
In the following, like numbered elements in the figures either designate similar elements or designate elements that perform an equivalent function. Elements which have been discussed previously will not necessarily be discussed in later figures if the function is equivalent.
Fig.l shows a computer system (or server) 112 in computing system 100 is shown in the form of a general-purpose computing device. The components of computer system 112 may include, but are not limited to, one or more processors or processing units 116, a memory system 128, and a bus 118 that couples various system components including memory system 128 to processor 116.
Computer system 112 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer system 112, and it includes both volatile and non-volatile media, removable and non-removable media .
Memory system 128 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and/or cache memory. The memory system may include one or more active buffered memory devices. The active buffered devices may include a plurality of memory elements (e.g., chips) . The active buffered memory device may include layers of memory that form a three dimensional ("3D") memory device where individual columns of chips form vaults in communication with the processing units 116. The active buffered memory device may comprise partitions - - that may be concurrently accessed by a plurality of processing elements, where the partitions may be any suitable memory segment, including but not limited to vaults.
The processing units 116 may issue requests to the memory system, utilizing the dynamic array data structure and associated metadata to implement an application.
Computer system 112 may also communicate with one or more external devices 114 such as a keyboard, a pointing device, a display 124, etc.; one or more devices that enable a user to interact with computer system 112; and/or any devices (e.g., network card, modem, etc.) that enable computer system 112 to communicate with one or more other computing devices. Such communication can occur via I/O interface (s) 122. Still yet, computer system 112 can communicate with one or more networks such as a local area network (LAN) , a general wide area network (WAN), and/or a public network (e.g., the Internet) via network adapter 120. As depicted, network adapter 120 communicates with the other components of computer system/server 112 via bus 118.
Fig. 2 shows in details an exemplary block diagram of the memory system 128. The memory system 128 comprises a controller 206 and storage 208. The storage 208 may be for example any suitable physical memory, such as a cache or random access memory (RAM) .
The controller 206 includes a receiver 214 of a request 210 and a transmitter 216 of a reply 212 configured to communicate with the bus 118, where the receiver 214 and transmitter 216 each include first-in-first-out buffers (FIFOs) . In response to a request 210, the controller 206 performs read and write accesses to the storage 208 and may return a reply 212. - -
The storage 208 comprises one or more cache lines 211. A dynamic array data structure 225 may be implemented in the cache line 211, by, for example, configuring at least part of the cache line 211 for accessing as a dynamic array said at least part of the cache line 211. Such a cache line 211 comprises a metadata field 213 and an elements field 215. For example, the metadata field 213 and the elements field 215 of the dynamic array data structure 225 may be configured within memory storage 208 by a user .
The metadata field 213 comprises metadata of the dynamic array data structure 225. The metadata field 213 may store one or more parameter values of parameters describing, for example, an element size for the dynamic array data structure 225 and the number of elements in the dynamic array data structure 225.
The elements field 215 and the metadata field 213 share allocated bits of the cache line 211. Thus, allocating a bit of the cache line for the metadata field 213 comprises de¬ allocating another bit from the elements field 215.
For example, the size of the metadata field 213 may be controlled by an enable bit that may be allocated in the metadata field 213. The enable bit may be associated with a given parameter, such as, a parameter describing the element size of the dynamic array data structure 225. If the enable bit is set, the parameter value of the given parameter may be stored in the metadata field 213, and thus, increases the size of the metadata field 213.
The described structure of the memory system may provide a single interface for a plurality of users or threads to utilize the dynamic array data structure, for example with a multi- - - threaded application where multiple threads concurrently issue requests, such as request 210, to access the cache line.
The request 210 for an operation on the dynamic array data structure 225 is performed by the controller 206 by executing actions that correspond to said operation request. These actions are encoded in the controller. After performing the request, the controller 206 may update in communication 220, the metadata e.g. the number of elements parameter in the metadata field 213 and update the dynamic array data structure 225 in the elements field 215.
The request 210 from a requester or user is received from the bus 118 by the receiver 214 of the controller 206. The requester may be a thread executing an application e.g. a thread executing an AMO operation. The request 210 is indicative of a location of the cache line in the memory. The metadata 213 of said indicated cache line is read by the controller 206 to determine parameters of the dynamic array data structure 225. These parameters are used by the controller 206 to determine a location in memory storage 208 for a selected element in the dynamic array data structure 225, where the selected element is used by the request 210.
The request 210 may be any suitable request for an operation on the dynamic array data structure 225, such as a push request that allocates an element in the elements fields 215 and stores a value there. The allocated element may be any element of the elements field 215 including an element located in the middle of the dynamic array data structure 225.
An element of the dynamic array data structure 225 may be accessed by the controller 206 in communication 218, where the accessing is based on the operation in request 210. In the - - example where the request 210 is a pop operation request, the value of the selected element read in communication 218 is transmitted by the controller 206 to the user in the reply 212. In an example where the request 210 is a push operation request, then the request 210 provides a value which the controller 206 writes in communication 218 to the selected element.
Fig. 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 may add elements up to occupying all elements of the elements field 215. Each element of the elements field 315.1 marked "X" indicates an empty element storing no element for the dynamic array data structure. The operations may be requested and received by the controller (e.g. 206) of the memory system as concurrent requests .
The metadata field 313.1 of the cache line 311 comprises a subfield 317.1 for storing value indicative of the number of elements in the dynamic array data structure 315.1.
A 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 in the dynamic array data structure 325.1. The controller 206 determines a location of a first element 321 in the dynamic array data structure 325.1 into which the value "A" is to be inserted. For example, the push value operation request may indicate of said first element 321. The controller 206 writes the value "A" in the elements field 315.2 which results in the dynamic array data structure 325.2 with one element. In addition, the controller updates the metadata of the metadata field 313.1 to increase the number of elements value. The controller reads the value 0 of the subfield - -
317.1, increments it by one and writes the incremented value 1 in the subfield 317.2.
A second operation of the sequence 303 pushFirst (B) corresponds to another push value operation for inserting the value "B" in the first element 321 of the dynamic array data structure 325.2. For that, the controller moves the value "A" from the first element 321 to the second element 323 of the elements field
315.2 to free up the first element 321 of the elements field
315.2. Next, the controller writes a value "B" in the first element 321, which results in the dynamic array data structure
325.3 with two elements. In addition, the controller updates the metadata of the metadata field 313.2 to increase the number of elements value. The controller reads the value 1 of the subfield 317.2, increments by one and writes the incremented value 2 in the subfield 317.3.
A third operation of the sequence 305 pushFirst (C) corresponds to a further push value operation for inserting the value "C" in the first element 321 of the dynamic array data structure 325.3. For that, 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 the elements field 315.3. Next, the controller writes the value "C" in the first element 321, which results in the dynamic array data structure 325.4 with three elements. In addition, the controller updates the metadata of the metadata field 313.3 to increase the number of elements value. The controller 206 reads the value 2 of the subfield 317.3, increments it by one and writes the incremented value 3 in the subfield 317.4.
A fourth operation of the sequence 303 pushLast (D) corresponds to another push value operation for inserting the value "D" in a - - last element of the dynamic array data structure 325.4. For that, the controller reads the value 3 of the number of elements stored in the subfield 317.4 to determine the number of elements. Further, the controller determines an element having a location in the elements field 315.4 that corresponds to the read value of the number of elements plus one. Next, the controller writes the value "D" in the element 327, which results in the dynamic array data structure 325.5 with four elements .
In addition, the controller updates the metadata of the metadata field 313.4 to increase the number of elements value. The controller 206 reads the value 3 of the subfield 317.4, increments it by one and writes the incremented value 4 in the subfield 317.5.
A fifth operation of the sequence 309 popFirst() corresponds to a pop operation for reading and deleting a value of the first element of the dynamic array data structure 325.5. The controller reads the value "C" and sends it back to the operation requestor and removes the value "C" from the elements field 315.5. Next, the controller moves the values "B", "A" and "D" from the second, third and fourth element to the first, second and the third element respectively, which results in the dynamic array data structure 325.6 with three elements.
In addition, the controller updates the metadata of the metadata field 313.5 to decrease the number of elements value. The controller reads the value 4 of the subfield 317.5, decrements it by one and writes the decremented value 3 in the subfield 317.6.
Fig. 4 is a flow chart of an exemplary method and system for operating a memory system, such as the memory system shown in FIG. 1 to implement a dynamic array data structure in a cache line e.g. in a single cache line in the memory system. - -
In step 401, the cache line is configured in the memory such that the cache line comprises a metadata field and an elements field. The configuring further includes defining, in the metadata, an element size for the dynamic array data structure the number of elements in the dynamic array data structure. The configuring further includes defining, in the elements field, the value of each element in the dynamic array data structure. The parameters in metadata and the element values in the elements field may be received from a user.
In step 403, a request for an operation on the dynamic array data structure from a user or requestor is received by the controller. The request 210 provides the address location of the cache line for the operation. The requestor issuing the request may be any suitable user, such as a thread running on a processor, a processing element included in a buffered memory stack or a thread communicating over a network via network interface logic.
In step 405, the controller identifies for the operation one or more actions on the dynamic array data structure using the information. The one or more actions are encoded in the controller .
In step 407, the controller executes the one or more actions to perform the request. For example, the request may comprise a pop operation request on the dynamic array data structure, for obtaining a value for a selected element in the dynamic array data structure. In this case, the actions may be executed by the controller as follows: reading the metadata of the metadata field, determining a location in the memory of the selected element, reading the value of the selected element using the location, sending as reply the value of the selected element to - - the requester of the operation, and updating the cache line. The updating of the cache line comprises decrementing 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 .
As shown in the diagram, following step 407, the controller waits to serve the next request 210 and returns to block 403.
The initial configuration step 401 may be performed once during initial configuration, while steps 403 to 407 may be repeated when each request for an operation is served by the controller 206.
- -
List of Reference Numerals
100 computing system
112 server
114 external devices
116 processor
120 network adapter
122 I/O interface
124 display
128 memory system
206 controller
208 memory storage
210 request
211 cache line
212 reply
213 metadata field
214 receiver
215 elements field
216 transmitter
218-220 communication
225 dynamic array data structure
301-309 operations
311 cache line
313 metadata field
315 elements field
317 subfield
321, 323, 324, 327 elements
325 dynamic array data structure
401-407 steps.

Claims

C L A I M S
A method for implementing a dynamic array data structure (225, 325) in a cache line (211, 311) in a memory system (128) that includes a memory storage (208) and a controller (206), the method comprising:
- configuring in the memory storage (208) the cache line (211, 311) as a cache line comprising 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 wherein the elements field (215,315) comprises a value of each element of the dynamic array data structure;
- receiving, by the controller (206), a request (210) for an operation on the dynamic array data structure (225, 325) , wherein the request is indicative of a location of the cache line (211, 311) in the memory storage (208) and information specifying the request (210);
- identifying, by the controller (206) , for the operation 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 controller (206) ; and
- in response to receiving the request (210), performing the request by executing the one or more encoded actions.
The method of claim 1, wherein the configuring further comprises :
- defining, in the metadata, an element size for the dynamic array data structure (225, 325) ;
- defining, in the metadata, the number of elements (317.1) in the dynamic array data structure (225, 325) ; and
- defining, in the elements field (215, 315) , 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 number of elements operation request, the performing of the request comprising performing the one or more actions:
- reading the metadata of the metadata field (213, 313);
- determining the number of elements in the dynamic array data structure (225, 325) ;
- sending as reply to the requester of the operation the determined number of elements.
4. The method of claim 1 or 2, wherein the request comprises a get value operation request on the dynamic array data structure (225, 325) , for obtaining a value for a selected element in the dynamic array data structure (225, 325) , wherein the performing of the request comprises performing the one or more actions:
- reading the metadata of the metadata field (213, 313);
- determining a location in the memory storage (208) of the selected element in the elements field (215,315);
- reading the value of the selected element using the location;
- sending as reply the value of the selected element to the requester of the operation.
5. The method of claim 1 or 2, wherein the request comprises a pop operation request on the dynamic array data structure, for obtaining a value and removing a selected element in the dynamic array data structure (225, 325) , wherein the performing of the request comprises performing the one or more actions:
- reading the metadata of the metadata field (213, 313); - determining a location in the memory of the selected element in the elements field (215,315);
- reading the value of the selected element using the location;
- sending as reply the value of the selected element to the requester of the operation; and
- updating the cache line, the updating comprising decrementing the number of elements in the metadata and moving the elements in the elements field (215, 315) to remove the selected element from the dynamic array data structure (225, 325) .
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 the performing of the request comprises performing 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.
The method of claim 1 or 2, wherein the request comprises a push value operation request, the request providing a value to be inserted in the dynamic array data structure (225, 325) ; wherein the performing of 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, the updating comprising incrementing 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 to the selected element. The method of claim 1 or 2, wherein the request comprises a get minimum value or get maximum value operation request; wherein the performing of the request comprises performing the one or more actions:
- reading the metadata of the metadata field (213, 313);
- determining the locations in the elements field (215,315) for all elements in the dynamic array data structure (225, 325) ;
- reading, using the determined locations, values of all the elements in the dynamic array data structure (225, 325) and identifying the element with the minimum value or the maximum value; and
- sending as reply to the requester of the operation the identified minimum or maximum value.
The method of claim 1 or 2, wherein the request comprises a pop minimum value or pop maximum value operation request; wherein the performing of the request comprises performing the actions of the one or more actions:
- reading the metadata of the metadata field (213, 313);
- determining the locations in the elements field (215,315) for all elements in the dynamic array data structure (225, 325) ;
- reading, using the determined locations, values of all the elements in the dynamic array data structure (225, 325) and identifying the element with the minimum value or the maximum value;
- sending as reply to the requester of the operation the identified minimum or maximum value and updating the cache line, the updating comprising decrementing the number of elements in the metadata and moving the elements in the elements field to remove the identified element from the dynamic array data structure.
10. The method of any of preceding claims, wherein the configuring further comprises defining, in the metadata, a position and size of an instance field in each element of the dynamic array data structure (225, 325) , the request comprising a pop instance request, the method further comprising decrementing an instance field of a selected element, pushing the selected element with the decremented instance field back onto the dynamic array data structure (225, 325) based on a decremented instance being greater than zero.
11. The method of any of preceding claims, wherein the request corresponds to a single load instruction or a single store instruction, wherein the single load or single store instruction comprises an atomic memory operation received and performed by the controller (206) and the single load or single store instruction supports concurrent requests comprising the request.
12. The method of any of the preceding claims, wherein the elements field (215, 315) and the metadata field (213, 313) share allocated bits of the cache line allocating a bit of the cache line for the metadata field comprises de¬ allocating another bit from the elements field.
13. A computer program product comprising computer executable instructions to perform the method steps of the method of any one of the preceding claims.
A system (128) for implementing a dynamic array data structure (225, 325) , the system comprising a memory storage (208) and a controller (206), the system (128) being configured for implementing the dynamic array data structure (225, 325) in a cache line (211, 311) by:
- configuring in the memory storage (208) the cache line (211, 311) as a cache line comprising 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 controller (206), a request (210) for an operation on the dynamic array data structure (225, 325) , wherein the request is indicative of a location of the cache line (211, 311) in the memory and information specifying the request (210);
- identifying for the operation 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 controller (206) ; and
- in response to receiving the request (210), performing the request (210) by executing the one or more encoded actions .
PCT/IB2014/062756 2013-07-11 2014-07-01 Method and system for implementing a dynamic array data structure in a cache line WO2015004570A1 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201480038913.0A CN105359145B (en) 2013-07-11 2014-07-01 The method and system of dynamic array data structure is realized in cache line
DE112014003226.3T DE112014003226T5 (en) 2013-07-11 2014-07-01 Method and system for implementing a dynamic array data structure in a cache line
JP2016524920A JP6333370B2 (en) 2013-07-11 2014-07-01 Method for implementing dynamic array data structures in cache lines
GB1601478.9A GB2530234B (en) 2013-07-11 2014-07-01 Method and system for implementing a dynamic array data structure in a cache line

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
GB1312443.3 2013-07-11
GB1312443.3A GB2516091A (en) 2013-07-11 2013-07-11 Method and system for implementing a dynamic array data structure in a cache line

Publications (1)

Publication Number Publication Date
WO2015004570A1 true WO2015004570A1 (en) 2015-01-15

Family

ID=49081140

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/IB2014/062756 WO2015004570A1 (en) 2013-07-11 2014-07-01 Method and system for implementing a dynamic array data structure in a cache line

Country Status (5)

Country Link
JP (1) JP6333370B2 (en)
CN (1) CN105359145B (en)
DE (1) DE112014003226T5 (en)
GB (2) GB2516091A (en)
WO (1) WO2015004570A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10762000B2 (en) 2017-04-10 2020-09-01 Samsung Electronics Co., Ltd. Techniques to reduce read-modify-write overhead in hybrid DRAM/NAND memory

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003030051A (en) * 2001-07-19 2003-01-31 Sony Corp Data processor and data access method
US20030088737A1 (en) * 2001-11-05 2003-05-08 Lee Burton Bandwidth enhancement for uncached devices
WO2011023679A1 (en) * 2009-08-31 2011-03-03 International Business Machines Corporation Transactional memory system with efficient cache support
US20110219215A1 (en) * 2010-01-15 2011-09-08 International Business Machines Corporation Atomicity: a multi-pronged approach
US20120185672A1 (en) * 2011-01-18 2012-07-19 International Business Machines Corporation Local-only synchronizing operations

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0720087A1 (en) * 1994-12-27 1996-07-03 Motorola, Inc. Apparatus and method for a memory extension stack in a data processing system
US6009499A (en) * 1997-03-31 1999-12-28 Sun Microsystems, Inc Pipelined stack caching circuit
US6138209A (en) * 1997-09-05 2000-10-24 International Business Machines Corporation Data processing system and multi-way set associative cache utilizing class predict data structure and method thereof
US20030005219A1 (en) * 2001-06-29 2003-01-02 Royer Robert J. Partitioning cache metadata state
US7127559B2 (en) * 2001-07-10 2006-10-24 Micron Technology, Inc. Caching of dynamic arrays
US7010645B2 (en) * 2002-12-27 2006-03-07 International Business Machines Corporation System and method for sequentially staging received data to a write cache in advance of storing the received data
US7454572B2 (en) * 2005-11-08 2008-11-18 Mediatek Inc. Stack caching systems and methods with an active swapping mechanism

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003030051A (en) * 2001-07-19 2003-01-31 Sony Corp Data processor and data access method
US20030088737A1 (en) * 2001-11-05 2003-05-08 Lee Burton Bandwidth enhancement for uncached devices
WO2011023679A1 (en) * 2009-08-31 2011-03-03 International Business Machines Corporation Transactional memory system with efficient cache support
US20110219215A1 (en) * 2010-01-15 2011-09-08 International Business Machines Corporation Atomicity: a multi-pronged approach
US20120185672A1 (en) * 2011-01-18 2012-07-19 International Business Machines Corporation Local-only synchronizing operations

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10762000B2 (en) 2017-04-10 2020-09-01 Samsung Electronics Co., Ltd. Techniques to reduce read-modify-write overhead in hybrid DRAM/NAND memory

Also Published As

Publication number Publication date
GB2516091A (en) 2015-01-14
GB201312443D0 (en) 2013-08-28
GB201601478D0 (en) 2016-03-09
JP2016526738A (en) 2016-09-05
CN105359145B (en) 2019-03-22
CN105359145A (en) 2016-02-24
JP6333370B2 (en) 2018-05-30
GB2530234A (en) 2016-03-16
GB2530234B (en) 2020-04-15
DE112014003226T5 (en) 2016-04-28

Similar Documents

Publication Publication Date Title
US9542227B2 (en) Parallel dynamic memory allocation using a lock-free FIFO
CN104572568B (en) Read lock operation method, write lock operation method and system
US20100131720A1 (en) Management of ownership control and data movement in shared-memory systems
US11036635B2 (en) Selecting resources to make available in local queues for processors to use
US8930596B2 (en) Concurrent array-based queue
US8806168B2 (en) Producer-consumer data transfer using piecewise circular queue
US20130198479A1 (en) Parallel dynamic memory allocation using a lock-free pop-only fifo
US10204060B2 (en) Determining memory access categories to use to assign tasks to processor cores to execute
US8412691B2 (en) Maintenance and access of a linked list
US10176101B2 (en) Allocate a segment of a buffer to each of a plurality of threads to use for writing data
CN108733585B (en) Cache system and related method
US9798466B2 (en) Using a plurality of sub-buffers and a free segment list to allocate segments to a plurality of threads to use for writing data
CN103246482A (en) Apparatus and method for memory overlay
AU2011229395B2 (en) Dual mode reader writer lock
US11010091B2 (en) Multi-tier storage
JP6333371B2 (en) Method for implementing bit arrays in cache lines
JP6333370B2 (en) Method for implementing dynamic array data structures in cache lines
US20140317627A1 (en) Scheduling apparatus and method of dynamically setting the size of a rotating register
CN107102898B (en) Memory management and data structure construction method and device based on NUMA (non Uniform memory Access) architecture
CN112068948B (en) Data hashing method, readable storage medium and electronic device
US20120198182A1 (en) Multi-core system and method for processing data in parallel in multi-core system
US20210026825A1 (en) Read iterator for pre-fetching nodes of a b-tree into memory
US20150278260A1 (en) Data set management using transient data structures
US8966220B2 (en) Optimizing large page processing
CN106897278A (en) For the data read-write processing method and equipment of key value database

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201480038913.0

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14823554

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2016524920

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 112014003226

Country of ref document: DE

ENP Entry into the national phase

Ref document number: 1601478

Country of ref document: GB

Kind code of ref document: A

Free format text: PCT FILING DATE = 20140701

122 Ep: pct application non-entry in european phase

Ref document number: 14823554

Country of ref document: EP

Kind code of ref document: A1