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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82808C433F5 for ; Tue, 26 Apr 2022 20:09:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 146566B0073; Tue, 26 Apr 2022 16:09:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0CFF26B0074; Tue, 26 Apr 2022 16:09:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E89C66B0075; Tue, 26 Apr 2022 16:09:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id D835B6B0073 for ; Tue, 26 Apr 2022 16:09:01 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id A34A51209FB for ; Tue, 26 Apr 2022 20:09:01 +0000 (UTC) X-FDA: 79400118882.25.5CF69A5 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf15.hostedemail.com (Postfix) with ESMTP id 68CABA0042 for ; Tue, 26 Apr 2022 20:08:56 +0000 (UTC) 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 EC8ECB822A9; Tue, 26 Apr 2022 20:08:59 +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 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 68CABA0042 X-Stat-Signature: mds1qnipenhcumnskg78bbj94pjwqt7a Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=OWv71ske; dmarc=none; spf=pass (imf15.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspam-User: X-HE-Tag: 1651003736-968719 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?