Unlock instant, AI-driven research and patent intelligence for your innovation.

A garbage collection method and system in linux Bcache

A recycling method and garbage technology, applied in memory systems, multi-program devices, program control design, etc., can solve the problems of interruption of read and write business traffic and time-consuming, and achieve the effect of avoiding interruption of cache device space allocation

Active Publication Date: 2022-05-13
天津中科曙光存储科技有限公司
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] Since the core data structure of Linux bcache is B+tree, and the "read-write lock" technology is used to realize the concurrency control of B+tree operations; All requests will wait, that is, during the process of Bcache garbage collection, it will cause traffic interruption of read and write services
[0009] The garbage collection process in Bcache involves operations such as "B+tree node merging", "B+tree node sorting and writing to disk", "marking the usage of each interval on the cache device" and other operations; these operations are time-consuming, and use The larger the capacity of the cache device, the greater the time-consuming; therefore, with the popularity and capacity of solid-state drives, the problem of traffic interruption during garbage collection will become more and more the performance bottleneck of Bcache

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A garbage collection method and system in linux Bcache
  • A garbage collection method and system in linux Bcache
  • A garbage collection method and system in linux Bcache

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0042] Embodiments of the technical solutions of the present invention will be described in detail below in conjunction with the accompanying drawings. The following examples are only used to illustrate the technical solutions of the present invention more clearly, and therefore are only examples, rather than limiting the protection scope of the present invention.

[0043] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application shall have the usual meanings understood by those skilled in the art to which the present invention belongs.

[0044] A method for garbage collection in Linux Bcache, including a concurrent processing method for a write request process and a GC process, and a concurrent processing method for a read process and a GC process, including

[0045] Set auxiliary B+tree;

[0046] When the write request process is concurrent with the GC process, the data elements of the write request are inserted in...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a garbage collection method in Linux Bcache, which includes setting an auxiliary B+tree; when the write request flow is concurrent with the GC flow, the data elements of the write request are inserted into the auxiliary B+tree, and the data elements of the write request are inserted at the end of the GC flow After that, the inserted data elements are inserted into the original B+tree. By assisting the B+tree, the method of the present invention avoids the flow interruption caused by the request having to wait when the write request is concurrent with the GC process; combined with the "preemptible lock", it solves the flow interruption caused by the read request having to wait in the Bcache GC process; At the same time, by maintaining the priority of GC tasks, it avoids the interruption of cache device space allocation caused by GC tasks being preempted all the time.

Description

technical field [0001] The invention relates to the technical field of computer storage optimization, in particular to a garbage collection method and system in Linux Bcache. Background technique [0002] Linux Bcache is a block device cache in the Linux kernel. Its basic function is to use solid-state drives (cache devices) to cache mechanical hard drives (back-end devices). In Bcache, B+tree (a multi-way search tree) is used to maintain the mapping relationship between the cache device and the data on the back-end device. [0003] The operations involved in the B+tree include "search, traverse, insert, and organize". Writing data to the cache device will insert elements into the B+tree; reading data from the cache device will find elements from the B+tree; The data written back to the back-end device (refresh) will traverse the B+tree to mark the "dirty data" interval on the cache device; reclaiming and reusing the space on the cache device (garbage collection) will organ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F12/02G06F9/52
CPCG06F12/0253G06F9/524
Inventor 王云飞沈海嘉郭照斌石胜男
Owner 天津中科曙光存储科技有限公司