From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757763AbcH3WxX (ORCPT ); Tue, 30 Aug 2016 18:53:23 -0400 Received: from mga02.intel.com ([134.134.136.20]:8057 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751202AbcH3WxV (ORCPT ); Tue, 30 Aug 2016 18:53:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,259,1470726000"; d="scan'208";a="1033363312" Date: Tue, 30 Aug 2016 16:53:16 -0600 From: Ross Zwisler To: Dan Williams Cc: Ross Zwisler , Matthew Wilcox , Konstantin Khlebnikov , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH RFC 1/4] lib/radix: add universal radix_tree_fill_range Message-ID: <20160830225316.GA10789@linux.intel.com> References: <147230727479.9957.1087787722571077339.stgit@zurg> <20160827180927.GA22919@linux.intel.com> <20160830220353.GB20121@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 30, 2016 at 03:21:24PM -0700, Dan Williams wrote: > On Tue, Aug 30, 2016 at 3:03 PM, Ross Zwisler > wrote: > > On Tue, Aug 30, 2016 at 02:56:17PM -0700, Dan Williams wrote: > >> On Mon, Aug 29, 2016 at 11:52 AM, Matthew Wilcox wrote: > >> > It may be protected by the mapping lock in the current code, but I would it expect it to become an RCU lookup + lock eventually. No mapping lock, just like the page cache. > >> > > >> > Even if we can work around it, why do we want to? What's the compelling reason to change from the current radix tree representation of order-N entries to an arbitrary range? There are no in-kernel users right now; is there a performance reason to change? We don't usually change an API in anticipation of future users appearing, particularly when the API makes it harder for the existing users to use it. > >> > >> I'd use a fill range api for the radix backing get_dev_pagemap() and > >> potentially another use in device-dax. It centralizes the common > >> routine of breaking down a range into its constituent power-of-2 > >> ranges. > > > > Does your usage not work with the current sibling & canonical entry model? > > It does, but I find myself writing code to walk a range and determine > the order of each entry as I insert them. I can see other users > needing the same sort of insert helper and the aspect I like of > Konstantin's proposed change is that the functionality is part of the > core implementation rather than left to be duplicated in each user. Perhaps the answer is to have them both? Matthew's multi-order radix functionality with siblings for those of us that really *want* a single canonical entry that we can look up, use tags on, etc. And Konstantin's method where we insert a bunch of duplicate entries that don't have sibling pointers? Is there a reason why they can't coexist?