From patchwork Fri Sep 7 14:54:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 10592241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D31513AC for ; Fri, 7 Sep 2018 14:55:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6001C2B55A for ; Fri, 7 Sep 2018 14:55:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 540722B587; Fri, 7 Sep 2018 14:55:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02C4F2B55A for ; Fri, 7 Sep 2018 14:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730015AbeIGTge (ORCPT ); Fri, 7 Sep 2018 15:36:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:50548 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728823AbeIGTge (ORCPT ); Fri, 7 Sep 2018 15:36:34 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 12148AC1F for ; Fri, 7 Sep 2018 14:55:16 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id EADDCDAD81; Fri, 7 Sep 2018 16:54:59 +0200 (CEST) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH 00/11] Cleanup dev-replace locking Date: Fri, 7 Sep 2018 16:54:59 +0200 Message-Id: X-Mailer: git-send-email 2.18.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The series peels off the custom locking that's used for dev-replace and uses read-write semaphore in the end. I've mainly focused on correctness and haven't measured the performance effects. There should be none as the blocking and waiting was merely open coding what the rw semaphore does, but without the fairness. The overall number of locks taken is low, there's a lots of IO in between so even if new scheme is slower, I don't expect any dramatic change. git://github.com/kdave/btrfs-devel.git dev/dev-replace-locking David Sterba (11): 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 btrfs: reada: reorder dev-replace locks before radix tree preload btrfs: dev-replace: swich locking to rw semaphore btrfs: dev-replace: remove custom read/write blocking scheme btrfs: dev-replace: open code trivial locking helpers fs/btrfs/ctree.h | 11 ++-- fs/btrfs/dev-replace.c | 136 ++++++++++++----------------------------- fs/btrfs/dev-replace.h | 13 ---- fs/btrfs/disk-io.c | 14 ++--- fs/btrfs/reada.c | 16 ++--- fs/btrfs/scrub.c | 26 ++++---- fs/btrfs/transaction.c | 5 +- fs/btrfs/volumes.c | 23 ++++--- 8 files changed, 87 insertions(+), 157 deletions(-)