From patchwork Sun Oct 8 16:10:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 115171 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1684084qgn; Sun, 8 Oct 2017 09:14:28 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAu+S+W2JkazHfpRzvq3TxkuwLmAANfHevGs84lokZGNjDK+O0+R4BszFAf5fS36cIBP/SN X-Received: by 10.101.74.133 with SMTP id b5mr7163934pgu.100.1507479268586; Sun, 08 Oct 2017 09:14:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507479268; cv=none; d=google.com; s=arc-20160816; b=DKhUfAh/qxRgcPI16IDwl2i6cIhGO0KX8bKeoHSZu71w82GvGZ3PrBZ45m5E9iyfLY Ub8RqO22xfERGtfd+rS1ahqghbXoFMxeD4SlQLdup5+LDf6FsVqBV2KFzB+E2ZbQY9HS sjbAifeGds5rLh/TsYingwBe3R0pUCdzRhX7brgLYxJkwfwcTpA+cj/skl6TxQCvoJJb fuB4LF1oVkdDiu1lcBePlamrCfdKyOwdr1VGoFzcBkpXvst/FuA30OBYQjfrQnZqB4G5 YVEIbOauW++frX0P91GpyboJOaORwcMTTJos5YU+2HNW0JNTUqzMlqlDjwV4x2f0Nkq0 ndvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=7OWlBcpH3+uMyXqIqyc6pd6VzQni7R2pKdppGDp0tgU=; b=z8wrAiU9lnyQ2hGnHbmrIPTEMLXzCCw9xt2adlIWFadc1i6zsE3lLwqhJAAnjOg38L KNadLqjLpIl8zrAFscULZPTgDmgCz4Vzp3jKMnChQ+w8uaQBrNVHe/DG/M3sarxSlMNA T/vJdLpaeIMOxKqffrUJ9mium7MRH4zgyCkjr8JifyPxVowHd7TTDyQWjYNlO6fohC1S knbiXlcQemWYP8h7MzZGPrO0x6W+GA0MjxndzF2yZYKZjpFHE1wGUjCt86ElkYsGRYoC PF4YTV4GNztGgW04bywc86scaLUJPrUT3oqISyHGsqY1ozs7/nY8beuXilH+DXGRtxGx xCtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JAuz7yj8; 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 r9si4661186pgs.213.2017.10.08.09.14.28; Sun, 08 Oct 2017 09:14:28 -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=@nifty.com header.s=dec2015msa header.b=JAuz7yj8; 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 S1753906AbdJHQON (ORCPT + 26 others); Sun, 8 Oct 2017 12:14:13 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:50994 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753556AbdJHQM2 (ORCPT ); Sun, 8 Oct 2017 12:12:28 -0400 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-08.nifty.com with ESMTP id v98GBWgL001379; Mon, 9 Oct 2017 01:11:35 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v98GBWgL001379 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1507479095; bh=7OWlBcpH3+uMyXqIqyc6pd6VzQni7R2pKdppGDp0tgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JAuz7yj8Wz9xIUrFSUBkAnsS95CoYzvY2My+JQE1e0bupRIE/BIudeTPr8uGmupB/ lxA2+D8LepbYGtj54qclCjqgnKq9D1KMMLsUDn+78zD0PMimWd2XJo/bd00qhVqxiF uyGCYWaOMGxi4Jkg+HEZbVK7yTpL/iuDVlBhIgY+H0KBYYJtLgvY0LWCtktr38jgcT nlkMruHQVs2zMeFMQO0zyQrbLgJZwoVeq8KHjFXYM0wexeMzIRR/JiLvV9a184CQk6 28PGLI2hB6ahazNbribs/1/3AmKqr7iBk9zqD3uo07vw1Nr/AM+GlELRwGQLF1Fkmn HtRJvO9/PlYKQ== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Andrew Morton , Ian Abbott , Ingo Molnar , Linus Torvalds , Masahiro Yamada Subject: [PATCH 02/12] radix-tree: split struct radix_tree_root to Date: Mon, 9 Oct 2017 01:10:03 +0900 Message-Id: <1507479013-5207-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507479013-5207-1-git-send-email-yamada.masahiro@socionext.com> References: <1507479013-5207-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The idea is similar to the separation of and . The users of radix tree typically embed struct radix_tree_root in their data structures, but those headers do not need to know anything about the other radix tree stuff like radix_tree_node, accessors. Including pulls in lots of bloat while struct radix_tree_root only depends on for gfp_t, and for __rcu. To reduce the header dependency, split struct radix_tree_root out to . Signed-off-by: Masahiro Yamada --- include/linux/radix-tree-root.h | 24 ++++++++++++++++++++++++ include/linux/radix-tree.h | 6 +----- 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 include/linux/radix-tree-root.h -- 2.7.4 diff --git a/include/linux/radix-tree-root.h b/include/linux/radix-tree-root.h new file mode 100644 index 0000000..1726df0 --- /dev/null +++ b/include/linux/radix-tree-root.h @@ -0,0 +1,24 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#ifndef _LINUX_RADIX_TREE_ROOT_H +#define _LINUX_RADIX_TREE_ROOT_H + +#include +#include + +struct radix_tree_root { + gfp_t gfp_mask; + struct radix_tree_node __rcu *rnode; +}; + +#endif /* _LINUX_RADIX_TREE_ROOT_H */ diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 6df7fa9..db3fb1d 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -109,11 +110,6 @@ struct radix_tree_node { #define ROOT_IS_IDR ((__force gfp_t)(1 << __GFP_BITS_SHIFT)) #define ROOT_TAG_SHIFT (__GFP_BITS_SHIFT + 1) -struct radix_tree_root { - gfp_t gfp_mask; - struct radix_tree_node __rcu *rnode; -}; - #define RADIX_TREE_INIT(mask) { \ .gfp_mask = (mask), \ .rnode = NULL, \