From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: Re: [PATCH v5 03/78] xarray: Add the xa_lock to the radix_tree_root Date: Wed, 27 Dec 2017 13:17:18 +0300 Message-ID: <20171227101718.o7ucns4garbsm5ju@node.shutemov.name> References: <20171215220450.7899-1-willy@infradead.org> <20171215220450.7899-4-willy@infradead.org> <20171226165440.tv6inwa2fgk3bfy6@node.shutemov.name> <20171227034340.GC24828@bombadil.infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20171227034340.GC24828@bombadil.infradead.org> Sender: owner-linux-mm@kvack.org To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, Matthew Wilcox , Ross Zwisler , David Howells , Shaohua Li , Jens Axboe , Rehas Sachdeva , Marc Zyngier , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-usb@vger.kernel.org, linux-raid@vger.kernel.org List-Id: linux-f2fs-devel.lists.sourceforge.net On Tue, Dec 26, 2017 at 07:43:40PM -0800, Matthew Wilcox wrote: > On Tue, Dec 26, 2017 at 07:54:40PM +0300, Kirill A. Shutemov wrote: > > On Fri, Dec 15, 2017 at 02:03:35PM -0800, Matthew Wilcox wrote: > > > From: Matthew Wilcox > > > > > > This results in no change in structure size on 64-bit x86 as it fits in > > > the padding between the gfp_t and the void *. > > > > The patch does more than described in the subject and commit message. At first > > I was confused why do you need to touch idr here. It took few minutes to figure > > it out. > > > > Could you please add more into commit message about lockname and xa_ locking > > interface since you introduce it here? > > Sure! How's this? > > xarray: Add the xa_lock to the radix_tree_root > > This results in no change in structure size on 64-bit x86 as it fits in > the padding between the gfp_t and the void *. > > Initialising the spinlock requires a name for the benefit of lockdep, > so RADIX_TREE_INIT() now needs to know the name of the radix tree it's > initialising, and so do IDR_INIT() and IDA_INIT(). > > Also add the xa_lock() and xa_unlock() family of wrappers to make it > easier to use the lock. If we could rely on -fplan9-extensions in > the compiler, we could avoid all of this syntactic sugar, but that > wasn't added until gcc 4.6. > Looks great, thanks. -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: [v5,03/78] xarray: Add the xa_lock to the radix_tree_root From: "Kirill A. Shutemov" Message-Id: <20171227101718.o7ucns4garbsm5ju@node.shutemov.name> Date: Wed, 27 Dec 2017 13:17:18 +0300 To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, Matthew Wilcox , Ross Zwisler , David Howells , Shaohua Li , Jens Axboe , Rehas Sachdeva , Marc Zyngier , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-usb@vger.kernel.org, linux-raid@vger.kernel.org List-ID: T24gVHVlLCBEZWMgMjYsIDIwMTcgYXQgMDc6NDM6NDBQTSAtMDgwMCwgTWF0dGhldyBXaWxjb3gg d3JvdGU6Cj4gT24gVHVlLCBEZWMgMjYsIDIwMTcgYXQgMDc6NTQ6NDBQTSArMDMwMCwgS2lyaWxs IEEuIFNodXRlbW92IHdyb3RlOgo+ID4gT24gRnJpLCBEZWMgMTUsIDIwMTcgYXQgMDI6MDM6MzVQ TSAtMDgwMCwgTWF0dGhldyBXaWxjb3ggd3JvdGU6Cj4gPiA+IEZyb206IE1hdHRoZXcgV2lsY294 IDxtYXdpbGNveEBtaWNyb3NvZnQuY29tPgo+ID4gPiAKPiA+ID4gVGhpcyByZXN1bHRzIGluIG5v IGNoYW5nZSBpbiBzdHJ1Y3R1cmUgc2l6ZSBvbiA2NC1iaXQ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l9JTklUKCkgYW5kIElEQV9JTklUKCkuCj4g ICAgIAo+ICAgICBBbHNvIGFkZCB0aGUgeGFfbG9jaygpIGFuZCB4YV91bmxvY2soKSBmYW1pbHkg b2Ygd3JhcHBlcnMgdG8gbWFrZSBpdAo+ICAgICBlYXNpZXIgdG8gdXNlIHRoZSBsb2NrLiAgSWYg d2UgY291bGQgcmVseSBvbiAtZnBsYW45LWV4dGVuc2lvbnMgaW4KPiAgICAgdGhlIGNvbXBpbGVy LCB3ZSBjb3VsZCBhdm9pZCBhbGwgb2YgdGhpcyBzeW50YWN0aWMgc3VnYXIsIGJ1dCB0aGF0Cj4g ICAgIHdhc24ndCBhZGRlZCB1bnRpbCBnY2MgNC42Lgo+IAoKTG9va3MgZ3JlYXQsIHRoYW5rcy4K From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com ([74.125.82.48]:44628 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990AbdL0KRW (ORCPT ); Wed, 27 Dec 2017 05:17:22 -0500 Received: by mail-wm0-f48.google.com with SMTP id t8so38572228wmc.3 for ; Wed, 27 Dec 2017 02:17:21 -0800 (PST) Date: Wed, 27 Dec 2017 13:17:18 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH v5 03/78] xarray: Add the xa_lock to the radix_tree_root Message-ID: <20171227101718.o7ucns4garbsm5ju@node.shutemov.name> References: <20171215220450.7899-1-willy@infradead.org> <20171215220450.7899-4-willy@infradead.org> <20171226165440.tv6inwa2fgk3bfy6@node.shutemov.name> <20171227034340.GC24828@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171227034340.GC24828@bombadil.infradead.org> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, Matthew Wilcox , Ross Zwisler , David Howells , Shaohua Li , Jens Axboe , Rehas Sachdeva , Marc Zyngier , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-usb@vger.kernel.org, linux-raid@vger.kernel.org On Tue, Dec 26, 2017 at 07:43:40PM -0800, Matthew Wilcox wrote: > On Tue, Dec 26, 2017 at 07:54:40PM +0300, Kirill A. Shutemov wrote: > > On Fri, Dec 15, 2017 at 02:03:35PM -0800, Matthew Wilcox wrote: > > > From: Matthew Wilcox > > > > > > This results in no change in structure size on 64-bit x86 as it fits in > > > the padding between the gfp_t and the void *. > > > > The patch does more than described in the subject and commit message. At first > > I was confused why do you need to touch idr here. It took few minutes to figure > > it out. > > > > Could you please add more into commit message about lockname and xa_ locking > > interface since you introduce it here? > > Sure! How's this? > > xarray: Add the xa_lock to the radix_tree_root > > This results in no change in structure size on 64-bit x86 as it fits in > the padding between the gfp_t and the void *. > > Initialising the spinlock requires a name for the benefit of lockdep, > so RADIX_TREE_INIT() now needs to know the name of the radix tree it's > initialising, and so do IDR_INIT() and IDA_INIT(). > > Also add the xa_lock() and xa_unlock() family of wrappers to make it > easier to use the lock. If we could rely on -fplan9-extensions in > the compiler, we could avoid all of this syntactic sugar, but that > wasn't added until gcc 4.6. > Looks great, thanks. -- Kirill A. Shutemov