From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kent Overstreet Subject: Re: reverse link from bucket to keys Date: Wed, 10 Jul 2013 16:02:57 -0700 Message-ID: <20130710230257.GD13527@kmo-pixel> References: <20130708214859.GB1959@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 Wed, Jul 10, 2013 at 05:14:49PM -0400, sheng qiu wrote: > Hi Kent, > > i am sorry to bother you again. i am reading the movinggc.c, i am > really interested in this piece of codes. So if i enable the copy_gc, > this piece of codes will be active. My question is after the gc_moving > confirmed the gc_moving_threshold, it began to scan the bkeys. i do > not quite understand how you fill the moving_gc_keys, do you go > through all the current btree nodes to find proper keys for migration > (the bucket.used_sectors < threshold)? or you do incremental scans? Incremental scans - the keybuf code scans the btree until it has some arbitrary number of keys in a red black tree; the copy gc code pulls keys out of that one at a time to move them and the keybuf code refills itself by scanning incrementally as needed.