All of lore.kernel.org
 help / color / mirror / Atom feed
* Announcement: new device-mapper thin provisioning target with infrastructure online for review
@ 2011-01-25 16:19 Heinz Mauelshagen
  2011-01-25 20:07 ` Phillip Susi
  0 siblings, 1 reply; 3+ messages in thread
From: Heinz Mauelshagen @ 2011-01-25 16:19 UTC (permalink / raw)
  To: dm-devel


A new device-mapper thin provisioning target together with supporting
block-manager, btree, space-map and transaction-manager infrastructure
is online at

https://github.com/jthornber/linux-2.6

for review.

We are interested in correctness and performance test results and
senseful coding related change requests.

Please find more details below and provide any feedback
through dm-devel@redhat.com.

Heinz and Joe.


---
The thin provisioning target is on branch "thin-provisioning" including
its respective infrastructure:

drivers/md/dm-thin-prov.c       (target)
drivers/md/thinp-metadata.[ch]  (infrastructure wrappers)
drivers/md/persistent-data/*    (infrastructure; see below)

This target allows for creation of thin provisioned mapped devices with
housekeeping persistent metadata on a backing store device separate from
the data device holding provisioned blocks. The block size is selectable
on thin provisioned device creation and the data device is extensible.
Each thin provisioned device has its own pair of metadata and data
devices.
Instructions how to use the target follow further down.

---
The supporting infrastructure itself, which we intend to utilize with
other functionality (eg. snapshots), is on branch "persistent-data"
in directory drivers/md/persistent-data/:

block-manager.c       Kconfig                space-map-dummy.c
block-manager.h       Makefile               space-map.h
block-manager-test.c  pd-module.c            space-map-staged.c
btree.c               space-map-staged.h     btree.h
space-map-core.c      space-map-test.c       btree-internal.h
space-map-core.h      transaction-manager.c  btree-spine.c
space-map-disk.c      transaction-manager.h  btree-test.c
space-map-disk.h

block-manager*; a low level block pool creation and (locked)
                block io API.

btree*: hierarchical b+-tree with arbitrary values API

space-map*: API to keep record of how many times a block-manager
            block is being referenced

transaction-manager*: 2 phase commit API to allow for
                      consistent multi-block updates

pd-module.c: tiny kernel module helper


---
Using the thin provisioning target

Table line syntax (also see thinp_ctr() in dm-thin-prov.c):

<start> <len> thin-prov \
<data_dev> <meta_dev> <data_block_size> <low_water_mark>

* data_dev: device holding thin provisioned data blocks
* meta_dev: device keeping track of provisioned blocks
* data_block_size: provisioning unit size in sectors
* low_water_mark: block low water mark to throw a dm event
  for userpace to resize


E.g.:

0 16777216 thin-prov \
/dev/tst/thin-prov-data /dev/tst/thin-prov-meta 32786 16

defines an 8GB thin provisioned mapped device using logical volumes
tst/thin-prov-meta and tst/thin-prov-data for metadata and data backing
stores respectively with a block size of 16MB and a low water mark of 16
blocks. Support to resize the data device is implemented but the
metadata device should be large enough.

Use the following formula to do the calculation:
sz[4KB blocks] = \
1 + ceiling(device size / block size / 255) * 3

metadata_dev_size[KB] = (sz > 100 ? sz : 100) * 4KB

So, for the above example, assuming a data device size of 1GB,
this results in::
1 + ceiling(2097152 / 32768 / 255) * 3 = 4
4 is smaller than 100 so we'll go by 400KB.

The metadata logical volume has 1 extent allocated, thus there's
typically at least 4MB space available, which would allow for more than
87000 blocks.
I.e. a thin provisioned device capacity larger than 1.32TB.


Create the mapped device:

dmsetup create --table \
"0 16777216 thin-prov \
/dev/tst/thin-prov-data /dev/tst/thin-prov-meta 32786 16" thin-dev


Access /dev/mapper/thin-dev for arbitrary use (mkfs, mount, ...).


Resize the data device:

#!/bin/sh
# Assuming data device size was smaller than 4GB
dmsetup wait thin-dev
lvextend -L4G tst/thin-prov-data
echo "0 16777216 thin-prov \
/dev/tst/thin-prov-data /dev/tst/thin-prov-meta 32786 16"| \
dmsetup load
dmsetup suspend --noflush thin-dev
dmsetup resume thin-dev


Resize the thin provisioned device to 16GB:

echo "0 33554432 thin-prov \
/dev/tst/thin-prov-data /dev/tst/thin-prov-meta 32786 16"| \
dmsetup load
dmsetup suspend --noflush thin-dev
dmsetup resume thin-dev


Remove the idle (e.g. unmounted) mapped device:

dmsetup remove thin-dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Announcement: new device-mapper thin provisioning target with infrastructure online for review
  2011-01-25 16:19 Announcement: new device-mapper thin provisioning target with infrastructure online for review Heinz Mauelshagen
@ 2011-01-25 20:07 ` Phillip Susi
  2011-01-26  8:29   ` Joe Thornber
  0 siblings, 1 reply; 3+ messages in thread
From: Phillip Susi @ 2011-01-25 20:07 UTC (permalink / raw)
  To: heinzm, device-mapper development

On 1/25/2011 11:19 AM, Heinz Mauelshagen wrote:
> Using the thin provisioning target
> 
> Table line syntax (also see thinp_ctr() in dm-thin-prov.c):
> 
> <start> <len> thin-prov \
> <data_dev> <meta_dev> <data_block_size> <low_water_mark>
> 
> * data_dev: device holding thin provisioned data blocks
> * meta_dev: device keeping track of provisioned blocks
> * data_block_size: provisioning unit size in sectors
> * low_water_mark: block low water mark to throw a dm event
>   for userpace to resize

I assume that meta_dev can't, but can data_dev be shared between
multiple thin-prov targets?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Announcement: new device-mapper thin provisioning target with infrastructure online for review
  2011-01-25 20:07 ` Phillip Susi
@ 2011-01-26  8:29   ` Joe Thornber
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Thornber @ 2011-01-26  8:29 UTC (permalink / raw)
  To: device-mapper development; +Cc: heinzm

On Tue, 2011-01-25 at 15:07 -0500, Phillip Susi wrote:
> I assume that meta_dev can't, but can data_dev be shared between
> multiple thin-prov targets?

Nope, we're working on a target which does allow multiple
thinp/snapshots to be stored in the same metadata and data volumes. 

With the thinp target the idea is to allocate very little excess space
in the data volume, and allow dm-eventd to automatically do the resizing
as it grows (Alasdair's currently working on the userland tools).

- Joe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-26  8:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 16:19 Announcement: new device-mapper thin provisioning target with infrastructure online for review Heinz Mauelshagen
2011-01-25 20:07 ` Phillip Susi
2011-01-26  8:29   ` Joe Thornber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.