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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04EFDC433ED for ; Fri, 14 May 2021 10:58:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7DBC26144C for ; Fri, 14 May 2021 10:58:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DBC26144C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F17916B0036; Fri, 14 May 2021 06:58:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EC7C76B006E; Fri, 14 May 2021 06:58:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D68B36B0070; Fri, 14 May 2021 06:58:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id A785D6B0036 for ; Fri, 14 May 2021 06:58:33 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 41F40824999B for ; Fri, 14 May 2021 10:58:33 +0000 (UTC) X-FDA: 78139538106.40.60424D2 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 5080BE000112 for ; Fri, 14 May 2021 10:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rp0MFY3tjhifvpdQ3ak+U9cvay2sYh6AQ1zrO+iYeuA=; b=UZsUULYKG7CXxhG3WkNhkA1pA5 ccx270IsOy+j8VbWr7M06WPzOA+si5JQtlE11yRcHBHSCcgLpJDDIzxZnPz487SNZr6DPdMz8MvK1 rsUhwu9DdRB+QBmaGqfC5zAoImI2uWVwPShZu6qhsYx0d91DzLW+Dyke5TEAHh/ts7oRVcbmkiucH WL9Ie5FgbkZJTf2mIkCtD9DtRNKXU34hIo7ynF8fDf9McQ2ehyf7r7TqBOVvPMZ5wyz7xzm4srLqB rQC8oeGgZssWyqnADPdrjSFuQaE4bl4lRGUzKaX3/sWA3bIAeHfaLOLk5id2mytx5cRI9LDCgOtim P8EOhUkg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lhVUq-00AIXS-Vg; Fri, 14 May 2021 10:57:04 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9C0EA300223; Fri, 14 May 2021 12:56:43 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8383720829F97; Fri, 14 May 2021 12:56:43 +0200 (CEST) Date: Fri, 14 May 2021 12:56:43 +0200 From: Peter Zijlstra To: Liam Howlett Cc: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton , Song Liu , Davidlohr Bueso , "Paul E . McKenney" , Matthew Wilcox , Laurent Dufour , David Rientjes , Axel Rasmussen , Suren Baghdasaryan , Vlastimil Babka , Rik van Riel , Michel Lespinasse Subject: Re: [PATCH 26/94] Maple Tree: Add new data structure Message-ID: References: <20210428153542.2814175-1-Liam.Howlett@Oracle.com> <20210428153542.2814175-27-Liam.Howlett@Oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210428153542.2814175-27-Liam.Howlett@Oracle.com> Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=UZsUULYK; dmarc=none; spf=none (imf13.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org X-Stat-Signature: n4ka7ut4z7zkcqa5xws9px5x7ro3jqww X-Rspamd-Queue-Id: 5080BE000112 X-Rspamd-Server: rspam02 X-HE-Tag: 1620989911-464240 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: Cc'ing a moderated list is sodding annoying, dropped it. On Wed, Apr 28, 2021 at 03:36:02PM +0000, Liam Howlett wrote: > +struct maple_range_64 { > + struct maple_pnode *parent; > + unsigned long pivot[MAPLE_RANGE64_SLOTS - 1]; > + void __rcu *slot[MAPLE_RANGE64_SLOTS]; > +}; > + > +struct maple_arange_64 { > + struct maple_pnode *parent; > + unsigned long pivot[MAPLE_ARANGE64_SLOTS - 1]; > + void __rcu *slot[MAPLE_ARANGE64_SLOTS]; > + unsigned long gap[MAPLE_ARANGE64_SLOTS]; > + unsigned char meta; > +}; > + > +struct maple_alloc { > + unsigned long total; > + unsigned char node_count; > + unsigned int request_count; > + struct maple_alloc *slot[MAPLE_ALLOC_SLOTS]; > +}; > + > +struct maple_topiary { > + struct maple_pnode *parent; > + struct maple_enode *next; /* Overlaps the pivot */ > +}; > + > +enum maple_type { > + maple_dense, > + maple_leaf_64, > + maple_range_64, > + maple_arange_64, > +}; > +struct maple_node { > + union { > + struct { > + struct maple_pnode *parent; > + void __rcu *slot[MAPLE_NODE_SLOTS]; > + }; > + struct { > + void *pad; > + struct rcu_head rcu; > + unsigned int ma_flags; > + enum maple_type type; > + }; > + struct maple_range_64 mr64; > + struct maple_arange_64 ma64; > + struct maple_alloc alloc; > + }; > +}; This is somewhat inconsistent; would it make sense to have struct maple_dense and struct maple_leaf_64, and maybe even struct maple_free, such that one can write: struct maple_node { union { /* maple_type: */ struct maple_dense md; struct maple_leaf_64 ml64; struct maple_range_64 mr64; struct maple_arange_64 ma64; /* internal, life-time: */ struct maple_alloc alloc; struct maple_free free; }; }; Or something along those lines.