summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2017-02-07 01:58:02 +0000
committermav <mav@FreeBSD.org>2017-02-07 01:58:02 +0000
commit9a14449f000366bbecfcd79e9740def90523687d (patch)
tree8fdc8e50996e61ac89ce6a3d30c51b7bff883311 /usr.sbin
parentb8bf2049d02110a27c388f8d234bf1233ddb7742 (diff)
downloadFreeBSD-src-9a14449f000366bbecfcd79e9740def90523687d.zip
FreeBSD-src-9a14449f000366bbecfcd79e9740def90523687d.tar.gz
MFC r312694: Make CTL ramdisk backend a real RAM disk.
If "capacity" LU option is set, ramdisk backend now implements featured thin provisioned disk, storing data in malloc(9) allocated memory blocks of pblocksize bytes (default PAGE_SIZE or 4KB). Additionally ~0.2% of LU size is used for indirection tree (bigger pblocksize reduce the overhead). Backend supports all unmap and anchor operations. If configured capacity is overflowed, proper error conditions are reported. If "capacity" LU option is not set, the backend operates mostly the same as before without allocating real storage: writes go to nowhere, reads return zeroes, reporting that all LBAs are unmapped. This backend is still mostly oriented on testing and benchmarking (it is still a volatile RAM disk), but now it should allow to run real FS tests, not only simple dumb dd.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ctladm/ctladm.819
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/ctladm/ctladm.8 b/usr.sbin/ctladm/ctladm.8
index 5be1ba1..d8b0ae0 100644
--- a/usr.sbin/ctladm/ctladm.8
+++ b/usr.sbin/ctladm/ctladm.8
@@ -35,7 +35,7 @@
.\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $
.\" $FreeBSD$
.\"
-.Dd December 21, 2016
+.Dd January 23, 2017
.Dt CTLADM 8
.Os
.Sh NAME
@@ -941,6 +941,14 @@ Specifies file or device name to use for backing store.
.It Va num_threads
Specifies number of backend threads to use for this LUN.
.El
+.Pp
+Options specific for ramdisk backend:
+.Bl -tag -width 12n
+.It Va capacity
+Specifies capacity of backing store (maximum RAM for data).
+The default value is zero, that disables backing store completely,
+making all writes go to nowhere, while all reads return zeroes.
+.El
.Sh EXAMPLES
.Dl ctladm tur 1
.Pp
@@ -977,7 +985,14 @@ starting at LBA 0xff432140.
Create a LUN with the
.Dq fake
ramdisk as a backing store.
-The LUN will claim to have a size of approximately 10 terabytes.
+The LUN will claim to have a size of approximately 10 terabytes,
+while having no real data store (all written data are lost).
+.Pp
+.Dl ctladm create -b ramdisk -s 10T -o capacity=10G
+.Pp
+Create a thin provisioned LUN with a ramdisk as a backing store.
+The LUN will have maximal backing store capacity of 10 gigabytes,
+while reporting size of 10 terabytes,
.Pp
.Dl ctladm create -b block -o file=src/usr.sbin/ctladm/ctladm.8
.Pp
OpenPOWER on IntegriCloud