Lines Matching +full:cpu +full:- +full:viewed
2 LIBNVDIMM: Non-Volatile Devices
5 libnvdimm - kernel / libndctl - userspace helper library
7 linux-nvdimm@lists.01.org
20 BLK-REGIONs, PMEM-REGIONs, Atomic Sectors, and DAX
52 A system-physical-address range where writes are persistent. A
59 performance benefit of interleaving, but enables DIMM-bounded failure
63 DIMM Physical Address, is a DIMM-relative offset. With one DIMM in
64 the system there would be a 1:1 system-physical-address:DPA association.
67 system-physical-address. BLK capacity always has a 1:1 relationship
68 with a single-DIMM's DPA range.
77 device - in this case the firmware.
81 It defines a vendor-id, device-id, and interface format for a given DIMM.
85 Existing software may have an expectation that the power-fail-atomicity
93 BLK storage to host BTTs with different parameters per BLK-partition.
105 implementation is generic and supports pre-NFIT platforms, it was guided
113 --------------------
125 ---------
138 Prior to the arrival of the NFIT, non-volatile memory was described to a
139 system in various ad-hoc ways. Usually only the bare minimum was
140 provided, namely, a single system-physical-address range where writes
143 BLK and platform message-passing entry points for control and
149 1. PMEM (nd_pmem.ko): Drives a system-physical-address range. This
155 Note that while LIBNVDIMM describes system-physical-address ranges that may
158 distinction. The different device-types are an implementation detail
169 tagged-command-queuing, and would likely be used by different threads or
172 The NFIT specification defines a standard format for a BLK-aperture, but
173 the spec also allows for vendor specific layouts, and non-NFIT BLK
175 "nd_blk" calls back into platform-specific code to perform the I/O.
184 While PMEM provides direct byte-addressable CPU-load/store access to
187 system-physical-address address causes a CPU exception while an access
188 to a corrupted address through an BLK-aperture causes that block window
190 the standard error model that host-bus-adapter attached disks present.
198 -----------
200 BLK-apertures solve these RAS problems, but their presence is also the
203 Any given DIMM's DPA-range may contribute to one or more
204 system-physical-address sets of interleaved DIMMs, *and* may also be
205 accessed in its entirety through its BLK-aperture. Accessing a DPA
206 through a system-physical-address while simultaneously accessing the
207 same DPA through a BLK-aperture has undefined results. For this reason,
209 store/retrieve a LABEL. The LABEL effectively partitions the DPA-space
210 into exclusive system-physical-address and BLK-aperture accessible
216 BLK-REGIONs, PMEM-REGIONs, Atomic Sectors, and DAX
221 BLK-namespace can be configured with a BTT with unique atomic sector
239 (a) (b) DIMM BLK-REGION
240 +-------------------+--------+--------+--------+
241 +------+ | pm0.0 | blk2.0 | pm1.0 | blk2.1 | 0 region2
242 | imc0 +--+- - - region0- - - +--------+ +--------+
243 +--+---+ | pm0.0 | blk3.0 | pm1.0 | blk3.1 | 1 region3
244 | +-------------------+--------v v--------+
245 +--+---+ | |
247 +--+---+ | |
248 | +----------------------------^ ^--------+
249 +--+---+ | blk4.0 | pm1.0 | blk4.0 | 2 region4
250 | imc1 +--+----------------------------| +--------+
251 +------+ | blk5.0 | pm1.0 | blk5.0 | 3 region5
252 +----------------------------+--------+--------+
256 by a region device with a dynamically assigned id (REGION0 - REGION5).
259 single PMEM namespace is created in the REGION0-SPA-range that spans most
260 of DIMM0 and DIMM1 with a user-specified name of "pm0.0". Some of that
261 interleaved system-physical-address range is reclaimed as BLK-aperture
262 accessed space starting at DPA-offset (a) into each DIMM. In that
263 reclaimed space we create two BLK-aperture "namespaces" from REGION2 and
265 could be set to any user-desired name in the LABEL.
268 system-physical-address range, REGION1, that spans those two DIMMs as
270 named "pm1.0", the rest is reclaimed in 4 BLK-aperture namespaces (for
275 interleaved system-physical-address range (i.e. the DPA address past
277 Note, that this example shows that BLK-aperture namespaces don't need to
278 be contiguous in DPA-space.
290 corresponding object hierarchy diagram as viewed through the LIBNDCTL
296 -----------------
317 -----------------------
320 ACPI based systems is that there is only ever one platform-global NFIT.
327 ---------------------------------------------
333 |-- dev
334 |-- device -> ../../../ndbus0
335 |-- subsystem -> ../../../../../../../class/nd
340 --------------
350 |-- commands
351 |-- nd
352 |-- nfit
353 |-- nmem0
354 |-- nmem1
355 |-- nmem2
356 |-- nmem3
357 |-- power
358 |-- provider
359 |-- region0
360 |-- region1
361 |-- region2
362 |-- region3
363 |-- region4
364 |-- region5
365 |-- uevent
366 `-- wait_probe
389 -------------------------------
393 NFIT then an optional 'nfit' attribute sub-directory is available to add
394 NFIT-specifics.
413 |-- nmem0
414 | |-- available_slots
415 | |-- commands
416 | |-- dev
417 | |-- devtype
418 | |-- driver -> ../../../../../bus/nd/drivers/nvdimm
419 | |-- modalias
420 | |-- nfit
421 | | |-- device
422 | | |-- format
423 | | |-- handle
424 | | |-- phys_id
425 | | |-- rev_id
426 | | |-- serial
427 | | `-- vendor
428 | |-- state
429 | |-- subsystem -> ../../../../../bus/nd
430 | `-- uevent
431 |-- nmem1
438 Note, in this example we are assuming NFIT-defined DIMMs which are
439 identified by an "nfit_handle" a 32-bit value where:
441 - Bit 3:0 DIMM number within the memory channel
442 - Bit 7:4 memory channel number
443 - Bit 11:8 memory controller ID
444 - Bit 15:12 socket ID (within scope of a Node controller if node
446 - Bit 27:16 Node Controller ID
447 - Bit 31:28 Reserved
470 --------------------------
472 A generic REGION device is registered for each PMEM range or BLK-aperture
473 set. Per the example there are 6 regions: 2 PMEM and 4 BLK-aperture
476 DPA-start-offset, length>.
478 LIBNVDIMM provides a built-in driver for these REGION devices. This driver
481 devices with the resolved/exclusive DPA-boundaries for the nd_pmem or
486 "nstype" indicates the integer type of namespace-device this region
502 |-- region0
503 | |-- available_size
504 | |-- btt0
505 | |-- btt_seed
506 | |-- devtype
507 | |-- driver -> ../../../../../bus/nd/drivers/nd_region
508 | |-- init_namespaces
509 | |-- mapping0
510 | |-- mapping1
511 | |-- mappings
512 | |-- modalias
513 | |-- namespace0.0
514 | |-- namespace_seed
515 | |-- numa_node
516 | |-- nfit
517 | | `-- spa_index
518 | |-- nstype
519 | |-- set_cookie
520 | |-- size
521 | |-- subsystem -> ../../../../../bus/nd
522 | `-- uevent
523 |-- region1
529 Sample region retrieval routines based on NFIT-unique data like
569 ----------------------------------------------------
575 region-attributes for four reasons:
582 the region-attributes not the region-name or the region-devtype.
584 2. A region with zero child-namespaces is a possible configuration. For
586 corresponding BLK-aperture. This equates to a DIMM that can only accept
594 for the REGION level of the device-hierarchy old userspace
596 region-types. Userspace can always rely on the generic region
598 named "namespace". This generic format of the device-model hierarchy
600 future-proof.
607 ----------------------------------------------
617 decide which block-device driver will attach to a given LIBNVDIMM namespace.
620 vendor-specific driver down the road. If a vendor-specific
624 In fact, a vendor may also want to have a vendor-specific region-driver
628 accurate than a region-name or region-devtype.
635 # udevadm info --path=/devices/platform/nfit_test.0/ndbus0/region0
642 # udevadm info --path=/devices/platform/nfit_test.0/ndbus0/region4
650 "devtype" does not indicate sub-type variations and scripts should
656 As it currently stands a BLK-aperture region will never have a
657 "nfit/spa_index" attribute, but neither will a non-NFIT PMEM region. A
660 is a simple system-physical-address range.
664 -----------------------------
675 namespace0.0 represents DIMM-info-backed PMEM (note that it has a 'uuid'
682 |-- alt_name
683 |-- devtype
684 |-- dpa_extents
685 |-- force_raw
686 |-- modalias
687 |-- numa_node
688 |-- resource
689 |-- size
690 |-- subsystem -> ../../../../../../bus/nd
691 |-- type
692 |-- uevent
693 `-- uuid
695 |-- alt_name
696 |-- devtype
697 |-- dpa_extents
698 |-- force_raw
699 |-- modalias
700 |-- numa_node
701 |-- sector_size
702 |-- size
703 |-- subsystem -> ../../../../../../bus/nd
704 |-- type
705 |-- uevent
706 `-- uuid
708 |-- block
709 | `-- pmem0
710 |-- devtype
711 |-- driver -> ../../../../../../bus/nd/drivers/pmem
712 |-- force_raw
713 |-- modalias
714 |-- numa_node
715 |-- resource
716 |-- size
717 |-- subsystem -> ../../../../../../bus/nd
718 |-- type
719 `-- uevent
760 ndctl_region_get_id(region), paramaters->id);
764 ndctl_namespace_set_uuid(ndns, paramaters->uuid);
765 ndctl_namespace_set_size(ndns, paramaters->size);
767 if (parameters->lbasize)
768 ndctl_namespace_set_sector_size(ndns, parameters->lbasize);
777 ND (libnvdimm subsystem) to a volume manager like device-mapper.
779 2. The term originated to describe the sub-devices that can be created
783 NVME-namespaces.
787 -------------------------------------------------
802 |-- namespace
803 |-- delete
804 |-- devtype
805 |-- modalias
806 |-- numa_node
807 |-- sector_size
808 |-- subsystem -> ../../../../../bus/nd
809 |-- uevent
810 `-- uuid
837 ndctl_btt_set_uuid(btt, parameters->uuid);
838 ndctl_btt_set_sector_size(btt, parameters->sector_size);
839 ndctl_btt_set_namespace(btt, parameters->ndns);
841 ndctl_namespace_disable(parameters->ndns);
860 ------------------------
865 +---+
866 |CTX| +---------+ +--------------+ +---------------+
867 +-+-+ +-> REGION0 +---> NAMESPACE0.0 +--> PMEM8 "pm0.0" |
868 | | +---------+ +--------------+ +---------------+
869 +-------+ | | +---------+ +--------------+ +---------------+
870 | DIMM0 <-+ | +-> REGION1 +---> NAMESPACE1.0 +--> PMEM6 "pm1.0" |
871 +-------+ | | | +---------+ +--------------+ +---------------+
872 | DIMM1 <-+ +-v--+ | +---------+ +--------------+ +---------------+
873 +-------+ +-+BUS0+---> REGION2 +-+-> NAMESPACE2.0 +--> ND6 "blk2.0" |
874 | DIMM2 <-+ +----+ | +---------+ | +--------------+ +----------------------+
875 +-------+ | | +-> NAMESPACE2.1 +--> ND5 "blk2.1" | BTT2 |
876 | DIMM3 <-+ | +--------------+ +----------------------+
877 +-------+ | +---------+ +--------------+ +---------------+
878 +-> REGION3 +-+-> NAMESPACE3.0 +--> ND4 "blk3.0" |
879 | +---------+ | +--------------+ +----------------------+
880 | +-> NAMESPACE3.1 +--> ND3 "blk3.1" | BTT1 |
881 | +--------------+ +----------------------+
882 | +---------+ +--------------+ +---------------+
883 +-> REGION4 +---> NAMESPACE4.0 +--> ND2 "blk4.0" |
884 | +---------+ +--------------+ +---------------+
885 | +---------+ +--------------+ +----------------------+
886 +-> REGION5 +---> NAMESPACE5.0 +--> ND1 "blk5.0" | BTT0 |
887 +---------+ +--------------+ +---------------+------+