From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5CF3C433F5 for ; Tue, 26 Apr 2022 20:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354504AbiDZUMV (ORCPT ); Tue, 26 Apr 2022 16:12:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354464AbiDZUMK (ORCPT ); Tue, 26 Apr 2022 16:12:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C09C162F14 for ; Tue, 26 Apr 2022 13:09:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 05CB5B822AA for ; Tue, 26 Apr 2022 20:09:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8337EC385A0; Tue, 26 Apr 2022 20:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1651003738; bh=Qwed+C79D8lks+RIeSv7PbPzhqtu6lXzek9ZYCiYAOo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OWv71skeoIO7MVnnXssCP5G13aIy2I8gnnD1pTuXHmbcv8ipu+W4CFXRpvdQVWq9t k2tcyPH+6m3rO5qgKJxJWF545u7QGbaoYn+YIJH4c1j3hhoNlkQMOx06oGL2BNP71f 8PCYmhNJxea2CoN+w31AuXab3ecSjhpArLUWw4AM= Date: Tue, 26 Apr 2022 13:08:57 -0700 From: Andrew Morton To: Liam Howlett Cc: "maple-tree@lists.infradead.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Yu Zhao Subject: Re: [PATCH v8 00/70] Introducing the Maple Tree Message-Id: <20220426130857.09f40743b42b5f0bf4f19a59@linux-foundation.org> In-Reply-To: <20220426150616.3937571-1-Liam.Howlett@oracle.com> References: <20220426150616.3937571-1-Liam.Howlett@oracle.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Apr 2022 15:06:19 +0000 Liam Howlett wrote: > The maple tree is an RCU-safe range based B-tree designed to use modern > processor cache efficiently. There are a number of places in the kernel I think it would be helpful to expand on "a number of places". Specifically which places? > that a non-overlapping range-based tree would be beneficial, especially > one with a simple interface. The first user that is covered in this > patch set is the vm_area_struct, where three data structures are > replaced by the maple tree: the augmented rbtree, the vma cache, and the > linked list of VMAs in the mm_struct. The long term goal is to reduce > or remove the mmap_sem contention. "mmap_lock" ;) > > The tree has a branching factor of 10 for non-leaf nodes and 16 for leaf > nodes. With the increased branching factor, it is significantly shorter than > the rbtree so it has fewer cache misses. The removal of the linked list > between subsequent entries also reduces the cache misses and the need to pull > in the previous and next VMA during many tree alterations. Do we have any quantitative testing results? What's the plan on utilizing this to further reduce mmap_lock contention?