Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3517041ybd; Fri, 28 Jun 2019 09:58:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRLW7/sAHHrKB7k7YxhadkirRLP9C/o/AlZmZO9JpSNfjTfcNnNGsKzaPL+Z1ytBGLfBdH X-Received: by 2002:a17:902:290b:: with SMTP id g11mr12618889plb.26.1561741117829; Fri, 28 Jun 2019 09:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561741117; cv=none; d=google.com; s=arc-20160816; b=FilsDEYC4X4vOqENmnoWR7ya7Uejs/7R+beHAsW/3dLgsl0quMvIBKeMivYewtWYOr ziXJO4TnJjLmZ4VAp+MhR1dKB630973w1i6HDJ3XFiHjNMRb6X0YXKgg2rEwQ/xcjnDN 7WIHU8PwVGhbm0LuXA8RoFZUwQnblgkZwQEjd8V6kGWR2HTwxZtLfB8cNJcvZgITrGp2 mMb27YMZ6who/tzr5U05OmyVfjaZfGWg24GdyhQmD5XY0B3LBWndZlKme736+X55eSe8 t4aixXEWUDgIDlN8ZkkQO2Ti9gviNYliTlPAkioEyAIPCKV4l0xsjUEH/7nrGaIwJbMM Wt3Q== 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; bh=8wOGNnHbf9xKTM2BCFKf0UMMpDHsjgEOV6l/wQnAxpE=; b=IyYq2wxn1Ey3yGh2/TVWKR9aH+8eoMzVbQg7yuzUpqvxVyBWnSj+Gwy315r9478i3Z sanQFihwLLORwSI2o0WZA/ecGfHNnQBIZEAeHlWtve7tfxZCC7EcUj0IbM1qmVPQzTrs 4WIfM3HcfHP6osahIq2Bfsk+BxsISF6qluc3911MDMrTrqODKmv2xj0JU9vDfp3BHQl6 H7xfzqmYAEWv/xQOxkVFWnEMhIGdj9CUZ7t1hkeBAqK3j5UOMAjKegK+qjkwcJEfzbCG IwPGhtGTtbbPCEAR5wtToHcaBb7g98HMGch9Tc6Pb6txjtSQk9FRXywEQeDNjy8imRwy C5bA== ARC-Authentication-Results: i=1; mx.google.com; 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 n3si2381381pgh.53.2019.06.28.09.58.21; Fri, 28 Jun 2019 09:58: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; 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 S1727055AbfF1Q4v (ORCPT + 99 others); Fri, 28 Jun 2019 12:56:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:53798 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726832AbfF1Q4t (ORCPT ); Fri, 28 Jun 2019 12:56:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B15A8AB92; Fri, 28 Jun 2019 16:56:48 +0000 (UTC) Date: Fri, 28 Jun 2019 09:56:42 -0700 From: Davidlohr Bueso To: Michel Lespinasse Cc: Peter Zijlstra , David Howells , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] rbtree: avoid generating code twice for the cached versions Message-ID: <20190628165642.r754xozttawmg5yh@linux-r8p5> References: <20190628045008.39926-1-walken@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190628045008.39926-1-walken@google.com> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 27 Jun 2019, Michel Lespinasse wrote: >As was already noted in rbtree.h, the logic to cache rb_first (or rb_last) >can easily be implemented externally to the core rbtree api. > >Change the implementation to do just that. Previously the update of >rb_leftmost was wired deeper into the implemntation, but there were >some disadvantages to that - mostly, lib/rbtree.c had separate >instantiations for rb_insert_color() vs rb_insert_color_cached(), as well >as rb_erase() vs rb_erase_cached(), which were doing exactly the same >thing save for the rb_leftmost update at the start of either function. I think this makes sense, and is more along the lines of the augmented cached doing the static inline instead of separate instantiations of the calls. >Change-Id: I0cb62be774fc0138b81188e6ae81d5f1da64578d what is this? >Signed-off-by: Michel Lespinasse Acked-by: Davidlohr Bueso Thanks!