Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2837342ima; Mon, 22 Oct 2018 17:24:31 -0700 (PDT) X-Google-Smtp-Source: AJdET5fLFrnkbDhVIU4Q5D+ynfOFcegfpTi2DaCWcgnMOzx4zDHKyj8LgHC4JAr16hku8PSDxYui X-Received: by 2002:a17:902:748a:: with SMTP id h10-v6mr8998756pll.187.1540254271713; Mon, 22 Oct 2018 17:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540254271; cv=none; d=google.com; s=arc-20160816; b=UYjTy+K4JNM8Tpyufl429Wm/YDTLombmYo958RdF/634U3OIR8Ec3RAzVPtiiCaOa5 helu2AwiIf1krMiXHR1M4PaQktEffKLkJIfnhLawgRmVhymZ0aX2oEoHeFBJD5uPtAOM +eUHtrcucyuPlvvprhrd9eCsktt3bQNurzYfPkQ7H6LWeXxli9mqA8ZK2VXzdTmBB367 Kv6/ArA4dOLjh1Eq91VDBr+d07dZlNVvPBlIxP4pB31LZBbgFlByEk/EHria8DcelbeJ Qtb1nFo+g1uybfDB/nnCMu8luJUnVgWgEuFsET/L7eZD+8brNk7rax7lGYAh0kNioA3I Sy2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yyO1Qq6NNA72PBLh4VooVAgD0U6WUdMXgcPn7/nQyhQ=; b=XgtkY/7Nzuhaf0INQBAM99TdN3VxdCKC/e5eKUJEwP+mgnFH2jX5IdHel/d8E2n7Vt 8UfMmVoddWJxtZRUjBFShhUO4vJ6e7KcQ5Y41SpgNEov0uBn5C8KNa0ZoiSN6vCCx7o8 zARPiHkYph8dHdktQofFo73S3clvkqtyNW0W2ff2TndvRnezU+hvlnRxPLHzygN7ZXT8 /3H2UXvdDMMwGkcxReMi2fCO8aiVJ28VHb1W3SmLkz4JyVQJTQFiZRuTx3rOE3RYCUW5 zNbDWt08PI+PMh6DHXcllVo0baNMQr3LofDf52q/Wzc0Mp5WJ4I/6WtyoR9pKgThqgzI 9cyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aCHDIEzd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9-v6si35227869pll.414.2018.10.22.17.24.16; Mon, 22 Oct 2018 17:24:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aCHDIEzd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726884AbeJWIoh (ORCPT + 99 others); Tue, 23 Oct 2018 04:44:37 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:45030 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726521AbeJWIoh (ORCPT ); Tue, 23 Oct 2018 04:44:37 -0400 Received: by mail-qt1-f196.google.com with SMTP id x24-v6so17038754qtx.11; Mon, 22 Oct 2018 17:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yyO1Qq6NNA72PBLh4VooVAgD0U6WUdMXgcPn7/nQyhQ=; b=aCHDIEzd3Yl0D91DLtg3CvVSitJgd+QBj7b5uKVnJDSewM6wLbzY25Hgen79FfBUcb UFBF+/0OS/1g9b82E8iKFx/GZSf/7bn2MTSG0KfxN+/fYj+kFHx0FY9jPEwwaQqBxk83 MgX7Cs7evqju12PjztS2NxMz6XzEfIvIPGn4q+9lheq8PwFl55PkueMOuJvXzTYOT17q bvnaDZBSsCwvsq1kyqN7WZ6hLacuTOqnceZLKPblGKyx5MzeXJWaQzddZxiChTND0TQ/ oV5TjVwpm7/a5CfmmbVO59cIfsuhaqFCHW/yo/ccK8nUVEK97bhgC+idFX1oX9HiUG9h FkYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yyO1Qq6NNA72PBLh4VooVAgD0U6WUdMXgcPn7/nQyhQ=; b=CvulEUVySgpMlggQIRrDso8aJ117PTAjwQhasqwQWFtsnOY5I9ctvcHn6EzkRQANLk V28Y4ddPDFmBr8oCfgHxBCeSGI+yaREtf97tk8SxNRZkzoMLcyT2ciLBw9QY+iEnLymD rgGpaNR+npV3gNqQYH8YoQpX/YtdkHfCTxw5OT0RqqNQCNiKkiPZJbEP3utQ4nIbuuvJ tC2wzr+VVwEz3XY7S/IXkop9QfTrqSCTy/WXcsxd2TMwdeSzQQ4bdJdIZcINoBaOr489 GA6LUiZxmdTntcWLQtXtEsJEBEJehbMCOMJCZOF8LX1Fxbi50hwL7RpLk9PKYK0osa+c +/6g== X-Gm-Message-State: ABuFfojJVNjc6WR1bVrMh86K7MEbYrqkD8Vv1/WVW5ksB0w8xNUlulCw LoDL5SrIxsZ683cGZCzgn/FdbjAqTwA4/pscUNg= X-Received: by 2002:ac8:4448:: with SMTP id m8-v6mr7487075qtn.385.1540254227428; Mon, 22 Oct 2018 17:23:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Liu Bo Date: Mon, 22 Oct 2018 17:23:36 -0700 Message-ID: Subject: Re: [GIT PULL] Btrfs updates for 4.20, part 1 To: David Sterba Cc: torvalds@linux-foundation.org, Chris Mason , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 22, 2018 at 10:24 AM David Sterba wrote: > > Hi, > > this is the first batch with fixes and some nice performance improvements. > > Preliminary results show eg. more files/sec in fsmark, better perf on > multi-threaded workloads (filebench, dbench), fewer context switches and > overall better memory allocation characteristics (multiple benchmarks). > > Apart from general performance, there's an improvement for qgroups + > balance workload that's been troubling our users. > > Note for stable: there are 20+ patches tagged for stable, out of 90. Not > all of them apply cleanly on all stable versions but the conflicts are > mostly due to simple cleanups and resolving should be obvious. The fixes > are otherwise independent. > > No merge conflicts expected. Please pull, thanks. > > > Performance improvements: > > * blocking mode of path is gone, means that only the spinning mode is used; I'd like to do a few corrections here, the transition from the spinning mode to blocking mode is removed, we still need blocking mode of path for sleeping context. thanks, liubo > the blocking resulted in more unnecessary wakeups and updates to the path > locks, the effects are measurable and improve latency and scaleability > > * qgroups: first batch of changes that should speedup balancing with qgroups > on, skip quota accounting on unchanged subtrees, overall gain is about 30+% > in runtime > > * use rb-tree with cached first node for several structures, small improvement > to avoid pointer chasing > > Fixes: > > * trim > * fix: some blockgroups could have been missed if their logical address was > past the total filesystem size (ie. after a lot of balancing) > * better error reporting, after processing blockgroups and whole device > * fix: continue trimming block groups after an error is encountered > * check for trim support of the device earlier and avoid some unnecessary work > * less interaction with transaction commit that improves latency on slower > storage (eg. image files over NFS) > > * fsync > * fix warning when replaying log after fsync of a O_TMPFILE > * fix wrong dentries after fsync of file that got its parent replaced > > * qgroups: fix rescan that might misc some dirty groups > > * don't clean dirty pages during buffered writes, this could lead to lost > updates in some corner cases > > * some block groups could have been delayed in creation, if the allocation > triggered another one > > * error handling improvements > > Cleanups: > > * removed unused struct members and variables > * function return type cleanups > * delayed refs code refactoring > > * protect against deadlock that could be caused by crafted image that tries to > allocate from a tree that's locked already > > ---------------------------------------------------------------- > The following changes since commit 35a7f35ad1b150ddf59a41dcac7b2fa32982be0e: > > Linux 4.19-rc8 (2018-10-15 07:20:24 +0200) > > are available in the Git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-4.20-part1-tag > > for you to fetch changes up to d9352794dad9f28535439d85a815978878c141ab: > > btrfs: switch return_bigger to bool in find_ref_head (2018-10-15 17:23:41 +0200) > > ---------------------------------------------------------------- > Anand Jain (2): > btrfs: add assertions where number of devices could go below 0 > btrfs: add helper to obtain number of devices with ongoing dev-replace > > Chris Mason (1): > Btrfs: don't clean dirty pages during buffered writes > > Colin Ian King (2): > btrfs: remove unused pointer inode in relink_file_extents > btrfs: remove unused pointer 'tree' in btrfs_submit_compressed_read > > David Sterba (12): > btrfs: tests: add separate stub for find_lock_delalloc_range > btrfs: tests: move testing members of struct btrfs_root to the end > btrfs: tests: group declarations of self-test helpers > btrfs: tests: polish ifdefs around testing helper > btrfs: use common helper instead of open coding a bit test > btrfs: remove btrfs_dev_replace::read_locks > btrfs: open code btrfs_dev_replace_clear_lock_blocking > btrfs: open code btrfs_dev_replace_stats_inc > btrfs: open code btrfs_after_dev_replace_commit > btrfs: dev-replace: avoid useless lock on error handling path > btrfs: dev-replace: move replace members out of fs_info > btrfs: dev-replace: remove pointless assert in write unlock > > Filipe Manana (2): > Btrfs: fix warning when replaying log after fsync of a tmpfile > Btrfs: fix wrong dentries after fsync of file that got its parent replaced > > Jeff Mahoney (5): > btrfs: fix error handling in free_log_tree > btrfs: fix error handling in btrfs_dev_replace_start > btrfs: iterate all devices during trim, instead of fs_devices::alloc_list > btrfs: don't attempt to trim devices that don't support it > btrfs: keep trim from interfering with transaction commits > > Josef Bacik (7): > btrfs: wait on caching when putting the bg cache > btrfs: release metadata before running delayed refs > btrfs: protect space cache inode alloc with GFP_NOFS > btrfs: reset max_extent_size on clear in a bitmap > btrfs: make sure we create all new block groups > btrfs: assert on non-empty delayed iputs > btrfs: drop min_size from evict_refill_and_join > > Liu Bo (19): > Btrfs: do not unnecessarily pass write_lock_level when processing leaf > Btrfs: remove always true if branch in btrfs_get_extent > Btrfs: use next_state in find_first_extent_bit > btrfs: free path at an earlier point in btrfs_get_extent > Btrfs: remove confusing tracepoint in btrfs_add_reserved_bytes > Btrfs: fix alignment in declaration and prototype of btrfs_get_extent > Btrfs: set leave_spinning in btrfs_get_extent > Btrfs: use args in the correct order for kcalloc in btrfsic_read_block > Btrfs: unify error handling of btrfs_lookup_dir_item > Btrfs: remove unnecessary level check in balance_level > Btrfs: assert page dirty bit on extent buffer pages > Btrfs: skip set_page_dirty if eb pages are already dirty > Btrfs: remove wait_ordered_range in btrfs_evict_inode > Btrfs: delayed-refs: use rb_first_cached for href_root > Btrfs: delayed-refs: use rb_first_cached for ref_tree > Btrfs: delayed-inode: use rb_first_cached for ins_root and del_root > Btrfs: extent_map: use rb_first_cached > Btrfs: preftree: use rb_first_cached > Btrfs: kill btrfs_clear_path_blocking > > Lu Fengqi (10): > btrfs: simplify the send_in_progress check in btrfs_delete_subvolume > btrfs: switch update_size to bool in btrfs_block_rsv_migrate and btrfs_rsv_add_bytes > btrfs: Remove root parameter from btrfs_insert_dir_item > btrfs: remove a useless return statement in btrfs_block_rsv_add > btrfs: qgroup: move the qgroup->members check out from (!qgroup)'s else branch > btrfs: delayed-ref: pass delayed_refs directly to btrfs_select_ref_head > btrfs: delayed-ref: pass delayed_refs directly to btrfs_delayed_ref_lock > btrfs: remove fs_info from btrfs_check_space_for_delayed_refs > btrfs: remove fs_info from btrfs_should_throttle_delayed_refs > btrfs: switch return_bigger to bool in find_ref_head > > Misono Tomohiro (2): > btrfs: Remove 'objectid' member from struct btrfs_root > btrfs: remove redundant variable from btrfs_cross_ref_exist > > Nikolay Borisov (8): > btrfs: Make btrfs_find_device_by_path return struct btrfs_device > btrfs: Make btrfs_find_device_missing_or_by_path return directly a device > btrfs: Make btrfs_find_device_by_devspec return btrfs_device directly > btrfs: Remove logically dead code from btrfs_orphan_cleanup > btrfs: handle error of get_old_root > btrfs: Factor out ref head locking code in __btrfs_run_delayed_refs > btrfs: Factor out loop processing all refs of a head > btrfs: refactor __btrfs_run_delayed_refs loop > > Omar Sandoval (2): > Btrfs: clean up scrub is_dev_replace parameter > Btrfs: get rid of btrfs_symlink_aops > > Qu Wenruo (16): > btrfs: qgroup: Dirty all qgroups before rescan > btrfs: Handle owner mismatch gracefully when walking up tree > btrfs: locking: Add extra check in btrfs_init_new_buffer() to avoid deadlock > btrfs: Enhance btrfs_trim_fs function to handle error better > btrfs: Ensure btrfs_trim_fs can trim the whole filesystem > btrfs: relocation: Add basic extent backref related comments for build_backref_tree > btrfs: qgroup: Introduce trace event to analyse the number of dirty extents accounted > btrfs: qgroup: Introduce function to trace two swaped extents > btrfs: qgroup: Introduce function to find all new tree blocks of reloc tree > btrfs: qgroup: Use generation-aware subtree swap to mark dirty extents > btrfs: qgroup: Don't trace subtree if we're dropping reloc tree > btrfs: qgroup: Only trace data extents in leaves if we're relocating data block group > btrfs: tree-checker: Check level for leaves and nodes > btrfs: qgroup: Avoid calling qgroup functions if qgroup is not enabled > btrfs: relocation: Cleanup while loop using rbtree_postorder_for_each_entry_safe > btrfs: relocation: Remove redundant tree level check > > Su Yue (1): > btrfs: defrag: use btrfs_mod_outstanding_extents in cluster_pages_for_defrag > > zhong jiang (4): > btrfs: remove unneeded NULL checks before kfree > btrfs: change btrfs_free_reserved_bytes to return void > btrfs: change btrfs_pin_log_trans to return void > btrfs: change remove_extent_mapping to return void > > fs/btrfs/backref.c | 39 ++-- > fs/btrfs/btrfs_inode.h | 8 +- > fs/btrfs/check-integrity.c | 6 +- > fs/btrfs/compression.c | 2 - > fs/btrfs/ctree.c | 68 +----- > fs/btrfs/ctree.h | 56 ++--- > fs/btrfs/delayed-inode.c | 41 ++-- > fs/btrfs/delayed-inode.h | 4 +- > fs/btrfs/delayed-ref.c | 69 +++--- > fs/btrfs/delayed-ref.h | 10 +- > fs/btrfs/dev-replace.c | 64 ++---- > fs/btrfs/dev-replace.h | 8 - > fs/btrfs/dir-item.c | 8 +- > fs/btrfs/disk-io.c | 24 +- > fs/btrfs/export.c | 4 +- > fs/btrfs/extent-tree.c | 424 +++++++++++++++++++++-------------- > fs/btrfs/extent_io.c | 33 ++- > fs/btrfs/extent_io.h | 4 +- > fs/btrfs/extent_map.c | 32 +-- > fs/btrfs/extent_map.h | 4 +- > fs/btrfs/file.c | 33 ++- > fs/btrfs/free-space-cache.c | 16 +- > fs/btrfs/inode.c | 120 ++++------ > fs/btrfs/ioctl.c | 18 +- > fs/btrfs/qgroup.c | 455 ++++++++++++++++++++++++++++++++++++-- > fs/btrfs/qgroup.h | 8 + > fs/btrfs/ref-verify.c | 8 +- > fs/btrfs/relocation.c | 74 +++---- > fs/btrfs/scrub.c | 34 ++- > fs/btrfs/send.c | 24 +- > fs/btrfs/super.c | 6 +- > fs/btrfs/tests/extent-io-tests.c | 10 +- > fs/btrfs/tests/extent-map-tests.c | 4 +- > fs/btrfs/transaction.c | 31 +-- > fs/btrfs/tree-checker.c | 14 ++ > fs/btrfs/tree-log.c | 86 +++++-- > fs/btrfs/tree-log.h | 2 +- > fs/btrfs/volumes.c | 117 +++++----- > fs/btrfs/volumes.h | 9 +- > include/trace/events/btrfs.h | 36 ++- > 40 files changed, 1268 insertions(+), 745 deletions(-)