Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1503494rwd; Thu, 18 May 2023 12:55:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4psYepq/uZgCP+Gye1sdhxHgq3qpsdddDlak6fLSJExmDL+vY0g0WFQyqjrFAiPFb5Gknn X-Received: by 2002:a17:903:260d:b0:1ae:89a:92 with SMTP id jd13-20020a170903260d00b001ae089a0092mr110447plb.59.1684439752199; Thu, 18 May 2023 12:55:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684439752; cv=pass; d=google.com; s=arc-20160816; b=KxlpH0oABET19EV5Jpkd72PLf0bnUCFSTyFyUBJAV/bBl+OAXCtFtxuSVZan2ghQA5 vKbtOSvox0OfOwyYgzlQP4c8AWxSb8zzoicz/6TzA/tttPLgRZrLKa6GJtUHi6Jetbc4 CC5QV5xdQQyNmPY1LeKXJefXah6DveWEs+iX0D83UggM4y0ijBCwVy9l8n5+tEIyC2S2 +zW80gswasuoyu5dyP9u3NCObzgllKoPUZdGc5H0E+nR5/iEFAQyEfptIhOefNv1Pvg+ 69ea7Yt2EavvBSmkj/b7COzB+ZBMFLeCQ0fRd89HEFJwdpF7I74cBjiNrYYjZozVDjZV fF5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=b6NFuY1Cli4ZxcQEF1wHnuQb58sUXliXR5M9M7xX02Y=; b=APmph+G+cgGTpjFsPspUkeC4032rePqZITDUeSBX80BbEZkUPSmmYdBu2Wt7aFINSn miA7A4NGEaCFR+yBR1IlByJV3k219hati1WBQdAKaAaYF+JcQo7fB9qM7TplEMEJfXQg yKijID1w3jrcBNI4ywkLQnX310hoFn7ChIuzLNtCLyT2Qs+UKf9gZr64eEt86Jah6E3m ZSWQkH8DJqCT2R9WultXaHtlHmKAgO1mpM8YuQao3te+2cJurY9TV0LzN0E+ZbbJEEV1 k7737iBXw9MvArdyGF5XPacGlI0R12IZbvoXnib9qTL5yOVFibW535jPLVArc5NqxYBV 99GA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=yDwp6wmD; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=NC1AfEUW; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb14-20020a170903338e00b001a1be5ca65asi1816450plb.528.2023.05.18.12.55.39; Thu, 18 May 2023 12:55:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=yDwp6wmD; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=NC1AfEUW; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230200AbjERTCY (ORCPT + 99 others); Thu, 18 May 2023 15:02:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbjERTCX (ORCPT ); Thu, 18 May 2023 15:02:23 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5D2ACA for ; Thu, 18 May 2023 12:02:16 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I6JDwi018330; Thu, 18 May 2023 14:56:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=b6NFuY1Cli4ZxcQEF1wHnuQb58sUXliXR5M9M7xX02Y=; b=yDwp6wmDBM9uW6tcSjWCdUd9ZTDYfLmtHlYTXfcglePt4veqm9MsRt9h5gLFNslNerda vZq6ogYU+wbhTXQkGeM0tYCkeQucy5yQB/2E4ylu8IMpH5WgcPGfm+7V/5MAp0EmyO9Y uO4aHyk1i+flPKbB0Ll3Azyv8WjOQq/hkRd5SkARsFOiiO4SWene1qpwavTfYLO277J/ KUdTji62eUb2c3056xCQo6bMMbuRaoY0QpczDQSiD/uQ3jLoeGRMMzsTjR0dAMPZF0DA wIOkRjmcRvYugyZj8EFB0ONQ/pCavLg+LzL7Q9CEXEJkRusTaqO2I+YCvPcRgwA0+nwe qg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qmx8j2vnb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:06 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34IE1P74004143; Thu, 18 May 2023 14:56:05 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2109.outbound.protection.outlook.com [104.47.70.109]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qj10d66wn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2023 14:56:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PBGPGOfrbZ3zfrPoMRq1esGh2bwI6bbJwt0TGYOA4K1IYtRG8bpnSeW4ollXATZ3OdCLQqWmitH24lKsqW7F9tkO5f1Q6IOP3T8nkNIzoMP7sRTqr10ZfGRON8lSOZ3ZmPqN1NiLSM0SP1mCwJ3yTtR2DW+DYjc9ubIG4Z1AVYwzUD085C0+8DWPoA6FLzKS1hG20Ht5p7qf5w76FFs/UG9vhJ6IKzrh7MRSwL1/lx2QWs05tJwU61a1hoLmq4KamNpoNCy/9XHEcXI2ptVOoot2wq8zafqFRKwBu6d7mrHGgXIc1RWe4eg/xVIkQkgVMXGmB6uaNX4GO9DufNYIWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b6NFuY1Cli4ZxcQEF1wHnuQb58sUXliXR5M9M7xX02Y=; b=UGwxfDxGZ4GJGIeyk6v5aniHTxSnaZeyZPwTsbv82FAVsbHWQdX9+G5ew/NJ/NI7omVCHi6qNfcNTogLoQoA6r5CRhjPbX2Rf04E6+0ZFHaFYQZ2eDUKQ6vJbPJc3VXl2suBRNjQTmPkx0e9M3aimwLZ77L65/mQKkEHSYojuH8AnosWWhZjfuI2tpHColUL6oZy9kD0H4TLwChAI2f9notUTvhhNkF+wp4QFaqaLk7MM2Q5PkJ0jJ4nROVUH3R9aMgN/hakxCCxRMQPP15kmXMkIqdBB+OazPD5sUx/xB4PWS8mHs3a7IvNvK8SO2XEXb4ZJbhobbu84BvPbLgaLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b6NFuY1Cli4ZxcQEF1wHnuQb58sUXliXR5M9M7xX02Y=; b=NC1AfEUWqNr3kF1+QBHgbB238jZiGAGRE2IjLe88LWEBNyQPhBs48MgxtDx9m/sMeMJScKIFAuc6xpmu2+WAZBhqUNnFTSKco0lW4dNTlkFoPhLOlst3b59MRf2dI3OuT4kFIcxYCTu/K59rL3e8fPrfT4bXZmRxL5uVgkk/ShI= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by DM6PR10MB4347.namprd10.prod.outlook.com (2603:10b6:5:211::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 14:56:03 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::998f:d221:5fb6:c67d%7]) with mapi id 15.20.6411.017; Thu, 18 May 2023 14:56:03 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Liam R. Howlett" Subject: [PATCH v4 06/35] maple_tree: Add debug BUG_ON and WARN_ON variants Date: Thu, 18 May 2023 10:55:15 -0400 Message-Id: <20230518145544.1722059-7-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518145544.1722059-1-Liam.Howlett@oracle.com> References: <20230518145544.1722059-1-Liam.Howlett@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT4PR01CA0290.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10e::23) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|DM6PR10MB4347:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c6a7bf0-50e9-4a80-c2cd-08db57b00030 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s3UOWhFza14ewH+TPTmENd+LGzNdwxQSqJyDFhl08B3GcFZwFOh8SUKpACoMcNug0Wzo6RLsxzU8UZVCYAqreNQocyRQ0NJA58XzRES14lIeYuzfVs6eNmqPfW81xOGxyt5gTaQ1qgPmCIrZob/lEoKKz91cJgmHfqsftXPl4OASjR38SSAE46hgmjo8BweCl137S1hsOXtwOJRmdrdvX/Goykqex4SkEqzIaYh5TQA9LtGBra4/bjZtbwyvrWcrVbwRAvT69uYr1HW9HkTOWUb20CkVZ49gixZSjSt0Y9ctQNTnJaogavbmUdz0ZIVrJmZUBqaIhWBOCzS3t3cYj+/fqcymRcDQuJXdAov+O/6PYoRIkihC+g2P3l5yAXHYgSFbppVF7PA9V6C0RIqWhAKuaaIZ8mMlsQNAsv23pCB71Xjq8BDqDVFjjrA7Uaqq2TjoWudbewM6NOofrZDtEAvY7XNoqdzqAbzMhS4VOBKGF/5bR+6pFFQQYDFr0LaF3f5DyXSRGyxX/p7k0UUAXloacZRQEBbsEGC9SAgBz7OKZWQg3AlK53VYyUxaPFJu X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(86362001)(2616005)(4326008)(6666004)(26005)(6506007)(6512007)(1076003)(6486002)(6916009)(66556008)(66476007)(66946007)(316002)(38100700002)(36756003)(186003)(478600001)(8936002)(8676002)(2906002)(41300700001)(107886003)(83380400001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1wqL+IfcoMPPn6Nm1UVuTqOSk5GjjVqcz3mh/OAG1npxoccOOYYrDZ1IwvcW?= =?us-ascii?Q?JORmQXyjaXcPJvTG8XtC4KgxVE1l6IodFe3sQ3PxMDjnXCC9nIuWlt8rF6CM?= =?us-ascii?Q?7kWikAo2KCfWOgy+Robq0VZMT1vfdL8s9xdTMvSCN0AoPRNmVcgJK5ai/2gF?= =?us-ascii?Q?pVlKvTbkF/ojl9DcYrYi/BtId+kLMF1nENxQJOflvgYLqFxXUU7fLbKCCFhg?= =?us-ascii?Q?D5bVzvtXBySWQrVqnxkR2ag9MC6fmHl+jYXM2MgF7cMWYI6kjAfzyVBdXmWs?= =?us-ascii?Q?Lzb9zhuI8wE/xy4cxlBt7t294toXyNttAv+fByrxdH1dkTtxOrNyQyakDyJU?= =?us-ascii?Q?15H8ETxAHsFitMJmFTlFwBWsKmd0LtjgijO5pAlZ0frJzOHhtMSsBMnBGKnb?= =?us-ascii?Q?89WBgDAeoddHeScn7Dfpw6L8DCzngwZUm6/Q09kbIybtAaWauLO2HmXSdJoL?= =?us-ascii?Q?zJYxYxFN7W1G1TqjKcOttymVfqAvO0xaemW4k5+ttx5hLQA1jZ0y5V2sFrqV?= =?us-ascii?Q?EfspkM/9R2s7wylHuKslALqcDbdFd9Eu9bGCVoj04mLl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kh2V72KZ0ZJCfqGxmpJ7QXv6vIMg1N9kEni3IU2CgBEagFNtE01OG9cTgpOZSmAj1jP+LFbTaSvj03lTHs/7zt1SQZ5eC2mf4Yno54+6KMssG353wXCFXQdzUzX0iwRhETirweYATMCgPQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c6a7bf0-50e9-4a80-c2cd-08db57b00030 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 14:56:03.3136 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DkaUwxLKA75uVd48XIzEohHL7O4CUOce6j2dTVot5Ee4dXBoQryUbFgsXvNWGglwcRNsXAQDXCJHnomsq5RvPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4347 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_11,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180120 X-Proofpoint-GUID: 1Jc4f_3Hm22FCjvyvbpPXhgK3BUVPG-Z X-Proofpoint-ORIG-GUID: 1Jc4f_3Hm22FCjvyvbpPXhgK3BUVPG-Z X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add debug macros to dump the maple state and/or the tree for both warning and bug_on calls. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 100 +++++++++++++++++++++++++++++++++++-- lib/maple_tree.c | 34 ++++++++++++- 2 files changed, 129 insertions(+), 5 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 140fb271be4a..204d7941a39e 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -482,13 +482,13 @@ static inline void mas_init(struct ma_state *mas, struct maple_tree *tree, } /* Checks if a mas has not found anything */ -static inline bool mas_is_none(struct ma_state *mas) +static inline bool mas_is_none(const struct ma_state *mas) { return mas->node == MAS_NONE; } /* Checks if a mas has been paused */ -static inline bool mas_is_paused(struct ma_state *mas) +static inline bool mas_is_paused(const struct ma_state *mas) { return mas->node == MAS_PAUSE; } @@ -679,6 +679,8 @@ extern atomic_t maple_tree_tests_run; extern atomic_t maple_tree_tests_passed; void mt_dump(const struct maple_tree *mt, enum mt_dump_format format); +void mas_dump(const struct ma_state *mas); +void mas_wr_dump(const struct ma_wr_state *wr_mas); void mt_validate(struct maple_tree *mt); void mt_cache_shrink(void); #define MT_BUG_ON(__tree, __x) do { \ @@ -695,8 +697,100 @@ void mt_cache_shrink(void); atomic_inc(&maple_tree_tests_passed); \ } \ } while (0) + +#define MAS_BUG_ON(__mas, __x) do { \ + atomic_inc(&maple_tree_tests_run); \ + if (__x) { \ + pr_info("BUG at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_dump(__mas); \ + mt_dump((__mas)->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ +} while (0) + +#define MAS_WR_BUG_ON(__wrmas, __x) do { \ + atomic_inc(&maple_tree_tests_run); \ + if (__x) { \ + pr_info("BUG at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_wr_dump(__wrmas); \ + mas_dump((__wrmas)->mas); \ + mt_dump((__wrmas)->mas->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ +} while (0) + +#define MT_WARN_ON(__tree, __x) ({ \ + int ret = !!(__x); \ + atomic_inc(&maple_tree_tests_run); \ + if (ret) { \ + pr_info("WARN at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mt_dump(__tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ + unlikely(ret); \ +}) + +#define MAS_WARN_ON(__mas, __x) ({ \ + int ret = !!(__x); \ + atomic_inc(&maple_tree_tests_run); \ + if (ret) { \ + pr_info("WARN at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_dump(__mas); \ + mt_dump((__mas)->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ + unlikely(ret); \ +}) + +#define MAS_WR_WARN_ON(__wrmas, __x) ({ \ + int ret = !!(__x); \ + atomic_inc(&maple_tree_tests_run); \ + if (ret) { \ + pr_info("WARN at %s:%d (%u)\n", \ + __func__, __LINE__, __x); \ + mas_wr_dump(__wrmas); \ + mas_dump((__wrmas)->mas); \ + mt_dump((__wrmas)->mas->tree, mt_dump_hex); \ + pr_info("Pass: %u Run:%u\n", \ + atomic_read(&maple_tree_tests_passed), \ + atomic_read(&maple_tree_tests_run)); \ + dump_stack(); \ + } else { \ + atomic_inc(&maple_tree_tests_passed); \ + } \ + unlikely(ret); \ +}) #else -#define MT_BUG_ON(__tree, __x) BUG_ON(__x) +#define MT_BUG_ON(__tree, __x) BUG_ON(__x) +#define MAS_BUG_ON(__mas, __x) BUG_ON(__x) +#define MAS_WR_BUG_ON(__mas, __x) BUG_ON(__x) +#define MT_WARN_ON(__tree, __x) WARN_ON(__x) +#define MAS_WARN_ON(__mas, __x) WARN_ON(__x) +#define MAS_WR_WARN_ON(__mas, __x) WARN_ON(__x) #endif /* CONFIG_DEBUG_MAPLE_TREE */ #endif /*_LINUX_MAPLE_TREE_H */ diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 084868865849..a28b021f740f 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -240,12 +240,12 @@ static inline void mas_set_err(struct ma_state *mas, long err) mas->node = MA_ERROR(err); } -static inline bool mas_is_ptr(struct ma_state *mas) +static inline bool mas_is_ptr(const struct ma_state *mas) { return mas->node == MAS_ROOT; } -static inline bool mas_is_start(struct ma_state *mas) +static inline bool mas_is_start(const struct ma_state *mas) { return mas->node == MAS_START; } @@ -7251,4 +7251,34 @@ void mt_validate(struct maple_tree *mt) } EXPORT_SYMBOL_GPL(mt_validate); +void mas_dump(const struct ma_state *mas) +{ + pr_err("MAS: tree=%p enode=%p ", mas->tree, mas->node); + if (mas_is_none(mas)) + pr_err("(MAS_NONE) "); + else if (mas_is_ptr(mas)) + pr_err("(MAS_ROOT) "); + else if (mas_is_start(mas)) + pr_err("(MAS_START) "); + else if (mas_is_paused(mas)) + pr_err("(MAS_PAUSED) "); + + pr_err("[%u] index=%lx last=%lx\n", mas->offset, mas->index, mas->last); + pr_err(" min=%lx max=%lx alloc=%p, depth=%u, flags=%x\n", + mas->min, mas->max, mas->alloc, mas->depth, mas->mas_flags); + if (mas->index > mas->last) + pr_err("Check index & last\n"); +} +EXPORT_SYMBOL_GPL(mas_dump); + +void mas_wr_dump(const struct ma_wr_state *wr_mas) +{ + pr_err("WR_MAS: node=%p r_min=%lx r_max=%lx\n", + wr_mas->node, wr_mas->r_min, wr_mas->r_max); + pr_err(" type=%u off_end=%u, node_end=%u, end_piv=%lx\n", + wr_mas->type, wr_mas->offset_end, wr_mas->node_end, + wr_mas->end_piv); +} +EXPORT_SYMBOL_GPL(mas_wr_dump); + #endif /* CONFIG_DEBUG_MAPLE_TREE */ -- 2.39.2