Skip to contentSkip to conversation

dm-cache selective promotion of block

DISCUSSION Mahmoud Hanafi 3 participants 3 messages Dec 17, 2015 – Dec 18, 2015 Device mapper

lore
Share & tools
lore
#0 lore raw

We are experimenting with dm-cache and would like to be able to promote a range of block and pin them in the cache device.

Are there any tool that can be used for this?

Signature · 6 lines
Mahmoud Hanafi
NASA Ames Research Center
Mail Stop 258-6
Bldg. 258
P.O. Box 1
Moffett Field, CA 94035
#1 lore raw
Quoted 4 lines · Mahmoud Hanafi

We are experimenting with dm-cache and would like to be able to promote a range of block and pin them in the cache device.

Are there any tool that can be used for this?

There isn't an interface to do that right now. But it _should_ be possible to add a DM message to easily promote an origin block range. Pinning isn't something we really do at this point so that'd require more work.

But it could look something like this:
dmsetup message <cache_dev> 0 promote_oblocks <start> <end> dmsetup message <cache_dev> 0 pin_oblocks <start> <end>

and:
dmsetup message <cache_dev> 0 demote_oblocks <start> <end> dmsetup message <cache_dev> 0 unpin_oblocks <start> <end>

(where <start> and <end> are in either cache_block_size units or 512b sectors... not sure which would be best, sectors is a bit more approachable)

I could see this getting a bit cumbersome, not to mention the smq cache policy really _should_ promote if it makes sense to cache a block, but we'll certainly need Joe's thoughts on this.

Mike

#2 lore raw
In reply to Mahmoud Hanafi
Quoted 4 lines · Mahmoud Hanafi

We are experimenting with dm-cache and would like to be able to promote a range of block and pin them in the cache device.

Are there any tool that can be used for this?

Not at the moment.

Could expand more on why you feel the need for this? Is this something you want just for experimentation or would you want to use it in production? How do you know which blocks you want to pin? If the pinned blocks are in large regions do you actually just want to build a device that is composed of linear mappings to a mixture of spindle and ssd devices?

- Joe