From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: dm-cache selective promotion of block Date: Thu, 17 Dec 2015 16:18:06 -0500 Message-ID: <20151217211805.GD25386@redhat.com> References: <567308D6.8030306@nasa.gov> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <567308D6.8030306@nasa.gov> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Mahmoud Hanafi Cc: dm-devel@redhat.com, ejt@redhat.com List-Id: dm-devel.ids On Thu, Dec 17 2015 at 2:11pm -0500, Mahmoud Hanafi wrote: > 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 0 promote_oblocks dmsetup message 0 pin_oblocks and: dmsetup message 0 demote_oblocks dmsetup message 0 unpin_oblocks (where and 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