Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp311011ybi; Tue, 2 Jul 2019 21:02:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYzz2xCUibsKFRN05DVS4TYpDRr92CWhw6DMAw40mW/gNDFXyeMoC5M/HnlCvEgLU5skL1 X-Received: by 2002:a17:902:f46:: with SMTP id 64mr30863974ply.235.1562126558589; Tue, 02 Jul 2019 21:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562126558; cv=none; d=google.com; s=arc-20160816; b=aOJBsqDYp4VP/U6MzYH6K/YtcgW2VAKATezT4wMYNFDe8kPsXJxROLAY7ReSnpr6rR LD+Nr5BcGVk9FLaeFuCS+/5W36ptoVGH9iDzgKTb8Ed3YDDdtwRwCTUfvt13WpHrNOpp vjP+jXtizIPZrnzM6Nkmz24QWon/aLe55UAbj/kKO5toD5q2mw5uTHrjvw9WG2CGJm8g bSGTEcpMLbaoPlfE8p+bdQQFVBu9pkP1Bi7A3vh5YlGvh34YrHngW/brkaLBakI2G1/x l3EGdOgvtOt+8q60snCPYMynORsrkSbB0VrkvTV45Udh/bQ3fO4yZXjhj8+nYyQ8fZ7r 1VVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=Gqg9vEUEQjamw+U2TDRVFbfZNKD/ycSs0XHiqhxGFk8=; b=wvV3CgHi8J9l4uEIbBPqUyI0qJAJY+V7lVsaAGv3LxNVO/e5+CWrTpB3tp3/lUM7Wx n9LWoJ1DCPF21tMO0qHdz4RK22bUUZrg7Qh9KGvwx1zYkMo6FVaUfnarVSpF+wuceOFs zKFmkTV3jLjZolSP/2jAMTRAqTLWmW7sm1N00rYpJuK6kG3O6ca+C6Pg3LiuGf269HzA 9Xjw0dq18/mPfIK9f+sOuPZjwFycSvTlZ6qHsEMiSBr5+Osd4OsY/16EefJOnqpo5DBc gR+Z2rYq+NMbssaEbuCkdsviu67ELV1nu5jTaaXob73B+I8b/ZkqR4rNkKiKtQmkZewR 6Bdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="DUSp5/cD"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u4si727033pjv.38.2019.07.02.21.02.21; Tue, 02 Jul 2019 21:02:38 -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=pass header.i=@google.com header.s=20161025 header.b="DUSp5/cD"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725806AbfGCECA (ORCPT + 99 others); Wed, 3 Jul 2019 00:02:00 -0400 Received: from mail-pg1-f202.google.com ([209.85.215.202]:38144 "EHLO mail-pg1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725270AbfGCEB7 (ORCPT ); Wed, 3 Jul 2019 00:01:59 -0400 Received: by mail-pg1-f202.google.com with SMTP id w5so769765pgs.5 for ; Tue, 02 Jul 2019 21:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=Gqg9vEUEQjamw+U2TDRVFbfZNKD/ycSs0XHiqhxGFk8=; b=DUSp5/cDhcH68bi+Nqh/3cwTIsuqcpNTJ4KruX+YPcQUSWG+/5hPHGNhqwkWJb/ah2 eJ5HtglThdDRbB5I8iYw5/D69dYJppppopzOO2mSI+BbI92ZgW+wCLu8Xv+h3LRowhz3 razdXHDpi/pPWZA2RqaczdEZYVtlzHeYLehQeXztClJk0ylLisPmM9e0hPPOC9ps2vOj NBZcMd8FE0B/tXSKkgo789bUh9lo8LXpT7m8MJCDS17/ksAy/Ql3vLUZ7UdlYbEmPyF8 XcIP2jw9ou9HOm3326ze3aPAFnH04OmhJkLwpTTkIP2D4mlEQ2uimSPp+VTY/vyzt2I4 M8xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Gqg9vEUEQjamw+U2TDRVFbfZNKD/ycSs0XHiqhxGFk8=; b=Kh2Cb1SfJVWmnLInqc4eN0tAZ9n6ZdFOQ+TFC35LMlEjxjNOlFizqHf6KTsJWEoqEC q2ggESClsQSWDVGC6eIB9mtX9tMiLrbpHAZ+6yTAiQWSacwrtRM2aMhRTVlsDHseg2qA dImWiRHORdrdr9LUlrzQVUH2n0k6y11g0mwM7/hW+JchD38s1FXBGsNahrC8V9mqrspH qhq2csChNoDaeBSoKdgFEnGioeX1X83JxopJ4MQBbKggzdZElB/bOz65OfcxjfXMQRDP ykfQV4Chy43mqGuf28CzKlnKNE10/ZC8gfbP0KiKG/Wn1W0sDF2cmrkFOcm3IWoXRTft yweQ== X-Gm-Message-State: APjAAAU5rgb3WtDcIu2FEjt8OCVw3MFZ3hNk3/ugSIa+hAxXMqWhDID4 KVO35Khr1ha96D1xhZy3hq/DSyMBIEg= X-Received: by 2002:a65:43c2:: with SMTP id n2mr15101876pgp.110.1562126518698; Tue, 02 Jul 2019 21:01:58 -0700 (PDT) Date: Tue, 2 Jul 2019 21:01:53 -0700 Message-Id: <20190703040156.56953-1-walken@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog Subject: [PATCH v3 0/3] make RB_DECLARE_CALLBACKS more generic From: Michel Lespinasse To: Davidlohr Bueso , Peter Zijlstra , David Howells Cc: Andrew Morton , linux-kernel@vger.kernel.org, Michel Lespinasse Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These changes are intended to make the RB_DECLARE_CALLBACKS macro more generic (allowing the aubmented subtree information to be a struct instead of a scalar). Changes since v2: Left the RBSTATIC and RBNAME arguments first in the RB_DECLARE_CALLBACKS and RB_DECLARE_CALLBACKS_MAX macros as suggested by Peter Zijlstra. Changes since v1: I have added a new RB_DECLARE_CALLBACKS_MAX macro, which generates augmented rbtree callbacks where the subtree information can be expressed as max(f(node)). This covers all current uses, and thus makes it easy to do the later RB_DECLARE_CALLBACKS definition change as it's only currently used in RB_DECLARE_CALLBACKS_MAX. I have also verified the compiled lib/interval_tree.o and mm/mmap.o files to check that they didn't change. This held as expected for interval_tree.o; mmap.o did have some changes which could be reverted by marking __vma_link_rb as noinline. I did not add such a change to the patchset; I felt it was reasonable enough to let the inlining decision up to the compiler. Michel Lespinasse (3): augmented rbtree: add comments for RB_DECLARE_CALLBACKS macro augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro augmented rbtree: rework the RB_DECLARE_CALLBACKS macro definition arch/x86/mm/pat_rbtree.c | 19 +----- drivers/block/drbd/drbd_interval.c | 29 +-------- include/linux/interval_tree_generic.h | 22 +------ include/linux/rbtree_augmented.h | 88 ++++++++++++++++++++------ lib/rbtree_test.c | 22 +------ mm/mmap.c | 29 +++++---- tools/include/linux/rbtree_augmented.h | 88 ++++++++++++++++++++------ 7 files changed, 163 insertions(+), 134 deletions(-) -- 2.22.0.410.gd8fdbe21b5-goog