Re: Thin device provisioning

David Woodhouse
2008-08-13T17:04:20Z

On Wed, 2008-08-13 at 12:50 -0400, Alan D. Brunelle wrote:
> Is it expected that the file system code would emit PUNCH directives in
> "specially marked" struct bio's through the block I/O storage system?

I have implemented a 'sb_issue_discard()' function which file systems
can use to issue such bios.

This code is in the git tree at {git://, http://}
git.infradead.org/users/dwmw2/discard-2.6.git

> Then the I/O schedulers would be responsible for discriminating between
> PUNCH bio's and "normal" read/write bio's when it performed merging (and
> sorting?).

In the case of 'sb_issue_discard()', the request gets marked as a soft
barrier, which prevents the I/O schedulers from letting other requests
pass it in the queue, and from merging.

This is done to avoid problems for naïve callers when subsequent writes
are scheduled _before_ the discard request. (This can happen if the
blocks are reallocated immediately).

It's possible to issue such requests without the 'soft barrier' tag, by
manually submitting the bios (see the BLKDISCARD ioctl in the same git
tree for an example). But that leaves the submitter responsible for
ensuring that there is some form of barrier or flush before the affected
blocks are reallocated and subsequently rewritten.

> In either case, would the block I/O layer then build "specially marked"
> PUNCH requests to the underlying physical drivers?

Yes, but only ever for one range of blocks at a time.

--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html