From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kent Overstreet Subject: Re: reverse link from bucket to keys Date: Thu, 11 Jul 2013 19:41:25 -0700 Message-ID: <20130712024125.GC30223@kmo-pixel> References: <20130710230257.GD13527@kmo-pixel> <20130712021057.GA30223@kmo-pixel> <20130712022551.GB30223@kmo-pixel> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-bcache-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: sheng qiu Cc: linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-bcache@vger.kernel.org On Thu, Jul 11, 2013 at 10:29:23PM -0400, sheng qiu wrote: > sure, in your btree.c code, when you do btree gc, you update the > bucket's used sectors by min(unsigned, GC_SECTORS_USED(b)+key_size(), > 1<<14-1). this might get you larger than the bucket size. since the > newly allocated bucket is set to bucket size already. so each round > you will accumulate the key_size(). i print the information at that > point, and see GC_SECTORS_USED > bucket size. Hey, I think you're right - btree_gc_start() is supposed to be zeroing out GC_SECTORS_USED() (the same place it does SET_GC_MARK(b, GC_MARK_RECLAIMABLE)) - but that's missing. Thanks!