WO2018194237A1 - Method and device for processing transaction in hybrid transactional memory system - Google Patents

Method and device for processing transaction in hybrid transactional memory system Download PDF

Info

Publication number
WO2018194237A1
WO2018194237A1 PCT/KR2017/014991 KR2017014991W WO2018194237A1 WO 2018194237 A1 WO2018194237 A1 WO 2018194237A1 KR 2017014991 W KR2017014991 W KR 2017014991W WO 2018194237 A1 WO2018194237 A1 WO 2018194237A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
htm
processing
stm
memory area
Prior art date
Application number
PCT/KR2017/014991
Other languages
French (fr)
Korean (ko)
Inventor
장재우
윤민
신영성
강문환
장연우
마현국
Original Assignee
전북대학교산학협력단
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 전북대학교산학협력단 filed Critical 전북대학교산학협력단
Publication of WO2018194237A1 publication Critical patent/WO2018194237A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • G06F9/467Transactional memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • 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/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements

Definitions

  • the present invention relates to a hybrid transactional memory system (HYBRID TRANSACTIONAL MEMORY SYSTEM) for efficient memory management on an in-memory database in a multi-core environment.
  • the present invention relates to a transaction processing method and a transaction processing apparatus in a hybrid transactional memory system that can efficiently detect a collision between transactions and improve processing performance of a large transaction.
  • Transactional memory is a software transactional memory (STM), hardware transactional memory (HTM), and a hybrid transaction that combines STM and HTM, depending on the processing method. It is classified as a hybrid transactional memory (HyTM).
  • STM can process transactions using compilers and APIs, and can efficiently detect conflict in transactions, but the overhead of writing the address of the memory that reads and writes the threads May have a disadvantage of being large.
  • HTM has been proposed to change the cache and bus protocols of the existing hardware architecture to provide the main functions of the TM to hardware.
  • HTM is a transaction because of hardware limitations such as cache size limitations and context switching with the OS. It may have a problem that it is difficult to cope with the collision between them.
  • Hybrid TM Hybrid TM
  • the existing hybrid TM technique allocates memory when calling 'malloc' by using a memory pool in shared memory through a lock-based memory manager. Accessing the pool can incur lock costs. That is, the more threads that are accessed at the same time, the longer the wait time for the lock becomes, and each thread may have a problem of waiting for memory.
  • FIG. 1 is a diagram illustrating a concurrency control problem in transaction processing in a hybrid TM technique according to a conventional embodiment.
  • STM when STM and HTM are simultaneously performed while both x and y values are initialized to '0', STM ('SW_WRITEBACK' of FIG. 1) may be used. Even if the value of x is changed to 1 in line 2 (line 2), in the HTM ('HW_POST_BEGIN' of FIG. 1), an error may be generated in which an incorrect value is always derived by being processed without changing the value of x.
  • An embodiment of the present invention utilizes HTM and STM technology on an in-memory database in a multi-core environment to simultaneously perform HTM processing and STM processing of a transaction based on a flexible Bloom filter data structure. It aims to increase the processing efficiency of DB transactions.
  • the embodiment of the present invention by controlling the HTM processing and STM processing of the transaction at the same time, while processing prioritized to the HTM processing for a unit time, by using the STM processing results to complement the HTM processing results hybrid transactional memory (Hybrid TM) aims to improve transaction processing performance.
  • Hybrid TM hybrid transactional memory
  • an embodiment of the present invention is to prioritize transactions processed on the HTM to enable processing without the interference of the STM, and maintain a snapshot-based sequence lock (seqlock), the transaction and the processing It aims to perform concurrency control efficiently between transactions processed by STM.
  • an embodiment of the present invention aims to efficiently detect collisions between transactions using a flexible Bloom filter data structure.
  • an embodiment of the present invention is to provide an efficient transaction processing in a multi-core in-memory environment through a memory management tool optimized for each data size.
  • Transaction processing method in a hybrid transactional memory system when the transaction is started from the workload, performing the HTM processing by the hardware transactional memory (HTM), and for the transaction, and Performing STM processing on a software transactional memory (STM) for the transaction.
  • HTM hardware transactional memory
  • STM software transactional memory
  • the transaction processing apparatus in a hybrid transactional memory system when a transaction is started from a workload, performs the HTM processing by the hardware transactional memory (HTM) for the transaction, It includes a transaction processing unit for performing the STM processing by the STM (Software Transactional Memory) for the transaction.
  • HTM hardware transactional memory
  • STM Software Transactional Memory
  • HTM processing and STM processing of a transaction are simultaneously performed simultaneously based on a fluid Bloom filter data structure using HTM and STM technology on an in-memory database in a multi-core environment. By doing so, it is possible to increase the processing efficiency of large-scale DB transactions.
  • transaction processing while simultaneously controlling the HTM processing and STM processing of the transaction, while processing prioritized to the HTM processing for a unit time, by using the STM processing result to complement the HTM processing result hybrid transformer In transactional memory, transaction processing can be improved.
  • HTM processing Concurrency control can be efficiently performed between transactions being processed and transactions being processed by STM.
  • FIG. 1 is a diagram illustrating a concurrency control problem in transaction processing in a hybrid TM technique according to a conventional embodiment.
  • FIG. 2 is a block diagram illustrating a configuration of a transaction processing apparatus in a hybrid transactional memory system according to an embodiment of the present invention.
  • FIG. 3 is a diagram illustrating an overall flow of processing a transaction in a hybrid transactional memory system according to an embodiment of the present invention.
  • FIG. 4 is a diagram illustrating a process of performing concurrency control during transaction processing according to an embodiment of the present invention.
  • FIG. 5 is a view showing the structure of a bloom filter in an embodiment of the present invention.
  • FIG. 6 is a diagram illustrating a flow of performing concurrency control based on a bloom filter according to an embodiment of the present invention.
  • FIG. 7 is a diagram illustrating a memory allocator in accordance with one embodiment of the present invention.
  • FIG. 8 illustrates a structure of a free list of a local cache according to an embodiment of the present invention.
  • FIG. 9 illustrates an example of a small object allocation algorithm for a small object of less than a predetermined size according to an embodiment of the present invention.
  • FIG. 10 is a diagram illustrating a structure of a free list of a central heap according to one embodiment of the present invention.
  • FIG. 11 is a diagram for describing object management using a span according to an embodiment of the present invention.
  • FIG. 12 illustrates an example of a span memory allocation algorithm according to an embodiment of the present invention.
  • FIG. 13 is a flowchart illustrating a procedure of a transaction processing method in a hybrid transactional memory system according to an embodiment of the present invention.
  • FIG. 2 is a block diagram illustrating a configuration of a transaction processing apparatus in a hybrid transactional memory system according to an embodiment of the present invention.
  • a transaction processing apparatus 200 in a hybrid transactional memory system includes a transaction processing unit 210, a memory allocation unit 220, and a concurrency control unit 230. Can be configured.
  • the transaction processing unit 210 When a transaction is started from a workload, the transaction processing unit 210 performs an HTM process by a hardware transactional memory (HTM) on the transaction, and an STM by a software transactional memory (STM) on the transaction. Perform the process.
  • HTM hardware transactional memory
  • STM software transactional memory
  • the transaction processing apparatus 200 of the present invention may be implemented in an application form.
  • the transaction processing unit 210 may simultaneously perform the HTM processing and the STM processing of the transaction when a command for starting the processing of the transaction is input by the workload on the application.
  • the transaction processing unit 210 simultaneously performs HTM processing and STM processing of transactions on the basis of a flexible Bloom filter data structure using HTM and STM technologies on an in-memory database in a multi-core environment. By doing so, it is possible to increase the processing efficiency of large-scale DB transactions.
  • the transaction processing unit 210 may selectively perform STM processing or lock processing for transactions where HTM processing of a transaction is difficult. Through this, the transaction processor 210 may quickly process any transaction regardless of the length of the transaction.
  • the transaction processing unit 210 may be composed of an HTM processing unit 211, an STM processing unit 212, and a lock processing unit 213.
  • the memory allocator 220 allocates a memory area in the HTM and allocates a virtual memory area different from the memory area in the STM.
  • the memory allocating unit 220 allocates a memory area for performing the HTM processing in the HTM, and the HTM processing unit 211 in the transaction processing unit 210 performs the predetermined number of times (the number of retries).
  • the HTM process may be attempted to perform the HTM process in the memory area.
  • the STM processing unit 212 in the transaction processing unit 210 may perform the STM processing on the virtual memory area.
  • the transaction processor 210 may process the transaction through a single global lock.
  • the lock processing unit 213 in the transaction processing unit 210 may perform transaction processing through a single global lock for transactions in which HTM processing and STM processing of a transaction are difficult within a predetermined number of retries (threshold).
  • a global lock global lock
  • the memory allocator 220 may efficiently manage memory by allocating and releasing memory according to an object size associated with a transaction in order to improve transaction processing performance of the transaction processor 210.
  • the memory allocator 220 may determine the allocated memory area or the virtual memory area in consideration of the size of an object associated with the transaction.
  • the memory allocator 220 allocates a memory area in consideration of the size of an object associated with a transaction, and if the transaction is not HTM processed, releases the memory area, and sizes the object. In consideration of this, virtual memory for STM processing may be allocated.
  • the memory allocator 220 may allocate the memory area or the virtual memory area in a local cache or a central cache for each thread in consideration of the size of an object associated with the transaction. Release can be performed.
  • the memory allocator 220 allocates the memory area or the virtual memory area in a central cache when the object is larger than or equal to a predetermined size, and generates a local cache by each thread when the object is smaller than the predetermined size. Allocating the memory area or the virtual memory area in the local cache and performing garbage collection at regular intervals, for the object to which the memory area or the virtual memory area is allocated in the local cache, the central cache The memory region or the virtual memory region within the memory may be reallocated.
  • the memory allocator 220 may allocate and release a memory area for HTM processing or a virtual memory area for STM processing in a central cache when the small object (SO) is smaller than a predetermined size. Can be.
  • SO small object
  • the memory allocation unit 220 is a large object (LO) of a predetermined size or more, in the local cache for each thread (thread) of the memory area for HTM processing or virtual memory area for STM processing Allocates and frees them.
  • LO large object
  • the memory allocator 220 allocates and releases a memory area or a virtual memory area using a memory pool existing in the shared memory, and the small object is small. (SO), it is possible to allocate and free memory areas or virtual memory areas by creating a local cache for each thread for each thread.
  • objects of data can be moved from the local area to the central area if necessary. That is, the memory allocation unit 220 may periodically perform a garbage collection (GC) to move the memory from the local area to the central area.
  • GC garbage collection
  • an efficient transaction processing in a multi-core in-memory environment may be provided through a memory management tool optimized for each data size.
  • the concurrency control unit 230 performs a concurrency manager between the HTM process and the STM process based on a bloom filter.
  • the concurrency control unit 230 may efficiently detect a collision between transactions using a flexible Bloom filter data structure.
  • the concurrency controller 230 controls a HTM process and an STM process of a transaction to be performed simultaneously in time using a Bloom filter having a flexible data structure, thereby allowing in-memory in a multi-core environment. It can improve the processing efficiency of large DB transactions on the database.
  • the concurrency control unit 230 may simultaneously control the HTM processing and the STM processing of the transaction while differentiating the processing priority given to the HTM processing and the STM processing for a unit time, and thus, the HTM processing and the STM processing. Can easily be avoided.
  • the concurrency control unit 230 may give a higher processing priority to the HTM process than the STM process, so that the HTM process is preferentially performed regardless of the STM process.
  • the transaction processing unit 210 may not use the sequence lock maintained for the low processing priority when performing the high processing priority.
  • the concurrency control unit 230 validates the processing having the high processing priority at the time when the processing having the low processing priority is completed among the HTM processing and the STM processing, and the transaction processing unit 210 performs the validation. If the verification fails, the processing with low processing priority may be performed again.
  • the transaction processor 210 maintains a snapshot-based sequence lock for the processing having low processing priority, and if the verification succeeds, increases the sequence lock and then executes the transaction. Can be terminated.
  • Hybrid TM can increase the processing power of transactions.
  • FIG. 3 is a diagram illustrating an overall flow of processing a transaction in a hybrid transactional memory system according to an embodiment of the present invention.
  • the hybrid transactional memory scheme devised in the present invention can be in an environment of 'LiteHTM', 'NorecSTM', and 'Single Lock', and in order to perform this efficiently, a concurrency manager and a memory allocator ) Can be used.
  • a transaction processing apparatus 300 in a hybrid transactional memory system may include an HTM processor 310, an STM processor 320, a single lock processor 330, and a memory. It may be configured to include an allocation unit 340.
  • the HTM processor 310 is a module that manages HTM processing of a transaction and provides a basic HTM processing environment.
  • the HTM processor 310 may operate as 'LiteHTM (RTM)' and may include an HTM executor 311 and a first concurrency controller 312.
  • the HTM processor 310 processes a transaction according to a predetermined number of retries, and when the transaction is aborted within a number of retries or by an unexpected cause, the STM processor 320 may process the transaction as a prepared path. have.
  • the HTM processor 310 may include an HTM processing algorithm that operates when processing a transaction simultaneously with the STM processor 320.
  • the STM processing unit 320 is a module for processing a transaction as an STM, and may be operated as 'NOrec STM' as one example that shows the best performance in the STM.
  • the STM processor 320 may include an STM executor 321 and a second concurrency controller 322.
  • the first concurrency control unit 312 and the second concurrency control unit 322 each use a bloom filter based collision detection algorithm to control collision problems for transactions operating in the HTM and STM environments. can do.
  • the first concurrency control unit 312 and the second concurrency control unit 322 may set an optimal bloom filter value for each workload to maximize the performance of the bloom filter (ie, low storage overhead and low false positive). have.
  • the single lock processing unit 330 processes the transaction through a single global lock.
  • the memory allocator 340 allocates a memory region for the HTM processing or a virtual memory region for the STM processing, and manages optimized memory allocation and release in a multi-core environment.
  • the HTM processor 310 prepares execution through the HTM execution unit 311 (step)
  • the memory allocator 340 may be allocated a necessary memory area (step ).
  • the first concurrency control unit 312 and the second concurrency control unit 322 may perform concurrency control between the HTM process and the STM process when there is a transaction operated in the STM environment while the transaction is being processed in the HTM environment (step ).
  • the HTM processor 310 may attempt to process the HTM of the transaction within a predetermined number of retries in the HTM environment (step ).
  • the HTM processor 310 is a fallback path when the HTM processing of the transaction is not possible within the predetermined retries in the HTM environment, or due to an unexpected cause, the STM processing unit 320 is a fallback path (320)
  • the STM processing of the transaction may be performed by the STM processing unit 320 by moving the transaction to (step) ).
  • the STM processor 320 receives an available memory (virtual memory area) through the memory allocator 340 (step ), The transaction can be processed in the STM environment a certain number of retries (step ).
  • the single lock processing unit 330 may re-transmit the transaction processing through a single global lock (step) ).
  • Most transaction processing is performed by the HTM execution unit 311 and the STM processing unit 320, and may be processed as a single lock only for a transaction that cannot be processed by the hybrid transactional memory.
  • FIG. 4 is a diagram illustrating a process of performing concurrency control during transaction processing according to an embodiment of the present invention.
  • the transaction processing apparatus in the hybrid transactional memory system may assign a transaction processed on the HTM to a higher priority than a transaction processed on the STM.
  • the transaction processing device may be processed without interference from the STM, and the transaction processed on the STM may maintain consistency through a Bloom filter and validation process.
  • the 'NorecSTM' (hereinafter, referred to as an STM processor) in the transaction processing apparatus may perform concurrency control by maintaining a snapshot-based seqlock.
  • STM processor controls 'write' through seqlock on the data, and 'Read' without 'seqlock' in case of 'Read'. Can be controlled.
  • the STM processor may apply a concurrency control technique based on a bloom filter for validation of 'read' / 'write'.
  • the STM processor When performing the transaction 'write', the STM processor is a data structure used for concurrency control with the HTM processor (LiteHTM) and may prevent 'false negative'.
  • HTM HTM processor
  • the STM processing unit may perform validation with a transaction performed through the HTM processing unit at the time when the execution of the transaction is completed.
  • the STM processor may execute the transaction again. If the STM processor returns true, the STM processor may increase the sequence lock by '1' and request the transaction to be terminated.
  • a transaction processing apparatus in a hybrid transactional memory system may manage concurrency control of HTM and STM based on a bloom filter.
  • the bloom filter is a technique devised by Burton Howard Bloom in 1970 and may refer to a stochastic data structure used to check whether an element belongs to a set.
  • a 'false positive' may occur in which an element does not actually belong to a set, but it was determined that the element does not belong to a set. It is not possible to have a 'false negative' in which an element belongs to a set.
  • the transaction processing apparatus of the present invention can manage the concurrency control of the HTM and STM by using such a bloom filter. That is, although it is possible to add elements to the set of the bloom filter, it is impossible to delete elements from the set, and as the number of elements in the set increases, the probability of occurrence of a positive error may increase.
  • FIG. 5 is a view showing the structure of a bloom filter in an embodiment of the present invention.
  • a transaction processing apparatus in a hybrid transactional memory system may perform concurrency control based on a bloom filter.
  • the bloom filter may have a bit array structure having a size of m bits. Also, the bloom filter uses k different hash functions, and each hash function can return one of 0 to m-1 for the input element (see Equation 1).
  • Bloom filters can support instructions for adding elements to a set and instructions for checking whether an element belongs to it. On the other hand, there is no command to delete an element.
  • the bloom filter may calculate k hash values for elements to be added, and then set a bit corresponding to each hash value to 1 (Equation 2).
  • a bloom filter examines an element, it will use all k hash results for element x as the array index for V. If the array values are all 1, it will return 'true' Can be. In this case, if at least one element array value is not 1, the bloom filter may determine that the element is not included in the set and return 'false' (see Equation 3).
  • the transaction processing apparatus of the present invention can increase the transaction processing efficiency by reducing the probability of generating a false positive of the bloom filter by applying Equation 4.
  • Equation 4 'k' may be the number of hash hash functions, 'n' may refer to the size of the set, and 'm' may refer to the bit size of the Bloom filter.
  • FIG. 6 is a diagram illustrating a flow of performing concurrency control based on a bloom filter according to an embodiment of the present invention.
  • a transaction processing apparatus in a hybrid transactional memory system may process a transaction by HTM processing or STM (step 610), and process a transaction processed by STM or HTM. All are written to the bloom filter (step 620).
  • the transaction processing device checks whether the bloom filter has transaction data (step 630).
  • a comparison operation may be performed through a bloom filter to check a transaction in which an operation of a next transaction is performed.
  • step 630 if there are no elements of the transaction data in the bloom filter (i.e., the transaction is not already performed), the data is recorded without waiting for a thread or performing verification (step 640).
  • step 630 determines that a data element exists in the bloom filter (ie, if the transaction has already been performed), then returns true (step 650) and adds thread wait or validation The job records data and executes the transaction (step 660).
  • FIG. 7 is a diagram illustrating a memory allocator in accordance with one embodiment of the present invention.
  • the memory allocator (hereinafter, the memory manager) may allocate and release memory in a thread cache 710 and a central cache 720 according to the size of an object associated with a transaction. Can be done.
  • the central cache 720 may include a central free list 721.
  • the memory manager manages a large pool of large objects (LOs) in a memory pool existing in the central cache (shared memory) 720.
  • the small objects SO may be local to a thread for each thread.
  • Cache 710 may be created and allocated.
  • the memory manager may classify an object having a size greater than or equal to '32 kb 'into a large object LO and an object smaller than '32 kb' into a small object SO.
  • the objects of data are moved from the local area to the central area if necessary, and the memory manager may periodically move the memory from the local area to the central area by performing a garbage collection (GC).
  • GC garbage collection
  • the memory manager can use the LO page-level allocator (pages are 4K aligned memory regions) to allocate memory regions directly to the central page heap 730 without allocating them to local regions.
  • the memory manager allocates large objects LO by the number of pages and sorts them in page order.
  • the memory manager may divide successive pages into a series of small objects each having the same size. For example, the memory manager may divide one page 4K into 32 objects of 128 bytes each.
  • FIG. 8 illustrates a structure of a free list of a local cache according to an embodiment of the present invention.
  • each small object sizes may be mapped to one of approximately 170 assignable size-classes. For example, all allocations in the range 961 to 1024 bytes can be treated as 1024. size-classes can be divided into 8 bytes, 16 bytes, 32 bytes, etc. to distinguish small sizes, and the maximum interval is 256 bytes.
  • the local cache contains a list, and each list can have a list of free objects available for each size class.
  • FIG. 9 illustrates an example of a small object allocation algorithm for a small object of less than a predetermined size according to an embodiment of the present invention.
  • the memory manager maps to a size-class corresponding to the size of an object and looks at a corresponding free list in the thread cache of the current thread.
  • the memory manager removes the first object of the free list and returns the corresponding object and does not acquire any lock in this process. This takes roughly 100 nanoseconds to perform a lock / unlock command on a 2.8 GHz Xeon, which can provide good performance for the speed of memory allocation.
  • the memory manager may obtain an object set from a central heap free list corresponding to the size-class.
  • the central heap free list may be shared among all threads.
  • the memory manager can also place the set of objects in a thread-local free list and return one of the newly imported objects to the application.
  • the memory manager allocates consecutive pages from the central page allocator, divides the object bundles according to size-class, and then adds them to the central heap free list. By placing new objects, you can move some of the objects to a thread-local free list for processing.
  • the memory manager may call an appropriate function by measuring a size for requesting memory allocation and distinguishing between SO and LO.
  • FIG. 10 is a diagram illustrating a structure of a free list of a central heap according to one embodiment of the present invention.
  • a large object LO having a size of 32KB or more may be managed by a central heap after being rounded up to a page size of 4K.
  • the central heap is composed of an array of free lists. For example, a structure consisting of 256 consecutive pages and a page having a length of 256 pages or more may be processed as the remaining free list.
  • the memory manager may allocate a page with reference to the n th free list. If the free list is empty, it is necessary to look at the next free list, and to the last free list. If it fails, if it is taken from system memory and the allocation of n pages satisfies a series of pages longer than n lengths, the rest can be returned to the appropriate free list of page heaps.
  • FIG. 11 is a diagram for describing object management using a span according to an embodiment of the present invention.
  • heap management by the memory manager may be configured as a bundle of pages.
  • a series of contiguous pages is represented by spans, which span memory allocations / releases.
  • the span When the memory is released, the span may be one of the entries of the page heap linked list. When allocating memory, it can be either a large object passed to the application, or a series of pages spanned into consecutive small pages.
  • the size-class of the objects may be recorded in the span.
  • the central array can find the span to which a page belongs and have an index of the page number to be used.
  • the span 'a' may occupy two pages
  • the span 'b' may occupy one page
  • the span 'c' may occupy five pages
  • the span 'd' may occupy three pages.
  • the 32-bit address space fits in 4K pages with 2 20 , so the central arrangement can have 4MB of adequate space.
  • FIG. 12 illustrates an example of a span memory allocation algorithm according to an embodiment of the present invention.
  • the span data structure may consist of a linked list data structure.
  • the memory manager can calculate the page number and search the central heap to find a matching span object.
  • the memory manager can put the object in the appropriate free list in the thread cache of the current thread, and if it exceeds the size expected by the current thread cache (for example, the default value of 2MB), it runs garbage collection and uses it. Can be moved from the thread cache to the central freelists.
  • the memory manager tells you the range of pages that the object occupies. For example, suppose the range of pages is [p, q]. When at least one of the adjacent spans is free, it can be bundled into a [p, q] span. This bound span can then be inserted into the appropriate free list on the page heap.
  • FIG. 13 will be described in detail the workflow of the transaction processing apparatus 200 according to the embodiments of the present invention.
  • FIG. 13 is a flowchart illustrating a procedure of a transaction processing method in a hybrid transactional memory system according to an embodiment of the present invention.
  • the transaction processing method in the hybrid transactional memory system according to the present embodiment may be performed by the transaction processing apparatus 200 described above.
  • step 1310 the transaction processing apparatus 200 confirms whether a transaction starts from a workload. As a result of the confirmation in step 1310, if a transaction is started, in step 1320, the transaction processing apparatus 200 performs HTM processing by the HTM on the transaction, and in step 1330, the transaction The processing device 200 performs STM processing by STM on the transaction. In operation 1340, the transaction processing apparatus 200 performs concurrency control between the HTM processing and the STM processing based on the Bloom filter.
  • the transaction processing apparatus 200 of the present invention may be implemented in the form of an application, and when a command for starting processing of a transaction is input by a workload on the application, the HTM processing and the STM processing of the transaction are simultaneously performed. Can be done.
  • the transaction processing apparatus 200 may allocate a memory area for performing the HTM processing in the HTM and perform the HTM processing in the memory area.
  • the transaction processing apparatus 200 may allocate a virtual memory area different from the memory area in the STM, and perform the STM processing on the virtual memory area.
  • the transaction processing apparatus 200 may consider the size of the object associated with the transaction, and determine the size of the memory area or the virtual memory in a local cache or central cache for each thread. Allocates and frees them.
  • the transaction processing apparatus 200 may manage memory efficiently and improve transaction processing performance by performing memory allocation and release according to the object size associated with a transaction.
  • the transaction processing apparatus 200 simultaneously performs HTM processing and STM processing of transactions on the basis of a flexible Bloom filter data structure using HTM and STM technology on an in-memory database in a multi-core environment. It can improve the processing efficiency of large DB transactions.
  • the transaction processing apparatus 200 controls the HTM processing and the STM processing of the transaction at the same time, and differs from each other in the processing priority given to the HTM processing and the STM processing for a unit time. Collision can be easily avoided.
  • Hybrid TM can increase the processing power of transactions.
  • the method according to an embodiment of the present invention can be implemented in the form of program instructions that can be executed by various computer means and recorded in a computer readable medium.
  • the computer readable medium may include program instructions, data files, data structures, etc. alone or in combination.
  • the program instructions recorded on the media may be those specially designed and constructed for the purposes of the embodiments, or they may be of the kind well-known and available to those having skill in the computer software arts.
  • Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tape, optical media such as CD-ROMs, DVDs, and magnetic disks, such as floppy disks.
  • Examples of program instructions include not only machine code generated by a compiler, but also high-level language code that can be executed by a computer using an interpreter or the like.
  • the hardware device described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

A method and a system for processing a transaction in a hybrid transactional memory system are disclosed. A method for processing a transaction in a hybrid transactional memory system, according to one embodiment of the present invention, comprises the steps of: performing hardware transactional memory (HTM) processing on a transaction by an HTM when the transaction starts from a workload; and performing software transactional memory (STM) processing on the transaction by an STM.

Description

하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 방법 및 트랜잭션 처리 장치Transaction processing method and transaction processing apparatus in hybrid transactional memory system
본 발명은 멀티 코어 환경의 인메모리(In-Memory) 데이터베이스 상에서 효율적인 메모리 관리를 위한 하이브리드 트랜잭셔널 메모리 시스템(HYBRID TRANSACTIONAL MEMORY SYSTEM)에 관한 것으로, 유동적인 블룸 필터 데이터 구조 및 효율적인 메모리 관리자 사용을 통해 트랜잭션 간의 충돌을 효율적으로 감지하고 대용량 트랜잭션의 처리 성능을 향상시킬 수 있는 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 방법 및 트랜잭션 처리 장치에 관한 것이다.The present invention relates to a hybrid transactional memory system (HYBRID TRANSACTIONAL MEMORY SYSTEM) for efficient memory management on an in-memory database in a multi-core environment. The present invention relates to a transaction processing method and a transaction processing apparatus in a hybrid transactional memory system that can efficiently detect a collision between transactions and improve processing performance of a large transaction.
트랜잭션널 메모리(transactional memory: TM)는 처리 방식에 따라, 소프트웨어 트랜잭셔널 메모리(Software Transectional Memory: STM), 하드웨어 트랜잭셔널 메모리(Hardware Transactional Memory: HTM), 그리고 STM과 HTM을 결합한 하이브리드 트랜잭셔널 메모리(Hybrid Transactional Memory; HyTM)로 분류된다.Transactional memory (TM) is a software transactional memory (STM), hardware transactional memory (HTM), and a hybrid transaction that combines STM and HTM, depending on the processing method. It is classified as a hybrid transactional memory (HyTM).
STM은, 컴파일러와 API를 이용하여 트랜잭션을 처리하며 트랜잭션의 충돌 감지를 효율적으로 수행할 수 있지만, 스레드(thread)의 읽기(read) 및 쓰기(write)를 수행한 메모리의 주소를 기록하는 오버헤드가 크다는 단점을 가질 수 있다.STM can process transactions using compilers and APIs, and can efficiently detect conflict in transactions, but the overhead of writing the address of the memory that reads and writes the threads May have a disadvantage of being large.
이에 따라, 기존 하드웨어 아키텍처의 캐시 및 버스 프로토콜을 변경하여 TM의 주요 기능을 하드웨어로 제공하는 HTM이 제안되고 있으나, HTM은 캐시 크기의 한계 등 하드웨어 상의 제약사항 및 OS와의 충돌(context switching) 때문에 트랜잭션 간의 충돌 발생에 대한 대처가 어렵다는 문제점을 가질 수 있다.Accordingly, HTM has been proposed to change the cache and bus protocols of the existing hardware architecture to provide the main functions of the TM to hardware.However, HTM is a transaction because of hardware limitations such as cache size limitations and context switching with the OS. It may have a problem that it is difficult to cope with the collision between them.
이러한 문제점을 해결하기 위해, HTM 및 STM을 동시에 제공하여 HTM이 지니고 있는 단점을 STM으로 극복하려는 하이브리드 TM(Hybrid TM) 기법에 관한 연구가 제안되고 있다.In order to solve this problem, a study on a hybrid TM (Hybrid TM) technique is proposed to overcome the disadvantages of the HTM by providing the HTM and STM at the same time.
하지만, 기존의 하이브리드 TM 기법에서는 HTM과 STM을 동시에 수행하는 경우에, 블룸 필터(Bloom filter)의 데이터 구조가 고정적인 크기를 지니고 있기 때문에 대량의 트랜잭션을 처리 시 부정 오류(false positive)의 발생 확률이 높아지고 성능이 저하될 우려가 있다.However, in the existing hybrid TM technique, when HTM and STM are executed at the same time, since the data structure of the bloom filter has a fixed size, the probability of false positive when processing a large amount of transactions is high. There is a risk of higher performance and lower performance.
또한, 기존의 하이브리드 TM 기법에서는 락(lock) 기반의 메모리 관리자를 통해 공유 메모리에 하나의 메모리 풀을 사용하여 'malloc'의 호출 시 메모리를 할당하고 있으나, 멀티 코어 환경에서는 여러 스레드에서 하나의 메모리 풀에 접근하기 때문에 락 비용이 발생할 수 있다. 즉, 동시에 접근하는 스레드가 많아질수록 락을 기다리는 시간이 커지며, 각 스레드는 메모리를 얻기 위해 대기해야 하는 문제점이 존재할 수 있다.In addition, the existing hybrid TM technique allocates memory when calling 'malloc' by using a memory pool in shared memory through a lock-based memory manager. Accessing the pool can incur lock costs. That is, the more threads that are accessed at the same time, the longer the wait time for the lock becomes, and each thread may have a problem of waiting for memory.
또한, 기존의 하이브리드 TM 기법에서는 STM 및 HTM 환경에서 트랜잭션이 동시에 동작할 경우, 도 1에 도시한 것과 같은 동시성 제어 문제가 발생할 수 있다.In addition, in the existing hybrid TM technique, when transactions operate simultaneously in the STM and HTM environments, concurrency control problems as shown in FIG. 1 may occur.
도 1은 종래의 일실시예에 따른 하이브리드 TM 기법에 있어서, 트랜잭션 처리 시의 동시성 제어 문제를 나타내는 도면이다.1 is a diagram illustrating a concurrency control problem in transaction processing in a hybrid TM technique according to a conventional embodiment.
도 1을 참조하면, 종래의 일실시예에 따른 하이브리드 TM 기법에 따르면, x 및 y의 값을 모두 '0'으로 초기화 한 상태에서 STM과 HTM을 동시에 수행 시, STM(도 1의 'SW_WRITEBACK')에서 x의 값이 1로 변화되는 경우에도(line 2), HTM(도 1의 'HW_POST_BEGIN')에서는 x의 값이 변화되지 않은 상태에서 처리되어 항상 잘못된 값이 도출되는 오류가 생길 수 있다.Referring to FIG. 1, according to the conventional hybrid TM scheme, when STM and HTM are simultaneously performed while both x and y values are initialized to '0', STM ('SW_WRITEBACK' of FIG. 1) may be used. Even if the value of x is changed to 1 in line 2 (line 2), in the HTM ('HW_POST_BEGIN' of FIG. 1), an error may be generated in which an incorrect value is always derived by being processed without changing the value of x.
또한, 종래의 일실시예에 따른 하이브리드 TM 기법에 따르면, HTM으로 처리되는 트랜잭션은 STM으로 처리되는 경우 보다 항상 빠른 결과를 도출하게 되므로, HTM의 비일관성으로 인한 트랜잭션 처리 효율의 문제점을 야기할 수 있다.In addition, according to the conventional hybrid TM technique, a transaction processed by HTM always leads to faster results than when processed by STM, which may cause a problem of transaction processing efficiency due to inconsistency of HTM. have.
본 발명의 실시예는 멀티 코어 환경의 인메모리(In-Memory) 데이터베이스 상에서 HTM 및 STM 기술을 활용하여 유동적인 블룸 필터 데이터 구조를 기반으로 트랜잭션의 HTM 처리와 STM 처리를 시간적으로 동시에 수행 함으로써, 대규모 DB 트랜잭션의 처리 효율을 높이는 것을 목적으로 한다.An embodiment of the present invention utilizes HTM and STM technology on an in-memory database in a multi-core environment to simultaneously perform HTM processing and STM processing of a transaction based on a flexible Bloom filter data structure. It aims to increase the processing efficiency of DB transactions.
또한, 본 발명의 실시예는 트랜잭션의 HTM 처리와 STM 처리를 동시 제어하면서도, 단위 시간 동안 HTM 처리에 우선순위를 두어 처리함으로써, STM 처리 결과를 이용하여 HTM 처리 결과를 보완하여 하이브리드 트랜잭셔널 메모리(Hybrid TM)에서 트랜잭션의 처리 성능을 보다 높이는 것을 목적으로 한다.In addition, the embodiment of the present invention by controlling the HTM processing and STM processing of the transaction at the same time, while processing prioritized to the HTM processing for a unit time, by using the STM processing results to complement the HTM processing results hybrid transactional memory (Hybrid TM) aims to improve transaction processing performance.
또한, 본 발명의 실시예는 HTM 상에서 처리되는 트랜잭션에 대해 우선 순위를 높게 책정하여 STM의 간섭을 받지 않고 처리 가능하게 하고, 스냅샷 기반의 시퀀스 락(seqlock)을 유지하여, HTM 처리되는 트랜잭션과 STM 처리되는 트랜잭션 간에 효율적으로 동시성 제어를 수행하는 것을 목적으로 한다.In addition, an embodiment of the present invention is to prioritize transactions processed on the HTM to enable processing without the interference of the STM, and maintain a snapshot-based sequence lock (seqlock), the transaction and the processing It aims to perform concurrency control efficiently between transactions processed by STM.
또한, 본 발명의 실시예는 유동적인 블룸 필터 데이터 구조를 사용하여 트랜잭션 간의 충돌을 효율적으로 감지하는 것을 목적으로 한다.In addition, an embodiment of the present invention aims to efficiently detect collisions between transactions using a flexible Bloom filter data structure.
또한, 본 발명의 실시예는 데이터 사이즈 별로 최적화된 메모리 관리 도구를 통해, 멀티 코어 인메모리 환경에서의 효율적인 트랜잭션 처리를 제공하는 것을 목적으로 한다.In addition, an embodiment of the present invention is to provide an efficient transaction processing in a multi-core in-memory environment through a memory management tool optimized for each data size.
본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 방법은, 워크로드로부터 트랜잭션이 시작되면, 상기 트랜잭션에 대해, HTM(Hardware Transactional Memory)에 의한 HTM 처리를 수행하는 단계, 및 상기 트랜잭션에 대해, STM(Software Transactional Memory)에 의한 STM 처리를 수행하는 단계를 포함한다.Transaction processing method in a hybrid transactional memory system according to an embodiment of the present invention, when the transaction is started from the workload, performing the HTM processing by the hardware transactional memory (HTM), and for the transaction, and Performing STM processing on a software transactional memory (STM) for the transaction.
또한, 본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 장치는, 워크로드로부터 트랜잭션이 시작되면, 상기 트랜잭션에 대해, HTM(Hardware Transactional Memory)에 의한 HTM 처리를 수행하고, 상기 트랜잭션에 대해, STM(Software Transactional Memory)에 의한 STM 처리를 수행하는 트랜잭션 처리부를 포함한다.In addition, the transaction processing apparatus in a hybrid transactional memory system according to an embodiment of the present invention, when a transaction is started from a workload, performs the HTM processing by the hardware transactional memory (HTM) for the transaction, It includes a transaction processing unit for performing the STM processing by the STM (Software Transactional Memory) for the transaction.
본 발명의 일실시예에 따르면, 멀티 코어 환경의 인메모리(In-Memory) 데이터베이스 상에서 HTM 및 STM 기술을 활용하여 유동적인 블룸 필터 데이터 구조를 기반으로 트랜잭션의 HTM 처리와 STM 처리를 시간적으로 동시에 수행 함으로써, 대규모 DB 트랜잭션의 처리 효율을 높일 수 있다.According to an embodiment of the present invention, HTM processing and STM processing of a transaction are simultaneously performed simultaneously based on a fluid Bloom filter data structure using HTM and STM technology on an in-memory database in a multi-core environment. By doing so, it is possible to increase the processing efficiency of large-scale DB transactions.
또한, 본 발명의 일실시예에 따르면, 트랜잭션의 HTM 처리와 STM 처리를 동시 제어하면서도, 단위 시간 동안 HTM 처리에 우선순위를 두어 처리함으로써, STM 처리 결과를 이용하여 HTM 처리 결과를 보완하여 하이브리드 트랜잭셔널 메모리(Hybrid TM)에서 트랜잭션의 처리 성능을 보다 높일 수 있다.In addition, according to an embodiment of the present invention, while simultaneously controlling the HTM processing and STM processing of the transaction, while processing prioritized to the HTM processing for a unit time, by using the STM processing result to complement the HTM processing result hybrid transformer In transactional memory, transaction processing can be improved.
또한, 본 발명의 일실시예에 따르면, HTM 상에서 처리되는 트랜잭션에 대해 우선 순위를 높게 책정하여 STM의 간섭을 받지 않고 처리 가능하게 하고, 스냅샷 기반의 시퀀스 락(seqlock)을 유지하여, HTM 처리되는 트랜잭션과 STM 처리되는 트랜잭션 간에 효율적으로 동시성 제어를 수행할 수 있다.In addition, according to an embodiment of the present invention, by prioritizing the transactions processed on the HTM to enable processing without the interference of the STM, maintaining a snapshot-based sequence lock (seqlock), HTM processing Concurrency control can be efficiently performed between transactions being processed and transactions being processed by STM.
또한, 본 발명의 일실시예에 따르면, 유동적인 블룸 필터 데이터 구조를 사용하여 트랜잭션 간의 충돌을 효율적으로 감지할 수 있다.In addition, according to an embodiment of the present invention, it is possible to efficiently detect a collision between transactions using a flexible Bloom filter data structure.
또한, 본 발명의 일실시예에 따르면, 데이터 사이즈 별로 최적화된 메모리 관리 도구를 통해, 멀티 코어 인메모리 환경에서의 효율적인 트랜잭션 처리를 제공할 수 있다.In addition, according to an embodiment of the present invention, through a memory management tool optimized for each data size, it is possible to provide efficient transaction processing in a multi-core in-memory environment.
도 1은 종래의 일실시예에 따른 하이브리드 TM 기법에 있어서, 트랜잭션 처리 시의 동시성 제어 문제를 나타내는 도면이다.1 is a diagram illustrating a concurrency control problem in transaction processing in a hybrid TM technique according to a conventional embodiment.
도 2는 본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 장치의 구성을 도시한 블록도이다.2 is a block diagram illustrating a configuration of a transaction processing apparatus in a hybrid transactional memory system according to an embodiment of the present invention.
도 3은 본 발명의 일실시예에 있어서, 하이브리드 트랜잭셔널 메모리 시스템에서 트랜잭션을 처리하는 전체적인 흐름을 도시한 도면이다.3 is a diagram illustrating an overall flow of processing a transaction in a hybrid transactional memory system according to an embodiment of the present invention.
도 4는 본 발명의 일실시예에 있어서, 트랜잭션 처리 시 동시성 제어를 수행하는 과정을 도시한 도면이다.4 is a diagram illustrating a process of performing concurrency control during transaction processing according to an embodiment of the present invention.
도 5는 본 발명의 일실시예에 있어서, 블룸 필터의 구조를 도시한 도면이다.5 is a view showing the structure of a bloom filter in an embodiment of the present invention.
도 6은 본 발명의 일실시예에 있어서, 블룸 필터를 기반으로 동시성 제어를 수행하는 흐름을 도시한 도면이다.FIG. 6 is a diagram illustrating a flow of performing concurrency control based on a bloom filter according to an embodiment of the present invention.
도 7은 본 발명의 일실시예에 있어서, 메모리 할당부를 도시한 도면이다.7 is a diagram illustrating a memory allocator in accordance with one embodiment of the present invention.
도 8은 본 발명의 일실시예에 있어서, 로컬 캐시(Local cache)의 프리 리스트(free list)의 구조를 도시한 도면이다.8 illustrates a structure of a free list of a local cache according to an embodiment of the present invention.
도 9는 본 발명의 일실시예에 있어서, 일정 크기 미만의 스몰 오브젝트에 대한 메모리 할당(Small Object allocation) 알고리즘의 일례를 도시한 도면이다.FIG. 9 illustrates an example of a small object allocation algorithm for a small object of less than a predetermined size according to an embodiment of the present invention.
도 10은 본 발명의 일실시예에 있어서, 중앙 힙(Central heap)의 프리 리스트(free list)의 구조를 도시한 도면이다.FIG. 10 is a diagram illustrating a structure of a free list of a central heap according to one embodiment of the present invention.
도 11은 본 발명의 일실시예에 있어서, 스팬(span)을 이용한 오브젝트 관리를 설명하기 위한 도면이다.FIG. 11 is a diagram for describing object management using a span according to an embodiment of the present invention.
도 12는 본 발명의 일실시예에 있어서, 스팬 메모리 할당(Span allocation) 알고리즘의 일례를 도시한 도면이다.12 illustrates an example of a span memory allocation algorithm according to an embodiment of the present invention.
도 13은 본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 방법의 순서를 도시한 흐름도이다.13 is a flowchart illustrating a procedure of a transaction processing method in a hybrid transactional memory system according to an embodiment of the present invention.
이하, 첨부된 도면들을 참조하여 본 발명의 일실시예에 따른 응용프로그램 업데이트 장치 및 방법에 대해 상세히 설명한다. 그러나, 본 발명이 실시예들에 의해 제한되거나 한정되는 것은 아니다. 각 도면에 제시된 동일한 참조 부호는 동일한 부재를 나타낸다.Hereinafter, an apparatus and method for updating an application program according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings. However, the present invention is not limited or limited by the embodiments. Like reference numerals in the drawings denote like elements.
도 2는 본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 장치의 구성을 도시한 블록도이다.2 is a block diagram illustrating a configuration of a transaction processing apparatus in a hybrid transactional memory system according to an embodiment of the present invention.
도 2를 참조하면, 본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 장치(200)는, 트랜잭션 처리부(210), 메모리 할당부(220) 및 동시성 제어부(230)를 포함하여 구성될 수 있다.2, a transaction processing apparatus 200 in a hybrid transactional memory system according to an embodiment of the present invention includes a transaction processing unit 210, a memory allocation unit 220, and a concurrency control unit 230. Can be configured.
트랜잭션 처리부(210)는 워크로드(Workload)로부터 트랜잭션이 시작되면, 상기 트랜잭션에 대해, HTM(Hardware Transactional Memory)에 의한 HTM 처리를 수행하고, 상기 트랜잭션에 대해, STM(Software Transactional Memory)에 의한 STM 처리를 수행한다.When a transaction is started from a workload, the transaction processing unit 210 performs an HTM process by a hardware transactional memory (HTM) on the transaction, and an STM by a software transactional memory (STM) on the transaction. Perform the process.
일례로, 본 발명의 트랜잭션 처리 장치(200)는 어플리케이션 형태로 구현될 수 있다. 트랜잭션 처리부(210)는 트랜잭션의 처리 개시에 관한 명령이 어플리케이션 상에서 워크로드(Workload)에 의해 입력되면, 트랜잭션의 HTM 처리 및 STM 처리를 동시에 수행할 수 있다.For example, the transaction processing apparatus 200 of the present invention may be implemented in an application form. The transaction processing unit 210 may simultaneously perform the HTM processing and the STM processing of the transaction when a command for starting the processing of the transaction is input by the workload on the application.
이를 통해, 트랜잭션 처리부(210)는 멀티 코어 환경의 인메모리(In-Memory) 데이터베이스 상에서 HTM 및 STM 기술을 활용하여 유동적인 블룸 필터 데이터 구조를 기반으로 트랜잭션의 HTM 처리와 STM 처리를 시간적으로 동시에 수행 함으로써, 대규모 DB 트랜잭션의 처리 효율을 높일 수 있다.Through this, the transaction processing unit 210 simultaneously performs HTM processing and STM processing of transactions on the basis of a flexible Bloom filter data structure using HTM and STM technologies on an in-memory database in a multi-core environment. By doing so, it is possible to increase the processing efficiency of large-scale DB transactions.
다른 일례로, 트랜잭션 처리부(210)는 트랜잭션의 HTM 처리가 어려운 트랙잭션에 대해 선택적으로 STM 처리 또는 락(lock) 처리를 수행할 수 있다. 이를 통해, 트랜잭션 처리부(210)는 트랜잭션의 길이와 상관없이 어떠한 트랜잭션이든 빠르게 처리할 수 있다.As another example, the transaction processing unit 210 may selectively perform STM processing or lock processing for transactions where HTM processing of a transaction is difficult. Through this, the transaction processor 210 may quickly process any transaction regardless of the length of the transaction.
구체적으로, 트랜잭션 처리부(210)는 HTM 처리부(211), STM 처리부(212) 및 락 처리부(213)로 구성될 수 있다.In detail, the transaction processing unit 210 may be composed of an HTM processing unit 211, an STM processing unit 212, and a lock processing unit 213.
메모리 할당부(220)는 상기 HTM 내에 메모리 영역을 할당하고, 상기 STM 내에, 상기 메모리 영역과 상이한 가상메모리 영역을 할당한다.The memory allocator 220 allocates a memory area in the HTM and allocates a virtual memory area different from the memory area in the STM.
일례로, 메모리 할당부(220)는 상기 HTM 내에, 상기 HTM 처리를 수행하기 위한 메모리 영역을 할당하고, 트랜잭션 처리부(210) 내 HTM 처리부(211)는, 정해진 횟수(재시도 횟수)에 걸쳐 상기 HTM 처리의 수행을 시도하여, 상기 메모리 영역에서, 상기 HTM 처리를 수행할 수 있다.For example, the memory allocating unit 220 allocates a memory area for performing the HTM processing in the HTM, and the HTM processing unit 211 in the transaction processing unit 210 performs the predetermined number of times (the number of retries). The HTM process may be attempted to perform the HTM process in the memory area.
이때, 트랜잭션 처리부(210) 내 STM 처리부(212)는 상기 횟수 이내에서, 상기 HTM 처리가 수행되지 않는 경우, 상기 가상메모리 영역 상에서, 상기 STM 처리를 수행할 수 있다.In this case, when the HTM processing is not performed within the number of times, the STM processing unit 212 in the transaction processing unit 210 may perform the STM processing on the virtual memory area.
일례로, 트랜잭션 처리부(210)는 상기 HTM 처리와 상기 STM 처리가 수행되지 않는 경우, 싱글 글로벌 락(single global lock)을 통해, 상기 트랜잭션을 처리할 수 있다.For example, when the HTM process and the STM process are not performed, the transaction processor 210 may process the transaction through a single global lock.
즉, 트랜잭션 처리부(210) 내 락 처리부(213)는 각각 정해진 재시도 횟수(임계치) 내에 트랜잭션의 HTM 처리 및 STM 처리가 어려운 트랙잭션에 대해, 싱글 글로벌 락을 통한 트랜잭션 처리를 수행할 수 있다. 참고로, 글로벌 락(전역 잠금)은 모든 노드에 예컨대 일관적인 파일 시스템 보기가 제공되도록 하는 역할을 할 수 있다.That is, the lock processing unit 213 in the transaction processing unit 210 may perform transaction processing through a single global lock for transactions in which HTM processing and STM processing of a transaction are difficult within a predetermined number of retries (threshold). For reference, a global lock (global lock) can serve to ensure that all nodes are provided with a consistent file system view, for example.
메모리 할당부(220)는 트랜잭션 처리부(210)에서의 트랜잭션 처리 성능 향상을 위해 트랜잭션과 연관되는 오브젝트 사이즈에 맞춰 메모리 할당과 해제를 수행 함으로써, 메모리를 효율적으로 관리할 수 있다.The memory allocator 220 may efficiently manage memory by allocating and releasing memory according to an object size associated with a transaction in order to improve transaction processing performance of the transaction processor 210.
일례로, 메모리 할당부(220)는 상기 트랜잭션과 연관되는 오브젝트의 크기를 고려하여, 할당된 상기 메모리 영역 또는 상기 가상메모리 영역을 결정할 수 있다.For example, the memory allocator 220 may determine the allocated memory area or the virtual memory area in consideration of the size of an object associated with the transaction.
예를 들어, 메모리 할당부(220)는 트랜잭션과 연관되는 오브젝트의 크기를 고려하여, 메모리 영역을 할당하고, 상기 트랜잭션이 HTM 처리되지 않는 경우, 상기 메모리 영역의 할당을 해제하고, 상기 오브젝트의 크기를 고려하여 STM 처리를 위한 가상 메모리를 할당할 수 있다.For example, the memory allocator 220 allocates a memory area in consideration of the size of an object associated with a transaction, and if the transaction is not HTM processed, releases the memory area, and sizes the object. In consideration of this, virtual memory for STM processing may be allocated.
메모리 할당부(220)는 상기 트랜잭션과 연관되는 오브젝트의 크기를 고려하여, 스레드(thread) 별 로컬 캐시(local cache) 또는 중앙 캐시(central cache) 내에서 상기 메모리 영역 또는 상기 가상메모리 영역의 할당 및 해제를 수행할 수 있다.The memory allocator 220 may allocate the memory area or the virtual memory area in a local cache or a central cache for each thread in consideration of the size of an object associated with the transaction. Release can be performed.
구체적으로, 메모리 할당부(220)는 상기 오브젝트가 일정 크기 이상이면, 중앙 캐시에서 상기 메모리 영역 또는 상기 가상메모리 영역을 할당하고, 상기 오브젝트가 일정 크기 미만이면, 스레드 각각으로 로컬 캐시를 생성하고, 상기 로컬 캐시에서 상기 메모리 영역 또는 상기 가상메모리 영역을 할당하고, 일정 주기로 가비지 콜렉션(Garbage Collection)을 수행하여, 상기 로컬 캐시에서 상기 메모리 영역 또는 상기 가상메모리 영역이 할당된 오브젝트에 대해, 상기 중앙 캐시 내의 상기 메모리 영역 또는 상기 가상메모리 영역을 재할당할 수 있다.Specifically, the memory allocator 220 allocates the memory area or the virtual memory area in a central cache when the object is larger than or equal to a predetermined size, and generates a local cache by each thread when the object is smaller than the predetermined size. Allocating the memory area or the virtual memory area in the local cache and performing garbage collection at regular intervals, for the object to which the memory area or the virtual memory area is allocated in the local cache, the central cache The memory region or the virtual memory region within the memory may be reallocated.
예를 들어, 메모리 할당부(220)는 일정 크기 미만의 스몰 오브젝트(Small Object, SO)인 경우, 중앙 캐시에서 HTM 처리를 위한 메모리 영역 또는 STM 처리를 위한 가상메모리 영역의 할당과 해제를 수행할 수 있다.For example, the memory allocator 220 may allocate and release a memory area for HTM processing or a virtual memory area for STM processing in a central cache when the small object (SO) is smaller than a predetermined size. Can be.
또한, 메모리 할당부(220)는 일정 크기 이상의 라지 오브젝트(Large Object, LO)인 경우, 스레드(thread) 별 로컬 캐시(local cache)에서 HTM 처리를 위한 메모리 영역 또는 STM 처리를 위한 가상메모리 영역의 할당과 해제를 수행할 수 있다.In addition, the memory allocation unit 220 is a large object (LO) of a predetermined size or more, in the local cache for each thread (thread) of the memory area for HTM processing or virtual memory area for STM processing Allocates and frees them.
즉, 메모리 할당부(220)는 사이즈가 큰 라지 오브젝트(LO)인 경우, 공유 메모리에 존재하는 메모리 풀을 이용하여, 메모리 영역 또는 가상메모리 영역의 할당과 해제를 수행하고, 사이즈가 작은 스몰 오브젝트(SO)인 경우, 스레드 별로 스레드가 사용할 로컬 캐시를 만들어서 메모리 영역 또는 가상메모리 영역의 할당과 해제를 수행할 수 있다.That is, when the large object LO has a large size, the memory allocator 220 allocates and releases a memory area or a virtual memory area using a memory pool existing in the shared memory, and the small object is small. (SO), it is possible to allocate and free memory areas or virtual memory areas by creating a local cache for each thread for each thread.
이때, 로컬 캐시의 영역은 작게 할당되어 각 스레드에서 지역적으로 동작할 수 있으므로, 효과적으로 트랜잭션의 동시성 제어가 수행될 수 있다.At this time, since the area of the local cache is small and can operate locally in each thread, the concurrency control of the transaction can be effectively performed.
또한, 데이터의 오브젝트들은 필요한 경우 로컬 영역에서 중앙 영역으로 이동할 수 있다. 즉, 메모리 할당부(220)는 주기적으로 GC(Garbage Collection)를 수행하여 로컬 영역에서 중앙 영역으로 메모리가 이동되도록 할 수 있다.Also, objects of data can be moved from the local area to the central area if necessary. That is, the memory allocation unit 220 may periodically perform a garbage collection (GC) to move the memory from the local area to the central area.
이와 같이, 본 발명의 일실시예에 따르면, 데이터 사이즈 별로 최적화된 메모리 관리 도구를 통해, 멀티 코어 인메모리 환경에서의 효율적인 트랜잭션 처리를 제공할 수 있다.As such, according to an embodiment of the present invention, an efficient transaction processing in a multi-core in-memory environment may be provided through a memory management tool optimized for each data size.
동시성 제어부(230)는 블룸 필터(Bloom filter)를 기반으로, 상기 HTM 처리와, 상기 STM 처리 간에, 동시성 제어(Concurrency Manager)를 수행한다.The concurrency control unit 230 performs a concurrency manager between the HTM process and the STM process based on a bloom filter.
일례로, 동시성 제어부(230)는 유동적인 블룸 필터 데이터 구조를 사용하여 트랜잭션 간의 충돌을 효율적으로 감지할 수 있다.In one example, the concurrency control unit 230 may efficiently detect a collision between transactions using a flexible Bloom filter data structure.
또한, 동시성 제어부(230)는 유동적인 데이터 구조를 가지는 블룸 필터(Bloom filter)를 사용하여 트랜잭션의 HTM 처리와 STM 처리가 시간적으로 동시에 수행되도록 제어 함으로써, 멀티 코어 환경의 인메모리(In-Memory) 데이터베이스 상에서 대규모 DB 트랜잭션의 처리 효율을 높일 수 있다.In addition, the concurrency controller 230 controls a HTM process and an STM process of a transaction to be performed simultaneously in time using a Bloom filter having a flexible data structure, thereby allowing in-memory in a multi-core environment. It can improve the processing efficiency of large DB transactions on the database.
다른 일례로, 동시성 제어부(230)는 트랜잭션의 HTM 처리와 STM 처리를 동시 제어하면서도, 단위 시간 동안 HTM 처리와 STM 처리에 부여되는 처리 우선순위를 서로 상이하게 함으로써, 상기 HTM 처리와 상기 STM 처리와의 충돌을 용이하게 회피할 수 있다.In another example, the concurrency control unit 230 may simultaneously control the HTM processing and the STM processing of the transaction while differentiating the processing priority given to the HTM processing and the STM processing for a unit time, and thus, the HTM processing and the STM processing. Can easily be avoided.
구체적으로, 동시성 제어부(230)는 상기 HTM 처리에 대해, 상기 STM 처리 보다 높은 처리 우선순위를 부여하여, 상기 STM 처리와 무관하게, 상기 HTM 처리가 우선하여 수행되도록 할 수 있다. 이때, 트랜잭션 처리부(210)는 상기 처리 우선순위가 높은 처리를 수행 시, 상기 처리 우선순위가 낮은 처리에 대해 유지된, 시퀀스 락을 이용하지 않도록 할 수 있다.Specifically, the concurrency control unit 230 may give a higher processing priority to the HTM process than the STM process, so that the HTM process is preferentially performed regardless of the STM process. In this case, the transaction processing unit 210 may not use the sequence lock maintained for the low processing priority when performing the high processing priority.
이를 통해, 본 발명에 의하면, HTM 상에서 처리되는 트랜잭션에 대해 우선 순위를 높게 책정하여 STM의 간섭을 받지 않고 처리 가능하게 할 수 있고, 스냅샷 기반의 시퀀스 락(seqlock)을 유지하여, HTM 처리되는 트랜잭션과 STM 처리되는 트랜잭션 간에 효율적으로 동시성 제어를 수행할 수 있다.Through this, according to the present invention, it is possible to set a high priority for the transactions processed on the HTM to be processed without interference of the STM, to maintain a snapshot-based sequence lock (seqlock), HTM is processed Concurrency control can be efficiently performed between transactions and transactions processed by STM.
또한, 동시성 제어부(230)는 상기 HTM 처리 및 상기 STM 처리 중에서, 처리 우선순위가 낮은 처리가 수행 완료되는 시점에, 처리 우선순위가 높은 처리에 대해 검증(validation)하고, 트랜잭션 처리부(210)는 상기 검증이 실패하면, 상기 처리 우선순위가 낮은 처리를 재수행할 수 있다.In addition, the concurrency control unit 230 validates the processing having the high processing priority at the time when the processing having the low processing priority is completed among the HTM processing and the STM processing, and the transaction processing unit 210 performs the validation. If the verification fails, the processing with low processing priority may be performed again.
트랜잭션 처리부(210)는 상기 검증하는 동안, 상기 처리 우선순위가 낮은 처리에 대해, 스냅샷 기반의 시퀀스 락(seqlock)을 유지하고, 상기 검증이 성공하면, 상기 시퀀스 락을 증가시킨 후, 상기 트랜잭션을 종료할 수 있다.During the verification, the transaction processor 210 maintains a snapshot-based sequence lock for the processing having low processing priority, and if the verification succeeds, increases the sequence lock and then executes the transaction. Can be terminated.
이와 같이, 본 발명에 의하면, 트랜잭션의 HTM 처리와 STM 처리를 동시 제어하면서도, 단위 시간 동안 HTM 처리에 우선순위를 두어 처리함으로써, STM 처리 결과를 이용하여 HTM 처리 결과를 보완하여 하이브리드 트랜잭셔널 메모리(Hybrid TM)에서 트랜잭션의 처리 성능을 보다 높일 수 있다.As described above, according to the present invention, while simultaneously controlling the HTM processing and the STM processing of a transaction, the processing is prioritized to the HTM processing for a unit time, thereby complementing the HTM processing result by using the STM processing result, thereby providing a hybrid transactional memory. (Hybrid TM) can increase the processing power of transactions.
도 3은 본 발명의 일실시예에 있어서, 하이브리드 트랜잭셔널 메모리 시스템에서 트랜잭션을 처리하는 전체적인 흐름을 도시한 도면이다.3 is a diagram illustrating an overall flow of processing a transaction in a hybrid transactional memory system according to an embodiment of the present invention.
본 발명에서 고안하는 하이브리드 트랜잭셔널 메모리 기법은 'LiteHTM', 'NorecSTM', 'Single Lock'의 환경에서 될 수 있으며, 이를 효율적으로 수행하기 위해 동시성 제어부(Concurrency Manager) 및 메모리 할당부(Memory Allocator)를 이용할 수 있다.The hybrid transactional memory scheme devised in the present invention can be in an environment of 'LiteHTM', 'NorecSTM', and 'Single Lock', and in order to perform this efficiently, a concurrency manager and a memory allocator ) Can be used.
도 3을 참조하면, 본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 장치(300)는, HTM 처리부(310), STM 처리부(320), 싱글 락 처리부(330) 및 메모리 할당부(340)를 포함하여 구성될 수 있다.Referring to FIG. 3, a transaction processing apparatus 300 in a hybrid transactional memory system according to an embodiment of the present invention may include an HTM processor 310, an STM processor 320, a single lock processor 330, and a memory. It may be configured to include an allocation unit 340.
HTM 처리부(310)는 트랜잭션의 HTM 처리를 관리하는 모듈로서, 기본적인 HTM 처리 환경을 제공한다.The HTM processor 310 is a module that manages HTM processing of a transaction and provides a basic HTM processing environment.
일례로, HTM 처리부(310)는 'LiteHTM(RTM)'로 작동될 수 있으며, HTM 실행부(HTM executor)(311) 및 제1 동시성 제어부(312)를 포함하여 구성될 수 있다.For example, the HTM processor 310 may operate as 'LiteHTM (RTM)' and may include an HTM executor 311 and a first concurrency controller 312.
HTM 처리부(310)는 일정 재시도 횟수에 따라 트랜잭션을 처리하며, 재시도 횟수 이내에 혹은 예기치 못한 원인에 의해 트랜잭션이 중단(abort)되는 경우, 대비 경로로서 STM 처리부(320)에서 트랜잭션을 처리할 수 있다.The HTM processor 310 processes a transaction according to a predetermined number of retries, and when the transaction is aborted within a number of retries or by an unexpected cause, the STM processor 320 may process the transaction as a prepared path. have.
또한, HTM 처리부(310)는 STM 처리부(320)와 동시에 트랜잭션을 처리할 때 동작하는 HTM 처리 알고리즘을 포함할 수 있다.In addition, the HTM processor 310 may include an HTM processing algorithm that operates when processing a transaction simultaneously with the STM processor 320.
STM 처리부(320)는 트랜잭션을 STM으로 처리하기 위한 모듈로서, STM에서 가장 좋은 성능을 보이는 일례로 'NOrec STM'으로 작동될 수 있다.The STM processing unit 320 is a module for processing a transaction as an STM, and may be operated as 'NOrec STM' as one example that shows the best performance in the STM.
STM 처리부(320)는 STM 실행부(STM executor)(321) 및 제2 동시성 제어부(322)를 포함하여 구성될 수 있다.The STM processor 320 may include an STM executor 321 and a second concurrency controller 322.
제1 동시성 제어부(312) 및 제2 동시성 제어부(322)는 각각, 블룸 필터(bloom filter) 기반의 충돌 탐지 알고리즘을 사용하여, HTM 및 STM 환경에서 동작하는 트랜잭션에 대한 충돌 문제를 제어하는 역할을 할 수 있다.The first concurrency control unit 312 and the second concurrency control unit 322 each use a bloom filter based collision detection algorithm to control collision problems for transactions operating in the HTM and STM environments. can do.
이를 위해, 제1 동시성 제어부(312) 및 제2 동시성 제어부(322)는 각각 블룸 필터의 성능(즉, low storage overhead 및 low false positive)을 극대화 하기 위해 워크로드 마다 최적의 블룸 필터 값을 설정할 수 있다. To this end, the first concurrency control unit 312 and the second concurrency control unit 322 may set an optimal bloom filter value for each workload to maximize the performance of the bloom filter (ie, low storage overhead and low false positive). have.
싱글 락 처리부(330)는 상기 HTM 처리와 상기 STM 처리가 수행되지 않는 경우, 싱글 글로벌 락(single global lock)을 통해, 상기 트랜잭션을 처리하는 역할을 한다.When the HTM process and the STM process are not performed, the single lock processing unit 330 processes the transaction through a single global lock.
메모리 할당부(340)는 상기 HTM 처리를 위한 메모리 영역 또는 상기 STM 처리를 위한 가상메모리 영역을 할당하는 역할을 하며, 멀티 코어 환경에서의 최적화된 메모리 할당과 해제를 관리할 수 있다.The memory allocator 340 allocates a memory region for the HTM processing or a virtual memory region for the STM processing, and manages optimized memory allocation and release in a multi-core environment.
도 3에 도시된 것처럼, HTM 처리부(310)는 워크로드로부터 트랜잭션이 시작되면, HTM 실행부(311)를 통해 실행을 준비하고(단계
Figure PCTKR2017014991-appb-I000001
), 메모리 할당부(340)를 통해 필요한 메모리 영역을 할당 받을 수 있다(단계
Figure PCTKR2017014991-appb-I000002
).
As shown in FIG. 3, when the transaction is started from the workload, the HTM processor 310 prepares execution through the HTM execution unit 311 (step)
Figure PCTKR2017014991-appb-I000001
The memory allocator 340 may be allocated a necessary memory area (step
Figure PCTKR2017014991-appb-I000002
).
제1 동시성 제어부(312) 및 제2 동시성 제어부(322)는 HTM 환경에서 트랜잭션이 처리되는 중에 STM 환경에서 동작되는 트랜잭션이 존재할 경우, HTM 처리와 STM 처리 간에 동시성 제어를 수행할 수 있다(단계
Figure PCTKR2017014991-appb-I000003
).
The first concurrency control unit 312 and the second concurrency control unit 322 may perform concurrency control between the HTM process and the STM process when there is a transaction operated in the STM environment while the transaction is being processed in the HTM environment (step
Figure PCTKR2017014991-appb-I000003
).
HTM 처리부(310)는 HTM 환경에서 일정 재시도 횟수 이내에 트랜잭션의 HTM 처리를 시도할 수 있다(단계
Figure PCTKR2017014991-appb-I000004
).
The HTM processor 310 may attempt to process the HTM of the transaction within a predetermined number of retries in the HTM environment (step
Figure PCTKR2017014991-appb-I000004
).
HTM 처리부(310)는 HTM 환경에서 일정 재시도 횟수 이내에 트랜잭션의 HTM 처리가 불가능하거나, 혹은 예기치 못한 원인이 발생하여 HTM 환경에서 처리할 수 없는 경우, 대비 경로(fallback path)인 STM 처리부(320)로 트랜잭션을 이동하여 STM 처리부(320)에서 트랜잭션의 STM 처리가 수행될 수 있다(단계
Figure PCTKR2017014991-appb-I000005
).
The HTM processor 310 is a fallback path when the HTM processing of the transaction is not possible within the predetermined retries in the HTM environment, or due to an unexpected cause, the STM processing unit 320 is a fallback path (320) The STM processing of the transaction may be performed by the STM processing unit 320 by moving the transaction to (step)
Figure PCTKR2017014991-appb-I000005
).
STM 처리부(320)는 메모리 할당부(340)를 통해 가용 메모리(가상메모리 영역)을 할당 받고(단계
Figure PCTKR2017014991-appb-I000006
), 일정 재시도 횟수 만큼 STM 환경에서 트랜잭션을 처리할 수 있다(단계
Figure PCTKR2017014991-appb-I000007
).
The STM processor 320 receives an available memory (virtual memory area) through the memory allocator 340 (step
Figure PCTKR2017014991-appb-I000006
), The transaction can be processed in the STM environment a certain number of retries (step
Figure PCTKR2017014991-appb-I000007
).
이때, STM 환경에서도 처리할 수 없는 트랜잭션인 경우, 싱글 락 처리부(330)는 싱글 글로벌 락을 통해 트랜잭션 처리를 재수행할 수 있다(단계
Figure PCTKR2017014991-appb-I000008
).
At this time, in the case of a transaction that cannot be processed even in the STM environment, the single lock processing unit 330 may re-transmit the transaction processing through a single global lock (step)
Figure PCTKR2017014991-appb-I000008
).
대부분의 트랜잭션 처리는 HTM 실행부(311) 및 STM 처리부(320)에서 이루어지며, 하이브리드 트랜잭션 메모리로 처리할 수 없는 트랜잭션에 한하여 싱글 락(single lock)으로 처리될 수 있다.Most transaction processing is performed by the HTM execution unit 311 and the STM processing unit 320, and may be processed as a single lock only for a transaction that cannot be processed by the hybrid transactional memory.
도 4는 본 발명의 일실시예에 있어서, 트랜잭션 처리 시 동시성 제어를 수행하는 과정을 도시한 도면이다.4 is a diagram illustrating a process of performing concurrency control during transaction processing according to an embodiment of the present invention.
본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 장치는, HTM 상에서 처리되는 트랜잭션에 대해, STM 상에서 처리되는 트랜잭션 보다 우선 순위를 높게 책정하여 처리할 수 있다.The transaction processing apparatus in the hybrid transactional memory system according to an embodiment of the present invention may assign a transaction processed on the HTM to a higher priority than a transaction processed on the STM.
다시 말해, 트랜잭션 처리 장치는 HTM 상에서 트랜잭션을 처리할 경우 STM의 간섭을 받지 않고 처리할 수 있으며, STM 상에서 처리되는 트랜잭션은 블룸 필터 및 검증(validation) 과정을 거쳐 일관성을 유지할 수 있다.In other words, when a transaction processing device processes a transaction on the HTM, the transaction processing device may be processed without interference from the STM, and the transaction processed on the STM may maintain consistency through a Bloom filter and validation process.
도 4를 참조하면, 트랜잭션 처리 장치 내 'NorecSTM'(이하, STM 처리부)은, 스냅샷 기반의 seqlock을 유지하여 동시성 제어를 수행할 수 있다. 즉, STM 처리부는 데이터에 대한 '쓰기(Write)'를 수행할 경우, 해당 데이터에 대한 seqlock을 통해 '쓰기'를 제어하고, '읽기(Read)'의 경우에는 seqlock을 사용하지 않고 '읽기'를 제어할 수 있다.Referring to FIG. 4, the 'NorecSTM' (hereinafter, referred to as an STM processor) in the transaction processing apparatus may perform concurrency control by maintaining a snapshot-based seqlock. In other words, when performing 'Write' on data, STM processor controls 'write' through seqlock on the data, and 'Read' without 'seqlock' in case of 'Read'. Can be controlled.
또한, STM 처리부는, '읽기'/'쓰기'에 대한 검증(validation)을 위해 블룸 필터 기반으로 동시성 제어 기술을 적용할 수 있다.In addition, the STM processor may apply a concurrency control technique based on a bloom filter for validation of 'read' / 'write'.
STM 처리부는 트랜잭션 '쓰기'를 수행할 경우, HTM 처리부(LiteHTM)와의 동시성 제어를 위해 사용되는 데이터 구조로서 부정 오류('false negative')를 방지할 수 있다.When performing the transaction 'write', the STM processor is a data structure used for concurrency control with the HTM processor (LiteHTM) and may prevent 'false negative'.
STM 처리부는 트랜잭션의 수행이 완료되는 시점에 HTM 처리부를 통해 수행된 트랜잭션과의 검증(validation)을 수행할 수 있다.The STM processing unit may perform validation with a transaction performed through the HTM processing unit at the time when the execution of the transaction is completed.
STM 처리부는 상기 검증 결과 거짓(false)이 반환되면, 트랜잭션을 재수행하고, 참(true)이 반환되면 시퀀스 락(seqlock)을 '1'만큼 증가시키고 트랜잭션 종료(commit)를 요청할 수 있다.If a false result is returned, the STM processor may execute the transaction again. If the STM processor returns true, the STM processor may increase the sequence lock by '1' and request the transaction to be terminated.
본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 장치는, 블룸 필터를 기반으로 HTM 및 STM의 동시성 제어를 관리할 수 있다.A transaction processing apparatus in a hybrid transactional memory system according to an embodiment of the present invention may manage concurrency control of HTM and STM based on a bloom filter.
여기서, 블룸 필터(Bloom filter)는 1970년 Burton Howard Bloom에 의해 고안된 기법으로서, 원소가 집합에 속하는지 여부를 검사하는데 사용되는 확률적 자료 구조를 지칭할 수 있다.Here, the bloom filter is a technique devised by Burton Howard Bloom in 1970 and may refer to a stochastic data structure used to check whether an element belongs to a set.
구체적으로, 블룸 필터에서는 어떤 원소가 집합에 속하는 것으로 판단되더라도, 실제로는 원소가 집합에 속하지 않는 '긍정 오류(false positive)'가 발생할 수는 있으나, 원소가 집합에 속하지 않는 것으로 판단되었는데, 실제로는 원소가 집합에 속하는 '부정 오류(false negative)'가 발생하는 것은 불가능하다.Specifically, in the bloom filter, even though it is determined that an element belongs to a set, a 'false positive' may occur in which an element does not actually belong to a set, but it was determined that the element does not belong to a set. It is not possible to have a 'false negative' in which an element belongs to a set.
본 발명의 트랜잭션 처리 장치는, 이러한 블룸 필터를 이용하여, HTM 및 STM의 동시성 제어를 관리할 수 있다. 즉, 블룸 필터의 집합에 원소를 추가하는 것은 가능하지만, 집합에서 원소를 삭제하는 것은 불가능하며, 집합 내 원소의 숫자가 증가할수록 긍정 오류 발생 확률도 증가할 수 있다.The transaction processing apparatus of the present invention can manage the concurrency control of the HTM and STM by using such a bloom filter. That is, although it is possible to add elements to the set of the bloom filter, it is impossible to delete elements from the set, and as the number of elements in the set increases, the probability of occurrence of a positive error may increase.
도 5는 본 발명의 일실시예에 있어서, 블룸 필터의 구조를 도시한 도면이다.5 is a view showing the structure of a bloom filter in an embodiment of the present invention.
도 5를 참조하면, 본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 장치는, 블룸 필터 기반으로 동시성 제어를 수행할 수 있다.Referring to FIG. 5, a transaction processing apparatus in a hybrid transactional memory system according to an embodiment of the present invention may perform concurrency control based on a bloom filter.
블룸 필터는 m비트 크기의 비트 배열 구조를 가질 수 있다. 또한, 블룸 필터에서는 k개의 서로 다른 해쉬 함수를 사용하며, 각 해쉬 함수는 입력된 원소에 대해 0에서 m-1 중 하나를 반환할 수 있다(수학식 1 참조).The bloom filter may have a bit array structure having a size of m bits. Also, the bloom filter uses k different hash functions, and each hash function can return one of 0 to m-1 for the input element (see Equation 1).
Figure PCTKR2017014991-appb-I000009
Figure PCTKR2017014991-appb-I000009
블룸 필터는 집합에 원소를 추가하는 명령어 및 원소가 속하는지를 검사하는 명령어를 지원할 수 있다. 한편, 원소를 삭제하는 명령어는 존재하지 않는다.Bloom filters can support instructions for adding elements to a set and instructions for checking whether an element belongs to it. On the other hand, there is no command to delete an element.
블룸 필터는 원소를 추가하는 경우, 추가하려는 원소에 대해 k개의 해쉬 값을 계산한 다음, 각 해쉬 값에 대응하는 비트를 1로 설정할 수 있다(수학식 2).When adding a element, the bloom filter may calculate k hash values for elements to be added, and then set a bit corresponding to each hash value to 1 (Equation 2).
Figure PCTKR2017014991-appb-I000010
Figure PCTKR2017014991-appb-I000010
또한, 블룸 필터는 원소를 검사하는 경우, 원소 x에 대해 k개의 모든 해쉬 결과를 V에 대한 배열 인덱스로 사용하여, 해당 배열 값이 모두 1이면 해당 집합의 원소로 가정하여 'true'를 반환할 수 있다. 이때, 블룸 필터는 단 하나라도 원소 배열 값이 1이 아니면, 집합에 포함된 원소가 아니라고 판단하여 'false'를 반환할 수 있다(수학식 3 참조).Also, if a bloom filter examines an element, it will use all k hash results for element x as the array index for V. If the array values are all 1, it will return 'true' Can be. In this case, if at least one element array value is not 1, the bloom filter may determine that the element is not included in the set and return 'false' (see Equation 3).
Figure PCTKR2017014991-appb-I000011
Figure PCTKR2017014991-appb-I000011
본 발명의 트랜잭션 처리 장치는, 수학식 4를 적용하여 블룸 필터의 긍정 오류(false positive)가 발생되는 확률을 줄임으로써 트랜잭션 처리 효율을 증대할 수 있다. 수학식 4에서 'k'는 해쉬 hash function의 개수이고, 'n'은 집합의 크기, 'm'은 블룸 필터의 bit 사이즈를 지칭할 수 있다.The transaction processing apparatus of the present invention can increase the transaction processing efficiency by reducing the probability of generating a false positive of the bloom filter by applying Equation 4. In Equation 4, 'k' may be the number of hash hash functions, 'n' may refer to the size of the set, and 'm' may refer to the bit size of the Bloom filter.
Figure PCTKR2017014991-appb-I000012
Figure PCTKR2017014991-appb-I000012
도 6은 본 발명의 일실시예에 있어서, 블룸 필터를 기반으로 동시성 제어를 수행하는 흐름을 도시한 도면이다.FIG. 6 is a diagram illustrating a flow of performing concurrency control based on a bloom filter according to an embodiment of the present invention.
도 6을 참조하면, 본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 장치는, 트랜잭션을 HTM 처리 또는 STM 처리하고(단계(610)), STM 혹은 HTM에서 처리되는 트랜잭션을 모두 블룸 필터에 기록한다(단계(620)).Referring to FIG. 6, a transaction processing apparatus in a hybrid transactional memory system according to an embodiment of the present invention may process a transaction by HTM processing or STM (step 610), and process a transaction processed by STM or HTM. All are written to the bloom filter (step 620).
이후, 트랜잭션 처리 장치는 블룸 필터가 트랜잭션 데이터를 가지는지 확인한다(단계(630)). 본 단계(630)에서는, 블룸 필터를 통해 비교 연산을 수행하여, 다음 트랜잭션의 연산(operation)이 기 수행된 트랜잭션을 검사하도록 할 수 있다.The transaction processing device then checks whether the bloom filter has transaction data (step 630). In operation 630, a comparison operation may be performed through a bloom filter to check a transaction in which an operation of a next transaction is performed.
단계(630)에서의 확인 결과, 블룸 필터에 트랜잭션 데이터의 원소가 존재하지 않는다면(즉, 해당 트랜잭션이 기 수행된 것이 아니면), 스레드 대기 혹은 검증을 수행하지 않고 데이터를 기록한다(단계 640).As a result of the checking in step 630, if there are no elements of the transaction data in the bloom filter (i.e., the transaction is not already performed), the data is recorded without waiting for a thread or performing verification (step 640).
또는, 단계(630)에서의 확인 결과, 블룸 필터에 데이터 원소가 존재한다고 판단되면(즉, 해당 트랜잭션이 기 수행된 것이면), 'true'를 반환하고(단계 650), 스레드 대기 혹은 검증의 추가 작업을 통해 데이터를 기록하고, 트랜잭션을 실행한다(단계 660).Or, if the check in step 630 determines that a data element exists in the bloom filter (ie, if the transaction has already been performed), then returns true (step 650) and adds thread wait or validation The job records data and executes the transaction (step 660).
도 7은 본 발명의 일실시예에 있어서, 메모리 할당부를 도시한 도면이다.7 is a diagram illustrating a memory allocator in accordance with one embodiment of the present invention.
도 7을 참조하면, 메모리 할당부(이하, 메모리 관리자)는, 트랜잭션과 연관된 오브젝트의 크기에 따라 스레드 캐시(thread cache)(710) 및 중앙 캐시(central cache)(720)에서 메모리 할당 및 해제를 수행할 수 있다. 여기서, 중앙 캐시(720)는 중앙 프리 리스트(Central Free list)(721)를 포함할 수 있다.Referring to FIG. 7, the memory allocator (hereinafter, the memory manager) may allocate and release memory in a thread cache 710 and a central cache 720 according to the size of an object associated with a transaction. Can be done. Here, the central cache 720 may include a central free list 721.
일례로, 메모리 관리자는, 사이즈가 큰 라지 오브젝트(LO)인 경우 중앙 캐시(공유 메모리)(720)에 존재하는 메모리 풀에서 관리하고, 사이즈가 작은 스몰 오브젝트(SO)는 스레드 별로 스레드가 사용할 로컬 캐시(710)를 만들어서 할당할 수 있다.For example, the memory manager manages a large pool of large objects (LOs) in a memory pool existing in the central cache (shared memory) 720. The small objects SO may be local to a thread for each thread. Cache 710 may be created and allocated.
예를 들어, 메모리 관리자는 사이즈가 '32kb' 이상인 오브젝트를 라지 오브젝트(LO), 사이즈가 '32kb' 미만인 오브젝트를 스몰 오브젝트(SO)로 구분할 수 있다.For example, the memory manager may classify an object having a size greater than or equal to '32 kb 'into a large object LO and an object smaller than '32 kb' into a small object SO.
로컬 캐시(710)의 영역은 작게 할당되어 각 스레드에서 지역적으로 동작하기 때문에, 효과적으로 트랜잭션의 동시성 제어가 수행될 수 있다.Since the area of the local cache 710 is allocated small and operates locally in each thread, concurrency control of transactions can be effectively performed.
데이터의 오브젝트들은 필요한 경우 로컬 영역에서 중앙 영역으로 이동하며, 메모리 관리자는, 주기적으로 GC(Garbage Collection)를 수행하여 로컬 영역에서 중앙 영역으로 메모리를 이동할 수 있다.The objects of data are moved from the local area to the central area if necessary, and the memory manager may periodically move the memory from the local area to the central area by performing a garbage collection (GC).
메모리 관리자는 LO page-level allocator(페이지는 4K로 정렬된 메모리 구역)를 사용하여 로컬 영역에 할당하지 않고 중앙 페이지 힙(central page heap)(730)에 메모리 영역을 직접 할당할 수 있다.The memory manager can use the LO page-level allocator (pages are 4K aligned memory regions) to allocate memory regions directly to the central page heap 730 without allocating them to local regions.
메모리 관리자는 라지 오브젝트(LO)를 페이지의 수만큼 할당하고, 페이지 순으로 정렬할 수 있다. 이때, 메모리 관리자는 연속된 페이지들을 각각 같은 크기를 가진 일련의 작은 오브젝트들로 나눌 수 있다. 예를 들어, 메모리 관리자는 하나의 페이지(4K)를 각각, 128바이트 크기의 32개의 오브젝트로 나눌 수 있다.The memory manager allocates large objects LO by the number of pages and sorts them in page order. In this case, the memory manager may divide successive pages into a series of small objects each having the same size. For example, the memory manager may divide one page 4K into 32 objects of 128 bytes each.
도 8은 본 발명의 일실시예에 있어서, 로컬 캐시(Local cache)의 프리 리스트(free list)의 구조를 도시한 도면이다.8 illustrates a structure of a free list of a local cache according to an embodiment of the present invention.
도 8을 참조하면, 각각의 스몰 오브젝트 크기들은 대략적으로 170개의 할당 가능한 size-class 중 하나에 매핑될 수 있다. 예를 들면, 961에서 1024바이트의 범위에 있는 모든 할당들은 1024로 처리될 수 있다. size-class들은 8바이트, 16바이트, 32바이트 등으로 간격을 두어 작은 크기들을 구분할 수 있으며, 최대 간격은 256바이트이다. 로컬 캐시는 하나의 리스트를 포함하며, 각 리스트는 각 size class 별로 사용할 수 있는 프리 오브젝트(free object)들의 리스트를 가질 수 있다.Referring to FIG. 8, each small object sizes may be mapped to one of approximately 170 assignable size-classes. For example, all allocations in the range 961 to 1024 bytes can be treated as 1024. size-classes can be divided into 8 bytes, 16 bytes, 32 bytes, etc. to distinguish small sizes, and the maximum interval is 256 bytes. The local cache contains a list, and each list can have a list of free objects available for each size class.
도 9는 본 발명의 일실시예에 있어서, 일정 크기 미만의 스몰 오브젝트에 대한 메모리 할당(Small Object allocation) 알고리즘의 일례를 도시한 도면이다.FIG. 9 illustrates an example of a small object allocation algorithm for a small object of less than a predetermined size according to an embodiment of the present invention.
도 9를 참조하면, 메모리 관리자는 오브젝트의 크기에 대응하는 size-class에 매핑하고, 현재 스레드의 스레드 캐시 안에서 대응하는 프리 리스트(free list)를 살펴본다.Referring to FIG. 9, the memory manager maps to a size-class corresponding to the size of an object and looks at a corresponding free list in the thread cache of the current thread.
이때, 스몰 오브젝트(SO)의 프리 리스트가 비어있지 않으면, 메모리 관리자는 프리 리스트의 처음 오브젝트를 제거하고 해당 오브젝트를 반환하며 이러한 과정에서 어떠한 락(lock)도 획득하지 않는다. 이는 2.8 GHz Xeon에서 락(lock)/언락(unlock)의 명령을 수행하는 데에 대략 100nanosec가 걸리므로 메모리 할당의 속도에 대해 좋은 성능을 나타낼 수 있다.At this time, if the free list of the small objects SO is not empty, the memory manager removes the first object of the free list and returns the corresponding object and does not acquire any lock in this process. This takes roughly 100 nanoseconds to perform a lock / unlock command on a 2.8 GHz Xeon, which can provide good performance for the speed of memory allocation.
또는, 스몰 오브젝트(SO)의 프리 리스트가 비어있을 경우, 메모리 관리자는 size-class에 해당하는 중앙 힙 프리 리스트(central heap free list)에서 오브젝트 셋을 가져올 수 있다. 이때, 중앙 힙 프리 리스트는 모든 스레드에 공유될 수 있다. 또한, 메모리 관리자는 해당 오브젝트 셋을 스레드-로컬 프리 리스트(thread-local free list)에 배치하며, 새로 가져온 오브젝트 중 하나를 응용프로그램으로 반환할 수 있다.Alternatively, when the free list of small objects SO is empty, the memory manager may obtain an object set from a central heap free list corresponding to the size-class. In this case, the central heap free list may be shared among all threads. The memory manager can also place the set of objects in a thread-local free list and return one of the newly imported objects to the application.
또한, 라지 오브젝트(LO)의 프리 리스트(free list)가 비어있을 경우, 메모리 관리자는 중앙 페이지 할당자로부터 연속된 페이지들을 할당하고, 오브젝트 묶음을 size-class에 맞게 나눈 후, 중앙 힙 프리 리스트에 새 오브젝트들을 배치하여, 스레드-로컬 프리 리스트로 오브젝트들 중 일부를 이동하여 처리할 수 있다.Also, if the free list of a large object (LO) is empty, the memory manager allocates consecutive pages from the central page allocator, divides the object bundles according to size-class, and then adds them to the central heap free list. By placing new objects, you can move some of the objects to a thread-local free list for processing.
메모리 관리자는 도 9에 도시된 스몰 오브젝트 메모리 할당 알고리즘에서와 같이, 메모리 할당을 요청하는 사이즈를 측정하여 SO 및 LO를 구분 함으로써 적절한 함수를 호출할 수 있다.As in the small object memory allocation algorithm illustrated in FIG. 9, the memory manager may call an appropriate function by measuring a size for requesting memory allocation and distinguishing between SO and LO.
도 10은 본 발명의 일실시예에 있어서, 중앙 힙(Central heap)의 프리 리스트(free list)의 구조를 도시한 도면이다.FIG. 10 is a diagram illustrating a structure of a free list of a central heap according to one embodiment of the present invention.
도 10을 참조하면, 사이즈가 32KB 이상인 라지 오브젝트(LO)는 4K의 페이지 사이즈에 맞추어 올림 처리된 후 중앙 힙(central heap)에 의해 관리될 수 있다.Referring to FIG. 10, a large object LO having a size of 32KB or more may be managed by a central heap after being rounded up to a page size of 4K.
여기서, 중앙 힙은 프리 리스트들의 배열로 이루어지며, 일례로, 256개의 연속된 페이지로 구조를 이루고, 256페이지 이상의 길이를 가지는 페이지는 나머지의 프리 리스트로 처리될 수 있다.Here, the central heap is composed of an array of free lists. For example, a structure consisting of 256 consecutive pages and a page having a length of 256 pages or more may be processed as the remaining free list.
메모리 관리자는 n번째 프리 리스트를 참조하여 페이지를 할당할 수 있다. 만약 프리 리스트가 비어있다면, 다음 프리 리스트를 살펴보는 것이 필요하며, 마지막 프리 리스트까지 살펴볼 수 있다. 만약 실패하면, 시스템 메모리에서 가져오고, n페이지의 할당이 n의 길이보다 긴 일련의 페이지들을 충족하면, 나머지는 페이지 힙의 적합한 프리 리스트로 반환될 수 있다.The memory manager may allocate a page with reference to the n th free list. If the free list is empty, it is necessary to look at the next free list, and to the last free list. If it fails, if it is taken from system memory and the allocation of n pages satisfies a series of pages longer than n lengths, the rest can be returned to the appropriate free list of page heaps.
도 11은 본 발명의 일실시예에 있어서, 스팬(span)을 이용한 오브젝트 관리를 설명하기 위한 도면이다.FIG. 11 is a diagram for describing object management using a span according to an embodiment of the present invention.
도 11을 참조하면, 본 발명에서 메모리 관리자에 의한 힙 관리는 페이지의 묶음으로 구성될 수 있다. 일련의 연속된 페이지는 스팬(span)으로 표현되며, 스팬은 메모리 할당/해제가 가능하다. Referring to FIG. 11, in the present invention, heap management by the memory manager may be configured as a bundle of pages. A series of contiguous pages is represented by spans, which span memory allocations / releases.
메모리 해제를 수행할 경우, 스팬(span)은 페이지 힙 연결 리스트의 엔트리 중 하나일 수 있다. 메모리 할당 시, 응용프로그램에 건네진 라지 오브젝트이거나 연속된 작은 페이지로 나누어진 일련의 페이지가 스팬일 수 있다.When the memory is released, the span may be one of the entries of the page heap linked list. When allocating memory, it can be either a large object passed to the application, or a series of pages spanned into consecutive small pages.
라지 오브젝트로 나뉘었을 경우, 오브젝트들의 size-class가 스팬에 기록될 수 있다. 중앙 배열은 어떤 페이지가 속한 스팬을 찾고, 쓰일 페이지 넘버의 인덱스를 가질 수 있다. When divided into large objects, the size-class of the objects may be recorded in the span. The central array can find the span to which a page belongs and have an index of the page number to be used.
도 11을 예로 들면, 스팬 'a'는 2페이지를 차지하며, 스팬 'b'는 1페이지를 차지하고, 스팬 'c'는 5페이지, 스팬 'd'는 3페이지를 차지할 수 있다.For example, the span 'a' may occupy two pages, the span 'b' may occupy one page, the span 'c' may occupy five pages, and the span 'd' may occupy three pages.
32비트 주소 공간은 220인 4K 페이지에 적합하므로, 중앙 배열은 4MB의 적합한 공간을 가질 수 있다. 64비트 머신에서는 span 포인터에 일치하는 페이지 숫자를 매핑하는 배열 대신, 3-level radix tree를 사용할 수 있다.The 32-bit address space fits in 4K pages with 2 20 , so the central arrangement can have 4MB of adequate space. On a 64-bit machine, you can use a 3-level radix tree instead of an array that maps page numbers that match span pointers.
도 12는 본 발명의 일실시예에 있어서, 스팬 메모리 할당(Span allocation) 알고리즘의 일례를 도시한 도면이다.12 illustrates an example of a span memory allocation algorithm according to an embodiment of the present invention.
도 12에는 스팬(span)의 데이터 구조와, 메모리 할당/해제 알고리즘이 도시되어 있다. 스팬의 데이터 구조는 링크드 리스트(linked list)의 데이터 구조로 이루어질 수 있다.12 illustrates a span data structure and a memory allocation / release algorithm. The span data structure may consist of a linked list data structure.
오브젝트의 할당이 해제되었을 경우, 메모리 관리자는 해당 페이지 숫자를 계산하고, 일치하는 스팬 오브젝트를 찾기 위해 중앙 힙을 탐색할 수 있다.When an object is deallocated, the memory manager can calculate the page number and search the central heap to find a matching span object.
메모리 관리자는 스팬 오브젝트가 작다면, 해당 오브젝트를 현재 스레드의 스레드 캐시 내의 적합한 프리 리스트에 넣을 수 있으며, 이때 현재 스레드 캐시가 예측한 크기(예컨대, 기본값 2MB)를 초과하면, 가비지 컬렉션을 실행하여 사용되지 않은 오브젝트를 스레드 캐시에서 중앙 프리 리스트들로 이동시킬 수 있다.If the span object is small, the memory manager can put the object in the appropriate free list in the thread cache of the current thread, and if it exceeds the size expected by the current thread cache (for example, the default value of 2MB), it runs garbage collection and uses it. Can be moved from the thread cache to the central freelists.
또는, 메모리 관리자는 스팬 오브젝트가 큰 경우, 오브젝트가 차지하는 페이지의 범위를 알려주고, 예를 들어 페이지의 범위가 [p, q]라고 가정하면, 페이지의 p-1과 q+1을 span에서 조회할 때, 인접한 스팬(span)들 중에서 하나 이상이 프리 상태라면 [p, q] span으로 묶을 수 있다. 이렇게 묶여진 span은 페이지 힙의 적합한 free list로 삽입될 수 있다.Or, if the span object is large, the memory manager tells you the range of pages that the object occupies. For example, suppose the range of pages is [p, q]. When at least one of the adjacent spans is free, it can be bundled into a [p, q] span. This bound span can then be inserted into the appropriate free list on the page heap.
이하, 도 13에서는 본 발명의 실시예들에 따른 트랜잭션 처리 장치(200)의 작업 흐름을 상세히 설명한다.Hereinafter, FIG. 13 will be described in detail the workflow of the transaction processing apparatus 200 according to the embodiments of the present invention.
도 13은 본 발명의 일실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 방법의 순서를 도시한 흐름도이다.13 is a flowchart illustrating a procedure of a transaction processing method in a hybrid transactional memory system according to an embodiment of the present invention.
본 실시예에 따른 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 방법은 상술한 트랜잭션 처리 장치(200)에 의해 수행될 수 있다.The transaction processing method in the hybrid transactional memory system according to the present embodiment may be performed by the transaction processing apparatus 200 described above.
도 13을 참조하면, 단계(1310)에서, 트랜잭션 처리 장치(200)는 워크로드로부터 트랜잭션이 시작되는지 확인한다. 상기 단계(1310)에서의 확인 결과, 트랜잭션이 시작되는 경우, 단계(1320)에서, 트랜잭션 처리 장치(200)는 상기 트랜잭션에 대해, HTM에 의한 HTM 처리를 수행하고, 단계(1330)에서, 트랜잭션 처리 장치(200)는 상기 트랜잭션에 대해, STM에 의한 STM 처리를 수행한다. 단계(1340)에서, 트랜잭션 처리 장치(200)는 블룸 필터를 기반으로, 상기 HTM 처리와, 상기 STM 처리 간에, 동시성 제어를 수행한다.Referring to FIG. 13, in step 1310, the transaction processing apparatus 200 confirms whether a transaction starts from a workload. As a result of the confirmation in step 1310, if a transaction is started, in step 1320, the transaction processing apparatus 200 performs HTM processing by the HTM on the transaction, and in step 1330, the transaction The processing device 200 performs STM processing by STM on the transaction. In operation 1340, the transaction processing apparatus 200 performs concurrency control between the HTM processing and the STM processing based on the Bloom filter.
일례로, 본 발명의 트랜잭션 처리 장치(200)는 어플리케이션 형태로 구현될 수 있으며, 트랜잭션의 처리 개시에 관한 명령이 어플리케이션 상에서 워크로드(Workload)에 의해 입력되면, 트랜잭션의 HTM 처리 및 STM 처리를 동시에 수행할 수 있다.For example, the transaction processing apparatus 200 of the present invention may be implemented in the form of an application, and when a command for starting processing of a transaction is input by a workload on the application, the HTM processing and the STM processing of the transaction are simultaneously performed. Can be done.
구체적으로, 트랜잭션 처리 장치(200)는 상기 HTM 내에, 상기 HTM 처리를 수행하기 위한 메모리 영역을 할당하고, 상기 메모리 영역에서, 상기 HTM 처리를 수행할 수 있다. 또한, 트랜잭션 처리 장치(200)는 상기 STM 내에, 상기 메모리 영역과 상이한 가상메모리 영역을 할당하고, 상기 가상메모리 영역 상에서, 상기 STM 처리를 수행할 수 있다.In detail, the transaction processing apparatus 200 may allocate a memory area for performing the HTM processing in the HTM and perform the HTM processing in the memory area. In addition, the transaction processing apparatus 200 may allocate a virtual memory area different from the memory area in the STM, and perform the STM processing on the virtual memory area.
이때, 트랜잭션 처리 장치(200)는 상기 트랜잭션과 연관되는 오브젝트의 크기를 고려하여, 스레드(thread) 별 로컬 캐시(local cache) 또는 중앙 캐시(central cache) 내에서 상기 메모리 영역 또는 상기 가상메모리 영역의 할당 및 해제를 수행할 수 있다.In this case, the transaction processing apparatus 200 may consider the size of the object associated with the transaction, and determine the size of the memory area or the virtual memory in a local cache or central cache for each thread. Allocates and frees them.
즉, 트랜잭션 처리 장치(200)는 트랜잭션과 연관되는 오브젝트 사이즈에 맞춰 메모리 할당과 해제를 수행 함으로써, 메모리를 효율적으로 관리하고 트랜잭션 처리 성능 향상을 도모할 수 있다.That is, the transaction processing apparatus 200 may manage memory efficiently and improve transaction processing performance by performing memory allocation and release according to the object size associated with a transaction.
트랜잭션 처리 장치(200)는 멀티 코어 환경의 인메모리(In-Memory) 데이터베이스 상에서 HTM 및 STM 기술을 활용하여 유동적인 블룸 필터 데이터 구조를 기반으로 트랜잭션의 HTM 처리와 STM 처리를 시간적으로 동시에 수행 함으로써, 대규모 DB 트랜잭션의 처리 효율을 높일 수 있다.The transaction processing apparatus 200 simultaneously performs HTM processing and STM processing of transactions on the basis of a flexible Bloom filter data structure using HTM and STM technology on an in-memory database in a multi-core environment. It can improve the processing efficiency of large DB transactions.
또한, 트랜잭션 처리 장치(200)는 트랜잭션의 HTM 처리와 STM 처리를 동시 제어하면서도, 단위 시간 동안 HTM 처리와 STM 처리에 부여되는 처리 우선순위를 서로 상이하게 함으로써, 상기 HTM 처리와 상기 STM 처리와의 충돌을 용이하게 회피할 수 있다.In addition, the transaction processing apparatus 200 controls the HTM processing and the STM processing of the transaction at the same time, and differs from each other in the processing priority given to the HTM processing and the STM processing for a unit time. Collision can be easily avoided.
이와 같이, 본 발명에 의하면, 트랜잭션의 HTM 처리와 STM 처리를 동시 제어하면서도, 단위 시간 동안 HTM 처리에 우선순위를 두어 처리함으로써, STM 처리 결과를 이용하여 HTM 처리 결과를 보완하여 하이브리드 트랜잭셔널 메모리(Hybrid TM)에서 트랜잭션의 처리 성능을 보다 높일 수 있다.As described above, according to the present invention, while simultaneously controlling the HTM processing and the STM processing of a transaction, the processing is prioritized to the HTM processing for a unit time, thereby complementing the HTM processing result by using the STM processing result, thereby providing a hybrid transactional memory. (Hybrid TM) can increase the processing power of transactions.
본 발명의 실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.The method according to an embodiment of the present invention can be implemented in the form of program instructions that can be executed by various computer means and recorded in a computer readable medium. The computer readable medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded on the media may be those specially designed and constructed for the purposes of the embodiments, or they may be of the kind well-known and available to those having skill in the computer software arts. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tape, optical media such as CD-ROMs, DVDs, and magnetic disks, such as floppy disks. Magneto-optical media, and hardware devices specifically configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions include not only machine code generated by a compiler, but also high-level language code that can be executed by a computer using an interpreter or the like. The hardware device described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.
이상과 같이 실시예들이 비록 한정된 실시예와 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기의 기재로부터 다양한 수정 및 변형이 가능하다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다.Although the embodiments have been described by the limited embodiments and the drawings as described above, various modifications and variations are possible to those skilled in the art from the above description. For example, the described techniques may be performed in a different order than the described method, and / or components of the described systems, structures, devices, circuits, etc. may be combined or combined in a different form than the described method, or other components. Or even if replaced or substituted by equivalents, an appropriate result can be achieved.
그러므로, 다른 구현들, 다른 실시예들 및 특허청구범위와 균등한 것들도 후술하는 특허청구범위의 범위에 속한다.Therefore, other implementations, other embodiments, and equivalents to the claims are within the scope of the claims that follow.

Claims (16)

  1. 워크로드로부터 트랜잭션이 시작되면,When a transaction starts from a workload,
    상기 트랜잭션에 대해, HTM(Hardware Transactional Memory)에 의한 HTM 처리를 수행하는 단계; 및Performing HTM processing on a hardware transactional memory (HTM) for the transaction; And
    상기 트랜잭션에 대해, STM(Software Transactional Memory)에 의한 STM 처리를 수행하는 단계Performing STM processing on a software transactional memory (STM) for the transaction;
    를 포함하는 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 방법.Transaction processing method in a hybrid transactional memory system comprising a.
  2. 제1항에 있어서,The method of claim 1,
    상기 HTM 처리를 수행하는 단계는,Performing the HTM process,
    상기 HTM 내에 메모리 영역을 할당하는 단계; 및Allocating a memory area within the HTM; And
    정해진 횟수에 걸쳐 상기 HTM 처리의 수행을 시도하여, 상기 메모리 영역에서, 상기 HTM 처리를 수행하는 단계Attempting to perform the HTM process over a predetermined number of times, performing the HTM process in the memory area;
    를 포함하고,Including,
    상기 횟수 이내에서, 상기 HTM 처리가 수행되지 않는 경우,Within the number of times, if the HTM processing is not performed,
    상기 STM 처리를 수행하는 단계는,The step of performing the STM process,
    상기 STM 내에 상기 메모리 영역과 상이한 가상메모리 영역을 할당하는 단계; 및Allocating a virtual memory area different from the memory area in the STM; And
    상기 가상메모리 영역 상에서, 상기 STM 처리를 수행하는 단계Performing the STM processing on the virtual memory area;
    를 포함하는 트랜잭션 처리 방법.Transaction processing method comprising a.
  3. 제2항에 있어서,The method of claim 2,
    상기 트랜잭션 처리 방법은,The transaction processing method,
    상기 트랜잭션과 연관되는 오브젝트의 크기를 고려하여, 할당된 상기 메모리 영역 또는 상기 가상메모리 영역을 결정하는 단계Determining the allocated memory area or the virtual memory area in consideration of the size of an object associated with the transaction
    를 더 포함하는 트랜잭션 처리 방법.Transaction processing method further comprising.
  4. 제2항에 있어서,The method of claim 2,
    상기 트랜잭션 처리 방법은,The transaction processing method,
    상기 트랜잭션과 연관되는 오브젝트의 크기를 고려하여, 스레드(thread) 별 로컬 캐시(local cache) 또는 중앙 캐시(central cache) 내에서 상기 메모리 영역 또는 상기 가상메모리 영역의 할당 및 해제를 수행하는 단계Allocating and freeing the memory area or the virtual memory area in a local cache or a central cache for each thread in consideration of the size of an object associated with the transaction;
    를 더 포함하는 트랜잭션 처리 방법.Transaction processing method further comprising.
  5. 제4항에 있어서,The method of claim 4, wherein
    상기 할당 및 해제를 수행하는 단계는,The step of performing the allocation and release,
    상기 오브젝트가 일정 크기 이상이면, 중앙 캐시에서 상기 메모리 영역 또는 상기 가상메모리 영역을 할당하는 단계;Allocating the memory area or the virtual memory area in a central cache if the object is larger than a predetermined size;
    상기 오브젝트가 일정 크기 미만이면, 스레드 각각으로 로컬 캐시를 생성하고, 상기 로컬 캐시에서 상기 메모리 영역 또는 상기 가상메모리 영역을 할당하는 단계; 및If the object is less than a certain size, creating a local cache for each thread and allocating the memory area or the virtual memory area in the local cache; And
    일정 주기로 가비지 콜렉션(Garbage Collection)을 수행하여, 상기 로컬 캐시에서 상기 메모리 영역 또는 상기 가상메모리 영역이 할당된 오브젝트에 대해, 상기 중앙 캐시 내의 상기 메모리 영역 또는 상기 가상메모리 영역을 재할당하는 단계 Reallocating the memory area or the virtual memory area in the central cache to an object to which the memory area or the virtual memory area is allocated in the local cache by performing garbage collection at regular intervals;
    를 포함하는 트랜잭션 처리 방법.Transaction processing method comprising a.
  6. 제1항에 있어서,The method of claim 1,
    상기 HTM 처리와 상기 STM 처리가 수행되지 않는 경우,If the HTM process and the STM process is not performed,
    싱글 글로벌 락(single global lock)을 통해, 상기 트랜잭션을 처리하는 단계Processing the transaction through a single global lock
    를 더 포함하는 트랜잭션 처리 방법.Transaction processing method further comprising.
  7. 제1항에 있어서,The method of claim 1,
    블룸 필터(Bloom filter)를 기반으로, 상기 HTM 처리와, 상기 STM 처리 간에, 동시성 제어를 수행하는 단계Performing concurrency control between the HTM process and the STM process based on a Bloom filter
    를 더 포함하는 트랜잭션 처리 방법.Transaction processing method further comprising.
  8. 제1항에 있어서,The method of claim 1,
    상기 HTM 처리에 대해, 상기 STM 처리 보다 높은 처리 우선순위를 부여하여, 상기 STM 처리와 무관하게, 상기 HTM 처리가 우선하여 수행되도록 하는 단계Giving a higher processing priority to the HTM process than the STM process so that the HTM process is performed preferentially, irrespective of the STM process.
    를 더 포함하는 트랜잭션 처리 방법.Transaction processing method further comprising.
  9. 제1항에 있어서,The method of claim 1,
    상기 HTM 처리 및 상기 STM 처리 중에서, 처리 우선순위가 낮은 처리가 수행 완료되는 시점에, 처리 우선순위가 높은 처리에 대해 검증(validation)하는 단계; 및Validating a process having a high processing priority at the time when the process having a low processing priority is completed among the HTM process and the STM process; And
    상기 검증이 실패하면, 상기 처리 우선순위가 낮은 처리를 재수행하는 단계If the verification fails, rerunning the low priority processing
    를 더 포함하는 트랜잭션 처리 방법.Transaction processing method further comprising.
  10. 제9항에 있어서,The method of claim 9,
    상기 검증하는 동안, 상기 처리 우선순위가 낮은 처리에 대해, 스냅샷 기반의 시퀀스 락(seqlock)을 유지하는 단계; 및During the verification, maintaining a snapshot-based sequence lock for the low priority processing; And
    상기 검증이 성공하면, 상기 시퀀스 락을 증가시킨 후, 상기 트랜잭션을 종료하는 단계If the verification succeeds, incrementing the sequence lock and ending the transaction
    를 더 포함하는 트랜잭션 처리 방법.Transaction processing method further comprising.
  11. 제9항에 있어서,The method of claim 9,
    상기 처리 우선순위가 높은 처리를 수행 시, 상기 처리 우선순위가 낮은 처리에 대해 유지된, 시퀀스 락을 이용하지 않도록 하는 단계Not performing a sequence lock maintained for the low priority processing when performing the high priority processing
    를 더 포함하는 트랜잭션 처리 방법.Transaction processing method further comprising.
  12. 워크로드로부터 트랜잭션이 시작되면,When a transaction starts from a workload,
    상기 트랜잭션에 대해, HTM에 의한 HTM 처리를 수행하고, 상기 트랜잭션에 대해, STM에 의한 STM 처리를 수행하는 트랜잭션 처리부A transaction processing unit that performs HTM processing by HTM on the transaction, and STM processing by STM on the transaction.
    를 포함하는 하이브리드 트랜잭셔널 메모리 시스템에서의 트랜잭션 처리 장치.Transaction processing apparatus in a hybrid transactional memory system comprising a.
  13. 제12항에 있어서,The method of claim 12,
    상기 HTM 내에 메모리 영역을 할당하고, 상기 STM 내에, 상기 메모리 영역과 상이한 가상메모리 영역을 할당하는 메모리 할당부A memory allocation unit for allocating a memory area in the HTM and allocating a virtual memory area different from the memory area in the STM;
    를 더 포함하고,More,
    상기 트랜잭션 처리부는,The transaction processing unit,
    정해진 횟수에 걸쳐 상기 HTM 처리의 수행을 시도하여, 상기 메모리 영역에서, 상기 HTM 처리를 수행하되, 상기 횟수 이내에서, 상기 HTM 처리가 수행되지 않는 경우, 상기 가상메모리 영역 상에서, 상기 STM 처리를 수행하는Attempts to perform the HTM process over a predetermined number of times, and performs the HTM process in the memory area, but within the number of times, if the HTM process is not performed, performs the STM process on the virtual memory area. doing
    트랜잭션 처리 장치.Transaction processing unit.
  14. 제12항에 있어서,The method of claim 12,
    상기 HTM 처리와 상기 STM 처리가 수행되지 않는 경우,If the HTM process and the STM process is not performed,
    상기 트랜잭션 처리부는,The transaction processing unit,
    싱글 글로벌 락을 통해, 상기 트랜잭션을 처리하는Through a single global lock, processing the transaction
    트랜잭션 처리 장치.Transaction processing unit.
  15. 제12항에 있어서,The method of claim 12,
    블룸 필터를 기반으로, 상기 HTM 처리와, 상기 STM 처리 간에, 동시성 제어를 수행하는 동시성 제어부Concurrency control unit performing concurrency control between the HTM process and the STM process based on a bloom filter
    를 더 포함하는 트랜잭션 처리 장치.Transaction processing device further comprising.
  16. 제12항에 있어서,The method of claim 12,
    상기 HTM 처리에 대해, 상기 STM 처리 보다 높은 우선순위를 부여하여, 상기 STM 처리와 무관하게, 상기 HTM 처리가 우선하여 수행되도록 하는 동시성 제어부A concurrency control unit that gives a higher priority to the HTM process than the STM process so that the HTM process is performed preferentially regardless of the STM process.
    를 더 포함하는 트랜잭션 처리 장치.Transaction processing device further comprising.
PCT/KR2017/014991 2017-04-21 2017-12-19 Method and device for processing transaction in hybrid transactional memory system WO2018194237A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2017-0051677 2017-04-21
KR1020170051677A KR101885030B1 (en) 2017-04-21 2017-04-21 Transaction processing method in hybrid transactional memory system and transaction processing apparatus

Publications (1)

Publication Number Publication Date
WO2018194237A1 true WO2018194237A1 (en) 2018-10-25

Family

ID=63251785

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2017/014991 WO2018194237A1 (en) 2017-04-21 2017-12-19 Method and device for processing transaction in hybrid transactional memory system

Country Status (2)

Country Link
KR (1) KR101885030B1 (en)
WO (1) WO2018194237A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148930A (en) * 2020-09-28 2020-12-29 上海交通大学 Method, system and medium for graph database system transaction processing based on RTM

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102184841B1 (en) * 2019-06-27 2020-11-30 전북대학교산학협력단 Method and device for recovering transaction in hybrid transactional memory
KR102150597B1 (en) * 2019-07-23 2020-09-01 전북대학교산학협력단 Method for operating hybrid transactional memory system with optimal retry policy, and hybrid transactional memory system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070288902A1 (en) * 2006-06-09 2007-12-13 Sun Microsystems, Inc. Replay debugging
KR20080076981A (en) * 2005-12-30 2008-08-20 인텔 코오퍼레이션 Unbounded transactional memory systems
KR20160113205A (en) * 2014-03-26 2016-09-28 인텔 코포레이션 Software replayer for transactional memory programs
KR20160113207A (en) * 2014-03-26 2016-09-28 인텔 코포레이션 Enabling maximum concurrency in a hybrid transactional memory system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7395382B1 (en) * 2004-08-10 2008-07-01 Sun Microsystems, Inc. Hybrid software/hardware transactional memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080076981A (en) * 2005-12-30 2008-08-20 인텔 코오퍼레이션 Unbounded transactional memory systems
US20070288902A1 (en) * 2006-06-09 2007-12-13 Sun Microsystems, Inc. Replay debugging
KR20160113205A (en) * 2014-03-26 2016-09-28 인텔 코포레이션 Software replayer for transactional memory programs
KR20160113207A (en) * 2014-03-26 2016-09-28 인텔 코포레이션 Enabling maximum concurrency in a hybrid transactional memory system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YOON, MIN: "Hardware Transactional Memory based on Conflict Prediction and Retry Policy in Multi-core In-Memory Databases", DOCT. THESIS DEPARTM. OF COMPUTER ENGINEERING CHONBUK NAT. UNIVERSITY, 22 February 2017 (2017-02-22), pages 1 - 148 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148930A (en) * 2020-09-28 2020-12-29 上海交通大学 Method, system and medium for graph database system transaction processing based on RTM

Also Published As

Publication number Publication date
KR101885030B1 (en) 2018-08-02

Similar Documents

Publication Publication Date Title
US8024505B2 (en) System and method for optimistic creation of thread local objects in a virtual machine environment
JP2941947B2 (en) Computer method and apparatus for performing asynchronous ordered operations
WO2018194237A1 (en) Method and device for processing transaction in hybrid transactional memory system
US4914570A (en) Process distribution and sharing system for multiple processor computer system
JP4917138B2 (en) Object optimum arrangement device, object optimum arrangement method, and object optimum arrangement program
WO2012109879A1 (en) Method, device and system for caching data in multi-node system
WO2012111905A2 (en) Distributed memory cluster control device and method using mapreduce
WO2013042880A2 (en) Method and device for storing data in a flash memory using address mapping for supporting various block sizes
US20100251260A1 (en) Pre-emptible context switching in a computing device
JPS6341100B2 (en)
WO2019212182A1 (en) Apparatus and method for managing a shareable resource in a multi-core processor
Cranor et al. The UVM virtual memory system
CN1226023A (en) Load/load detection and reorder method
WO2022124720A1 (en) Method for detecting error of operating system kernel memory in real time
CN110162395B (en) Memory allocation method and device
JP3360933B2 (en) Storage control method and storage control device in information processing system
US11016883B2 (en) Safe manual memory management
WO2022124507A1 (en) Computer system for mixing epoch-based memory reclamation scheme and pointer-based memory reclamation scheme, and method therefor
WO2016182255A1 (en) Electronic device and page merging method therefor
JP3453761B2 (en) Address translation method
JPH05134930A (en) Memory protecting device
WO2022215783A1 (en) Method and controller for detecting ransomware in ssd
WO2021182781A1 (en) Matrix calculation method and device
JPH0444140A (en) Virtual memory control method
JPS603229B2 (en) Information processing method

Legal Events

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

Ref document number: 17906680

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17906680

Country of ref document: EP

Kind code of ref document: A1