From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753419AbdBAWX3 (ORCPT ); Wed, 1 Feb 2017 17:23:29 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:39508 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752974AbdBAWX2 (ORCPT ); Wed, 1 Feb 2017 17:23:28 -0500 Date: Wed, 1 Feb 2017 14:23:26 -0800 From: Matthew Wilcox To: Dan Williams Cc: Konstantin Khlebnikov , "linux-kernel@vger.kernel.org" Subject: Re: Radix tree range entries Message-ID: <20170201222326.GA2267@bombadil.infradead.org> References: <20170131165918.GA20574@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 01, 2017 at 10:48:08AM -0800, Dan Williams wrote: > On Tue, Jan 31, 2017 at 8:59 AM, Matthew Wilcox wrote: > > We have a confirmed customer in the shape of devm_memremap_pages(), so > > add support for range entries. The documentation lists caveats on their > > use, but none of these caveats apply to the one user. > > > > Signed-off-by: Matthew Wilcox > > Thanks, I'll take a look. This will let me get rid of the order_at() > hack I have in devm_memremap_pages(). I assume there's no requirement > that 'start' be aligned to 'len' when calling > radix_tree_insert_range()? No alignment restrictions. If you find something that doesn't work, let me know. From the test suite: + for (start = 0; start < 100; start++) { + for (len = 1; len < 100; len++) { + range_check_1(&tree, start, len); + } + } The only restrictions I have is that len must be >0 and start+len can't wrap past ~0UL. These seem like reasonable restrictions to me. Maybe we have some users who want to change the index type from unsigned long to unsigned long long, but I think 32-bit machines are dying out fast enough that we don't care.