From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kent Overstreet Subject: Re: [bcachefs] time of mounting filesystem with high number of dirs aka ageing filesystem Date: Tue, 18 Oct 2016 05:04:09 -0800 Message-ID: <20161018130409.2elmg32ojy7jgwki@kmo-pixel> References: <5b822456-33cf-f373-2cf3-abea7e0cfb64@mejor.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:34677 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755723AbcJRNEN (ORCPT ); Tue, 18 Oct 2016 09:04:13 -0400 Received: by mail-pf0-f195.google.com with SMTP id 128so15141217pfz.1 for ; Tue, 18 Oct 2016 06:04:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: <5b822456-33cf-f373-2cf3-abea7e0cfb64@mejor.pl> Sender: linux-bcache-owner@vger.kernel.org List-Id: linux-bcache@vger.kernel.org To: Marcin =?utf-8?B?TWlyb3PFgmF3?= Cc: linux-bcache@vger.kernel.org On Tue, Oct 18, 2016 at 02:51:11PM +0200, Marcin Mirosław wrote: > W dniu 18.10.2016 o 14:45, Kent Overstreet pisze: > > The issue is that right now btree node coalescing is only run as a batch pass > > when mark and sweep GC runs (it has nothing to do with GC, it just runs at the > > same time in the current code). At some point we need to come up with a good way > > of triggering it as needed. > > > > Try triggering a gc, and then check mount time: > > > > echo 1 > /sys/fs/bcache//internal/trigger_gc > > No change: > [ 8417.101640] bcache (dm-12): starting mark and sweep: > [ 8433.795575] bcache (dm-12): mark and sweep done > [ 8433.795842] bcache (dm-12): starting journal replay: > [ 8433.796064] bcache (dm-12): journal replay done, 129 keys in 90 > entries, seq 28581 > [ 8433.796075] bcache (dm-12): journal replay done > [ 8433.796076] bcache (dm-12): starting fs gc: > [ 8433.799493] bcache (dm-12): fs gc done > [ 8433.799495] bcache (dm-12): starting fsck: > [ 8433.800613] bcache (dm-12): fsck done > > > /dev/mapper/system10-bcache 9,8G 421M 9,4G 5% /mnt/test Bleh. Can you check how many nodes are in each btree, post coalescing? grep -c ^l /sys/kernel/debug/bcache//*-formats Coalescing will also just skip running if the allocator doesn't have enough new nodes ready to go, rather than block on the allocator thread with locks held - you can try running it a few times, and see if it's making any progress shrinking the btrees.