liblightnvm the open-channel ssd user-space library › sites › default › files › sdc › 2018...

54
liblightnvm The Open-Channel SSD User-Space Library Simon A. F. Lund CNEX Labs

Upload: others

Post on 25-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 1

liblightnvmThe Open-Channel SSD User-Space Library

Simon A. F. LundCNEX Labs

Page 2: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 2

Open-Channel SSD

Page 3: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 3

Open-Channel SSD

• Media• Controller

Page 4: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 4

Open-Channel SSD

• Media• Controller

Page 5: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 5

Open-Channel SSD: Drive Model

Logical Block Chunk Parallel Unit Group of Parallel Units

Page 6: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 6

Open-Channel SSD: Addressing

Page 7: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 7

Open-Channel SSD: Chunk

Contains Minimal Addressable UnitsEach unit has size in bytes e.g. 4096Nomenclature: logical block, sector, address

Addresses within a chunk are contiguousE.g. Address range [0, naddrs-1]

Page 8: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 8

Open-Channel SSD: Chunk IO Constraints

1. Erase before write2. Write contiguously3. Write WS_MIN multiple # of addresses pr. cmd4. Read no further than address WP – MWC

Page 9: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 9

Open-Channel SSD: Chunk IO Constraints

1. Erase before write2. Write contiguously3. Write WS_MIN multiple # of addresses pr. cmd4. Read no further than address WP – MWC

Page 10: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 10

liblightnvm: Related

nvme-clihttps://github.com/linux-nvme/nvme-cli

SPDKhttps://github.com/spdk/spdk

libnvmehttps://github.com/hgst/libnvme

Page 11: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 11

liblightnvm: overview

Page 12: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 12

liblightnvm: Usages

Pure User-Space driven IODedicated application-integration

Page 13: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 13

liblightnvm: Usages

Pure User-Space driven IODedicated application-integration

Hybrid Kernel and User-SpacePBLK + User-Space for application IO

Page 14: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 14

liblightnvm: Usages

Pure User-Space driven IODedicated application-integration

Hybrid Kernel and User-SpacePBLK + User-Space for application IO

Tooling for Open-Channel SSD kernel servicesFile-system and FTL management and

maintenance

Page 15: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 15

liblightnvm: OCSSD Device Attributes

nvm_cmd_idfy struct nvm_devnvm_dev_openf(ident, flags)nvm_dev_get_wsopt(dev)nvm_dev_get_geo(dev)

struct nvm_geo

Page 16: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 16

liblightnvm: OCSSD Device Attributes

DEMO: nvm_cmd_idfyhttps://asciinema.org/a/WJJMxRKsgAq0GIbWlfhIAGZDl

DEMO: nvm_dev and nvm_geohttps://asciinema.org/a/DCr9ak5VdnClpJjjvxjKQQNIg

Page 17: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 17

liblightnvm: OCSSD Media State

nvm_cmd_rprtRetrieve chunk descriptors for all chunksRetrieve chunk descriptors for all chunks in a

parallel unit

Page 18: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 18

liblightnvm: OCSSD Media State

nvm_cmd_rprtRetrieve chunk descriptors for all chunksRetrieve chunk descriptors for all chunks in a

parallel unit nvm_cmd_rprt_arbsProvides N arbitrary chunk addresses in the

requested state in distinct parallel units

Page 19: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 19

liblightnvm: OCSSD Media State

DEMOhttps://asciinema.org/a/XGppr2Yjdc90fsoyLCPVCx0sc

Page 20: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 20

liblightnvm: OCSSD Addressing

struct nvm_addrGeometric accessorsAddress translation is handled by the libraryUser does not need to know about the LBAF

Page 21: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 21

liblightnvm: OCSSD Addressing

struct nvm_addrGeometric accessorsAddress translation is handled by the libraryUser does not need to know about the LBAF

nvm_dev_gen2dev nvm_dev_dev2gen

Page 22: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 22

liblightnvm: OCSSD Addressing

DEMOhttps://asciinema.org/a/tFwlWRMq0DwwvK5oq5bCuBpty

Page 23: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 23

liblightnvm: OCSSD IO Commands

nvm_cmd_erase – Vector Reset / DSM deallocate nvm_cmd_write – Vector / Scalar Write nvm_cmd_read – Vector / Scalar Read nvm_cmd_copy – Vector Copy

Page 24: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 24

liblightnvm: OCSSD IO Commands

DEMOhttps://asciinema.org/a/iq8hoPAYpXSqY5Jgq67SrbA1Q

Page 25: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 25

liblightnvm: OCSSD IO Command Options

IO Addressing Mode (SCALAR or VECTOR)

Page 26: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 26

liblightnvm: OCSSD IO Command Options

IO Addressing Mode (SCALAR or VECTOR) NVM_CMD_SCALARerase / write / read mapped to NVMe spec.

defined opcodes

Page 27: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 27

liblightnvm: OCSSD IO Command Options

IO Addressing Mode (SCALAR or VECTOR) NVM_CMD_SCALARerase / write / read mapped to NVMe spec.

defined opcodes NVM_CMD_VECTORerase / write / read mapped to OCSSD spec.

defined VECTOR opcodes

Page 28: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 28

liblightnvm: OCSSD IO Command Options

Page 29: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 29

liblightnvm: OCSSD IO Command Options

Page 30: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 30

liblightnvm: OCSSD IO Command Options

Page 31: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 31

liblightnvm: OCSSD IO Command Options

Page 32: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 32

liblightnvm: OCSSD IO Command Options

IO Execution Mode (SYNC or ASYNC)

Page 33: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 33

liblightnvm: OCSSD IO Command Options

IO Execution Mode (SYNC or ASYNC) NVM_CMD_SYNCSubmits and blocks until completion

Page 34: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 34

liblightnvm: OCSSD IO Command Options

IO Execution Mode (SYNC or ASYNC) NVM_CMD_SYNCSubmits and blocks until completion

NVM_CMD_ASYNCReturns after submissionCallback function called upon completion

Page 35: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 35

liblightnvm: Striping

HORZVERT

chunk0 chunk1 chunk2 chunk3 chunk0 chunk1 chunk2 chunk3

Page 36: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 36

liblightnvm: Striping

HORZVERT

chunk0 chunk1 chunk2 chunk3 chunk0 chunk1 chunk2 chunk3

Page 37: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 37

liblightnvm: Striping Caveat

HORZ

chunk0 chunk1 chunk2 chunk3

Constraints amplified Write-cache increase MWC x k

Optimal write-sizeWS_OPT x k

Minimal write is intact

Page 38: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 38

liblightnvm: OCSSD ASYNC IO Example

DEMOhttps://asciinema.org/a/8bo7Ma0DWqqZaMQRelGWDNTaf

Page 39: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 39

liblightnvm: Abstractions

Reduce the cognitive load on the OCSSD user

Page 40: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 40

liblightnvm: Abstractions

Reduce the cognitive load on the OCSSD user Provide traditional IO semanticswrite(fd, *buf, count) / read(fd, *buf, count)pread(fd, *buf, count, offset)

Page 41: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 41

liblightnvm: Abstractions

Reduce the cognitive load on the OCSSD user Provide traditional IO semanticswrite(fd, *buf, count) / read(fd, *buf, count)pread(fd, *buf, count, offset)

Use them when you need themPeel them off and take control when you don’t

Page 42: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 42

liblightnvm: Virtual Block

Encapsulates IO to a disjoint set of k chunks Dynamic / Runtime control of parallel unitsUser provisioned set of chunks

HORZ striping on WS_OPT for throughput

Page 43: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 43

liblightnvm: Virtual Block

Traditional IO Semanticsnvm_vblk_write(*vblk, *buf, count) nvm_vblk_read(*vblk, *buf, count) nvm_vblk_pread(*vblk, *buf, count, offset)

Agnostic to media and spec. variation

Page 44: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 44

liblightnvm: Virtual Block

DEMOhttps://asciinema.org/a/HnPa9smu8W6HoeyaqC6DavBeo

Page 45: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 45

liblightnvm: Append-Only Streams

Encapsulates IO to a disjoint set of k chunks Dynamic / Runtime control of parallel unitsLibrary provisioned set of chunksProvisioning strategy e.g. HORZ or VERT

HORZ striping on WS_OPT for throughput Stream states are persistent!

Page 46: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 46

liblightnvm: Append-Only Streams

Traditional IO Semanticsaos_write(sid, *buf, count)aos_read(sid, *buf, count)aos_pread(sid, *buf, count, read)

Agnostic to media and spec. variation Encapsulates geometry and addressing

Page 47: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 47

liblightnvm: Append-Only Streams

DEMO https://asciinema.org/a/ljb7fhetCKmRCd79G8cbYpaic

Page 48: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 48

liblightnvm: Summary

Page 49: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 49

Roadmap: Persistent CMB interface

Rawnvm_cmb_writenvm_cmd_read

IO orientednvm_cmb_io_writenvm_cmb_io_readnvm_cmd_io_push

Page 50: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 50

Roadmap: Spec. support

Expand support in the evolving spec. spaceDenali / OCSSD 2.1 / NVMeRaw support via nvm_cmd_*Encapsulation in upper-level abstractions

Virtual Block and Append-Only interfaces

Page 51: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 51

Roadmap: Related tools

nvm_uiWeb interface for management of PBLK

instances, NVMoF targets, subsystems and ports

Visualization of IO stats. in real-time CIJOEToolchain for QA, test, and development

Page 52: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 52

Roadmap: Collaboration

What are you missing from liblightnvm?

Page 53: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 53

Roadmap: Collaboration

What are you missing from liblightnvm? Regarding SGL support, would you prefer …An array of buffersA list of SGL segments Iterator / function-pointerSomething else? All of them?

Page 54: liblightnvm The Open-Channel SSD User-Space Library › sites › default › files › SDC › 2018 › presentation… · Pure User-Space driven IO Dedicated application-integration

2018 Storage Developer Conference. © CNEX Labs, Inc. All Rights Reserved. 54

Thanks

SRC http://github.com/OpenChannelSSD/liblightnvmDOC http://lightnvm.io/liblightnvmMAIL [email protected]

www.linkedin.com/in/simonlund