From: Joe Thornber <thornber@redhat.com>
To: Spelic <spelic@shiftmail.org>
Cc: dm-devel@redhat.com
Subject: Re: [NOTES] thinp zeroing
Date: Thu, 23 Feb 2012 15:43:35 +0000 [thread overview]
Message-ID: <20120223154334.GA16341@ubuntu> (raw)
In-Reply-To: <4F45180C.8030801@shiftmail.org>
On Wed, Feb 22, 2012 at 05:30:04PM +0100, Spelic wrote:
> On 02/22/12 15:14, Joe Thornber wrote:
> >* Requirements
> >
> > There are two distinct requirements for zeroing applicable to the
> > thin-provisioning target:
> >
> > - Avoid data leaks (DATA_LEAK)
> >
> >* Implementing DATA_LEAK
> >
> >
> >* Implementing ERASE
> >
> >** Erase on deallocation
> >
> >
> >** Erasing from userland.
> >
> >** Crash recovery
> >
> >** Discards
> >
> >
>
> Hello
> thanks for all your hard work regarding thinp
>
> I was thinking: why don't you implement a bitmap that takes care of
> emulating the discard functionality?
>
> This would take care of all your issues above, and also be great for
> a lot of use cases even outside thinp (*).
>
> Every read would first hit the bitmap; if the bitmap says that the
> region has been discarded, thinp would return zeroes to the
> requestor.
Already done, the first thing a discard bio does is remove mappings
from the btree. It's then (optionally) handed down to the underlying
device.
> I suggest a bitmap of 4kbytes / bit, and then if a discard comes
> that is not 4K aligned (that would be a mistake of the above layers,
> at least a "performance" mistake), you set the bitmaps only for the
> bits which are completely covered by the discard, and then you are
> left with at most two misaligned edges one at the beginning and one
> at the end of the discard region, and for those you will need to
> write zeroes to the layers below. So in the worst case you need to
> set a few bits and then perform two small writes of zeroes, but in
> most cases you just set a few bits.
Things like SSDs that set the discard_zeroes_data flag are only saying
that they'll return zeroes if you read from this area. This is
different from promising the data has been overwritten with zeroes on
the disk. Hence the need in the ERASE case for real writes across the
discarded area.
- Joe
next prev parent reply other threads:[~2012-02-23 15:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-22 14:14 [NOTES] thinp zeroing Joe Thornber
2012-02-22 14:25 ` [PATCH] [dm-thin] experimental erase-log patch Joe Thornber
2012-02-22 16:30 ` [NOTES] thinp zeroing Spelic
2012-02-22 18:04 ` Zdenek Kabelac
2012-02-23 15:43 ` Joe Thornber [this message]
2012-02-23 2:49 ` Mike Snitzer
2012-02-23 15:47 ` Joe Thornber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120223154334.GA16341@ubuntu \
--to=thornber@redhat.com \
--cc=dm-devel@redhat.com \
--cc=spelic@shiftmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.