Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5936827ybi; Wed, 12 Jun 2019 11:01:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4gKcMWVjkikezceG7nxhcz5otFc5C/P3A4pp2wFOcM99sAvIrFdBTaYxMUjyahLTRoP9E X-Received: by 2002:aa7:8711:: with SMTP id b17mr30496882pfo.234.1560362486761; Wed, 12 Jun 2019 11:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560362486; cv=none; d=google.com; s=arc-20160816; b=op93TJcw//1hDjwoAdMLEg2aPumyCEKV/5wVHrXRLBbzHsXxUxmPSIiXOTlbDRAWlw U/LL0DvvI16gbMJsk2Q9tRnnUxNSu092JDZLDKjMWvEhnuTTWJmZoyo7tCzQp/smK811 dBIM+4Q8ffrdSkks6o+DyWe3W4A9j6z4YPZygLhcc0SghsjR03Kqt4TMDscvaXMcxyz+ KvkTradd1oo1Aq8dMVaZxvqthI2wylVV4s1PSOmc7IrTE82SRqcdX6jH9J+C+xNCWmG+ X5qMtIzIATrJZjUcnnrHeAYQpnq9LyyCC5c+Dh7kqdj22OtTK4QdQjzlI6akIzLsx079 p+0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=lCK5yGViad2/SejR8BThwnQB/sDcJkLhHCrJ3yf9fKg=; b=UaSfH4URusu9kU7/qWS/tHwyQIDePa8fXYUMZCPHJGBvO/X33MRGAvOE3x59Iql9fO kB3QxSJZuRFt5gbB80ldGArkQiD+jpYt+GmuM4WU3YAks63RN9SX6Dc22ayEcaRdYf/B QpM4qIdZAbHBtO3WgJcOllnCPjWbY3CoatE5u4WVZpoXUgftcgriAf0busjPSI8+uuK1 0vjbqPNpLq5M2/sgJp9qZ9yUyO5zf253E5urvWV2YFyxk2ej2IyHdd8ctxDiAUFz89cS JGV246oqjEwjCzgvGQJwMeyOIEwQ/2s6vqDgyps82hvFM91Z2O0iXcCilVM6CLXe0fH7 4jpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z18si400751pgv.229.2019.06.12.11.01.11; Wed, 12 Jun 2019 11:01:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409240AbfFLOEw (ORCPT + 99 others); Wed, 12 Jun 2019 10:04:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:37982 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2407368AbfFLOEw (ORCPT ); Wed, 12 Jun 2019 10:04:52 -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 E134CB01F; Wed, 12 Jun 2019 14:04:50 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 8BF8BDA88C; Wed, 12 Jun 2019 16:05:41 +0200 (CEST) Date: Wed, 12 Jun 2019 16:05:41 +0200 From: David Sterba To: Nikolay Borisov Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, andrea.parri@amarulasolutions.com, peterz@infradead.org, paulmck@linux.ibm.com Subject: Re: [PATCH 1/2] btrfs: Implement DRW lock Message-ID: <20190612140541.GL3563@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Nikolay Borisov , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, andrea.parri@amarulasolutions.com, peterz@infradead.org, paulmck@linux.ibm.com References: <20190606135219.1086-1-nborisov@suse.com> <20190606135219.1086-2-nborisov@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190606135219.1086-2-nborisov@suse.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 06, 2019 at 04:52:18PM +0300, Nikolay Borisov wrote: > A (D)ouble (R)eader (W)riter lock is a locking primitive that allows > to have multiple readers or multiple writers but not multiple readers > and writers holding it concurrently. The code is factored out from > the existing open-coded locking scheme used to exclude pending > snapshots from nocow writers and vice-versa. Current implementation > actually favors Readers (that is snapshot creaters) to writers (nocow > writers of the filesystem). > > Signed-off-by: Nikolay Borisov > --- > fs/btrfs/Makefile | 2 +- > fs/btrfs/drw_lock.c | 71 +++++++++++++++++++++++++++++++++++++++++++++ > fs/btrfs/drw_lock.h | 23 +++++++++++++++ In v2, please use locking.[ch] instead of new files.