From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Thornber Subject: Re: New dm-bufio with shrinker API Date: Wed, 7 Sep 2011 10:46:43 +0100 Message-ID: <20110907094642.GA3729@ubuntu> References: <20110905090428.GA3826@ubuntu> <20110905144913.GB22386@ubuntu> <20110906093332.GB3619@ubuntu> 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Mikulas Patocka Cc: Christoph Hellwig , dm-devel@redhat.com List-Id: dm-devel.ids On Tue, Sep 06, 2011 at 12:08:51PM -0400, Mikulas Patocka wrote: > So, I can implement a call "void dm_bufio_discard_buffer(struct > dm_bufio_client *c, sector_t block)" and this call will discard a specific > buffer at a specific location (the call is not guaranteed to succeed, it > would not discard if someone is holding the buffer or so). It would be > like a "bforget" function for filesystem buffers. > > You will call this function on metadata sectors that you are freeing. > > Do you agree with this interface? That's not really what I was after, but it's a good idea. Don't do anything about it now, and I'll instrument to see if I can drive it effectively. I try and recycle freed blocks as quickly as possible to avoid fragmenting free space, which may mean there is little benefit. > Other than this, I don't know how to reduce cache size, I don't know about > any algorithm that would guess cache size automatically. In operating > systems, caches usually grow without limit regardless of whether someone > needs the cache or not. ok, let's go with things as they are. Thx for your hard work. One other optimisation to think about: As you know, if a non-blocking lookup of the thinp mapping fails, the bio gets handed across to a worker thread to do the blocking lookup. Is there any way to you could make dm_bm_read_try_lock() pass a preload hint to bufio, since we know that block is going to be required in the near future? - Joe