Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755984AbcK2ACx (ORCPT ); Mon, 28 Nov 2016 19:02:53 -0500 Received: from merlin.infradead.org ([205.233.59.134]:37092 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751515AbcK2ACn (ORCPT ); Mon, 28 Nov 2016 19:02:43 -0500 Subject: Re: [PATCH v3 24/33] radix-tree: Add radix_tree_split To: Matthew Wilcox , linux-kernel@vger.kernel.org, Andrew Morton , Konstantin Khlebnikov , Ross Zwisler References: <1480369871-5271-1-git-send-email-mawilcox@linuxonhyperv.com> <1480369871-5271-25-git-send-email-mawilcox@linuxonhyperv.com> Cc: Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, "Kirill A . Shutemov" From: Randy Dunlap Message-ID: Date: Mon, 28 Nov 2016 16:02:35 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <1480369871-5271-25-git-send-email-mawilcox@linuxonhyperv.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2430 Lines: 63 On 11/28/16 13:50, Matthew Wilcox wrote: > From: Matthew Wilcox > > This new function splits a larger multiorder entry into smaller entries > (potentially multi-order entries). These entries are initialised to > RADIX_TREE_RETRY to ensure that RCU walkers who see this state aren't > confused. The caller should then call radix_tree_for_each_slot() and > radix_tree_replace_slot() in order to turn these retry entries into the > intended new entries. Tags are replicated from the original multiorder > entry into each new entry. > > Signed-off-by: Matthew Wilcox > --- > include/linux/radix-tree.h | 12 +++ > lib/radix-tree.c | 142 +++++++++++++++++++++++++++++++++- > tools/testing/radix-tree/multiorder.c | 64 +++++++++++++++ > 3 files changed, 214 insertions(+), 4 deletions(-) > > diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h > index 935293a..1f4b561 100644 > --- a/include/linux/radix-tree.h > +++ b/include/linux/radix-tree.h > @@ -293,6 +301,8 @@ void __radix_tree_replace(struct radix_tree_root *root, > struct radix_tree_node *node, > void **slot, void *item, > radix_tree_update_node_t update_node, void *private); > +void radix_tree_iter_replace(struct radix_tree_root *, > + const struct radix_tree_iter *, void **slot, void *item); above > void radix_tree_replace_slot(struct radix_tree_root *root, > void **slot, void *item); > void __radix_tree_delete_node(struct radix_tree_root *root, > @@ -335,6 +345,8 @@ static inline void radix_tree_preload_end(void) > preempt_enable(); > } > > +int radix_tree_split(struct radix_tree_root *, unsigned long index, > + unsigned new_order); and above: and in patch 25/33: Add radix_tree_split_preload() As indicated in CodingStyle: In function prototypes, include parameter names with their data types. Although this is not required by the C language, it is preferred in Linux because it is a simple way to add valuable information for the reader. > int radix_tree_join(struct radix_tree_root *, unsigned long index, > unsigned new_order, void *); > Yes, the source file already omits some function prototype parameter names, so these patches just follow that tradition. It's weird (to me) though that the existing code even mixes this style in one function prototype (see immed. above). Thanks. -- ~Randy