Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3260458ybi; Tue, 2 Jul 2019 04:54:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIMpSMpqbDlPVDNTNXYRNrZOF98ImKnVhE82SZsM0rOoBvOQuoq4+tNEaxXAj3AUka2nYi X-Received: by 2002:a63:f857:: with SMTP id v23mr16081645pgj.228.1562068477478; Tue, 02 Jul 2019 04:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562068477; cv=none; d=google.com; s=arc-20160816; b=oFHuRw3jzk9GGmy8Sx+csYMjW6n7cHLTR8xM8ZHfN214zW5726F2a9LRBrpY3Ar2Oy YwidhLKqRLI0lSlhTWHS0Y/+05T4J/dY26j0Agj6QMT7E7JK0LvKrwj0wv4ShJb0tJ1g ajpZOmvNDeKrOmkRpwaiUyFdPA7tKUokvCH6Qp4Ew86YMrDJ7lYlfBn6e6ycmKtRQ28v iL5L/uGjKifLrwCP2rm6gjW3g5tlH+J7AUiTdmYtGVaXQleM51zYyZKJuCf+PkSbcOeY FFrXLGmK9KkiwHjQwCOywz4BLQcJStcsIsVwMMRUgweXMpVsgY8a/Bfb5YsS9Q+C/lZo VqoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KivUfw0UpPHi/jywdtXkWv/9JWzg9WItCIYSF+g/vcU=; b=vhgpxuMjaxK3C0MgpngvwI+hTujbViHZOef9/DZu5g9/sK4gIG2sYdu/Dgxw36oOMy xWmfrqeXUMtyXZ+WWu+X3suQrGQjLNPQ4S11h0zCEl5qCPP25qrcAtw1smV9h/c8Zb7H qfiofMrWCW7xvSnKO/axcH50Uq2V7g0jhruKFft729VZ7aJL5neqY5ZF0IswW2d12+BP mGcynkauhDZX1MeUdS0XCc+fIAf18VizfWtmjRwDWgy8b/7BYtaEdEbVvMNALGoNMXLd vGZs0avJW/gV7VlVF/Ap6ERQn99RxLLcG7BmhcLBQrkI4HO3aqxjxLY0GEyh7lBe+5Ju oFcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=d5pCPnku; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l185si14340789pfl.190.2019.07.02.04.54.22; Tue, 02 Jul 2019 04:54:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=d5pCPnku; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726966AbfGBLwh (ORCPT + 99 others); Tue, 2 Jul 2019 07:52:37 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46576 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726303AbfGBLwg (ORCPT ); Tue, 2 Jul 2019 07:52:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KivUfw0UpPHi/jywdtXkWv/9JWzg9WItCIYSF+g/vcU=; b=d5pCPnkuIr/MGiRsHIvC3m9B/ j0ikko+1BOJ4P/wXRn+oWRa1g8Ul3p1/TMy6hMPhJYWBuspL0py481eJWlc90ms4K2xYusOJs1gSB EYmTmqXwziaInnj18tcpZrn1vE+j7XoSBNrp1EVs/MFKTTRYT2GGhJ+57bVqJGDINSgzJE0zSpUFT rqfa7Ffw4oGzQXVM8hUAg5ZrKGbLN/ls79opT3+N8XL4n2oVOeR/AOWSlcTKA6HMLl5wCwVJ5wdAf XxoWFnHsjO6KRRJyhwfmvwtl3FU1LvixguVFwdM2Lbk4lscgIH99YwcHRXBNawuSlitHpUmpf009N 9ez/2yNvw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hiHKn-0006aC-2u; Tue, 02 Jul 2019 11:52:29 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E4F1820ADAEA0; Tue, 2 Jul 2019 13:52:25 +0200 (CEST) Date: Tue, 2 Jul 2019 13:52:25 +0200 From: Peter Zijlstra To: Michel Lespinasse Cc: Davidlohr Bueso , David Howells , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] augmented rbtree: rework the RB_DECLARE_CALLBACKS macro definition Message-ID: <20190702115225.GB3419@hirez.programming.kicks-ass.net> References: <20190702075819.34787-1-walken@google.com> <20190702075819.34787-4-walken@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190702075819.34787-4-walken@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 02, 2019 at 12:58:19AM -0700, Michel Lespinasse wrote: > - Change the definition of the RBCOMPUTE function. The propagate > callback repeatedly calls RBCOMPUTE as it moves from leaf to root. > it wants to stop recomputing once the augmented subtree information > doesn't change. This was previously checked using the == operator, > but that only works when the augmented subtree information is a > scalar field. This commit modifies the RBCOMPUTE function so that > it now sets the augmented subtree information instead of returning it, > and returns a boolean value indicating if the propagate callback > should stop. I suppose that makes sense and saves a copy over adding RBEQUAL() like I proposed earlier. > - Reorder the RB_DECLARE_CALLBACKS macro arguments, following the > style of the INTERVAL_TREE_DEFINE macro, so that RBSTATIC and RBNAME > are passed last. That's, IMO, a weird change. C has storage type and name first, why would you want to put that last. If anything, change INTERVAL_TREE_DEFINE(). Also; this is two changes and one patch; ISTR we have rules about those things :-) > The motivation for this change is that I want to introduce augmented rbtree > uses where the augmented data for the subtree is a struct instead of a scalar. I'm not seeing how this justifies the second thing.