From patchwork Tue Apr 25 14:09:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13223446 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92D5BC77B61 for ; Tue, 25 Apr 2023 15:59:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D59E6B0083; Tue, 25 Apr 2023 11:59:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 086CE6B0085; Tue, 25 Apr 2023 11:59:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1A3B6B0087; Tue, 25 Apr 2023 11:59:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D14BF6B0083 for ; Tue, 25 Apr 2023 11:59:58 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9F7E51A02AD for ; Tue, 25 Apr 2023 15:59:58 +0000 (UTC) X-FDA: 80720374476.22.505BBA2 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf27.hostedemail.com (Postfix) with ESMTP id 053494002F for ; Tue, 25 Apr 2023 15:59:54 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=iLyayOwR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KA7ddovE; spf=pass (imf27.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682438395; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0I/GuI5QEyZWq7urrTdN0//wqkgqXn6YNERYZgyoi84=; b=R7VqntiZcnj4pPddp0V2gE6nF25hFNAjE928auFI+j/RYcdJwxNyVscSwBDZDVK/aArffU nsFsyxdPQg6uJd8vWl+slY+BuWCIR6CxO451Ex/+Bc42S67svuesWdntFB47rZxyTBUIMx t6M0OpeKu/5TGT3/M/6qrxKcxNgHvRg= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682438395; a=rsa-sha256; cv=pass; b=hXkafzT8LKeteQFuvUzN1EEEo0l4DeVAgg/RYfON5AFdy8UXETyk5JgdGZmotPWuKQO620 +IihsS6+66YKKDWobCYc6hH7dxdWNzZvbOXC4+fL7ir5xfpwqa/0SnXuZHn1zJHlr8KGKM KdjzIInt8jfU0sv6FCVwEZZSPrsK40s= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=iLyayOwR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=KA7ddovE; spf=pass (imf27.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33PDhpHA001846; Tue, 25 Apr 2023 14:10:37 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=0I/GuI5QEyZWq7urrTdN0//wqkgqXn6YNERYZgyoi84=; b=iLyayOwRgaqS6VULgSi32LrL6A1Mi8rl6huCf3y7GWxqOLIrw5ZC5J7qEH/URZ3lTFnM N2y/kN7LreERaikuNH4Z0pCRXVyndz0oHcTOkRMOuuxUiqk55/tpgD+vuBeLlMTZOL9J ZseDr6sqXsu0NqfF27X6Og9znvm9SJjPT/6eJWAWbd6zKjkq9gPb3dLGyBbX0mMUAIPe E0etNIk94NnAE5J13cGdagPVd65rFuZxSpBxcJQotTyQfbg+0yOqhlbb/7Zfp/C5rvvC Dhu9HlS9Bn3U3W58L5SNE3SLRw5doMyzyT95Ip5qw2wzf7I13e2vUEw1WXw/YoQKzCk6 4w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q47mcwfbt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:37 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33PCfTaL007440; Tue, 25 Apr 2023 14:10:36 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2170.outbound.protection.outlook.com [104.47.57.170]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gcxq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lMXnJBzPnofTcYXqWSlHwybKNEiw6I2O1qcUGfXmrXL3up48zAaDpk2eoRKUdUiVE4pSsgNR8QUfZjCspxofQ68Me+FmEGsqcMFjr4tZzjzx5MW823vGkBDKpyGahO6ecJa//4nUHWFqYILb2qoOe1/lrVDePOOwykJgRL1TyruCxxTB8UH7udhUA3WQkxbikeK7cuJY7EYie1b7ePZgQiBJ7B8NMm/IvgOfeZjbldNNlCxVRV2zeGseCUZRncW5XeWRYx69Hl/F1n1jgo3WQ4KicX75bm+w1ul/v/TvStxL7tBhCfSxD1EL695kXvwKG6Fyt3IYoMMYrJ9nfuvvkg== 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=0I/GuI5QEyZWq7urrTdN0//wqkgqXn6YNERYZgyoi84=; b=b19jTnzELAqQLnkwXB9aVBVeR+RkoQPKo0aLN9PjUI6p9BK8IUxdl8bpeg+2Ik2tV5SB9bMCz8iF0YU0Mtket5WnbG7PZf6/DqunFrzhU0AC7C8Nh5hP1KvSiazzym/SmBIBgrJ1hsgWmsqHKgKEv5a7twZhe7ic1B48ODThdr8ikQvKzOcV4EGkP7H9zhjRR1sOZDGqXP3is+5xAfbdV5ME1vD4oQ1dsIKF21ATnfOUMC+TWmzSlDKPSfDwZ1Ud7Fu+mYRVQbiBplpyXYAxsTG9URItwGth12xt8D8yXe8inVLOefy1H7gPujE/Djqc1dC73d3Ls/89DhNReikvBA== 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=0I/GuI5QEyZWq7urrTdN0//wqkgqXn6YNERYZgyoi84=; b=KA7ddovESqbI9ZuXrtfo1TdXU+A4tTLFAgnH5Zi9KIPpyJ4Eqp95kyWa591+CFgNisoX571ZFtryhW+g0vS0552C8bje0BZTNpspBPgY+jiT8CpcutyQwfWocQOR3VnGxxqNMv2HOQgOL/E7uZwzVUvGi3itIgyN2G8eZj/bPuk= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH7PR10MB6081.namprd10.prod.outlook.com (2603:10b6:510:1fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:10:34 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:33 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 06/34] maple_tree: Add debug BUG_ON and WARN_ON variants Date: Tue, 25 Apr 2023 10:09:27 -0400 Message-Id: <20230425140955.3834476-7-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4P288CA0087.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d0::24) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|PH7PR10MB6081:EE_ X-MS-Office365-Filtering-Correlation-Id: fbf0ac81-85cd-4a43-e343-08db4596d5cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xg7OOZqQowH7pqFKAVgIKs7LNJmas3GB35pehmUQvcdlRbXzYG/GhMcP1iwK/8vzBUuw6syZTlHtJ4XRNp91UgRkGQQ349uN3lfIji0QMvEOcZwHMw4lId10GYmyddIDNhr44tirI0xdIb8+F9kMvcgBUHfQQT62voEx5Va7xRvwRGFHzB6VMk/mIQAnIaaN86nXjcd3HjNiZfYPcWmjiVHxK/jYBM+6dvWeqGkJz9uFpAEGwRGGb+KQb14quUh5QFBbkoDe7/pFOPPgTiacrxRwB0jMBd3V73xar+1dY6QmHmvIEkCIB/bNOce3JviCqB48DDBiTptSlcVp39uOmSFofsgrFOm+XUf5lw1KJz2G4zEbsMLLo6BPkrT9xE6fCWthtPKf7+whfZQN+VabhoF/+TWlz5NroYu6ypMTASJ83bA4tt5XE1hj2kU33I2UMx1hL6ZoNyWqOzsGhjbi9HC9dk8JXYyfSJoSv0uVcvHunASoaNxcCSdZHYeALTk5klBkPNliRtrv6LdgI5AekV20wu5mqDEDgK4aUtk8qytgXkcuGSFZy/5fQXAqO6ou 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)(136003)(396003)(39860400002)(366004)(346002)(376002)(451199021)(2906002)(66476007)(66556008)(66946007)(6916009)(4326008)(316002)(5660300002)(8936002)(8676002)(41300700001)(36756003)(86362001)(186003)(26005)(6512007)(1076003)(107886003)(38100700002)(478600001)(6666004)(6486002)(83380400001)(2616005)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oToTAqOt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/u1iTTbJigINKhf+ECUJO+QiKn1fDOOMy0reLBvd5Geeko+q0lsf8UyEXKqXy2vCbfK68tKT3mMQXVMEfUOXyZvkL3Kzhryi14UXqcVRchrcIOQJmp3m0/sie81YHG/eGL3msctXJLlNMmNHe0JGyzV7ZAhuNFPFmi4pb5ncHCqB6mzNjRcnemDhp/MG3f3nIesKWGaPYh5BjfzkVIRNJNU96oqUB9QqE+VY3VuI5/6A3sHSMAQUihg2R883rPMGw9cjL6aKF1uwNASDlOsBnTggZ/yzC45HeOVbioYTiz1JxxBTGhi4YVhUaqZ+SJUnMOdQcnSOzL/LnxjoHb3VCKkFIR+4Dorf34fL0PIc6I86g6OAWZLh1MSYnEOfWlmfXT3dLVmSvsPJcRClwwreOBFdoY2V9uueO4pRxjgApBPkoywljrFl3S/EB6jUtEGFarDvByEyw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbf0ac81-85cd-4a43-e343-08db4596d5cc X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:33.8184 (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: HzIrNTi0dWFLv6FVqxqap7zExmmphW0gtvHOsvjsCUd4I6ufNF7PLvDNxXt/r1Z+oz+Fy7oK7okJ6msu6A0kTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6081 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: V9ALBE7ECjArrnrEYKvFk5M2NUIC2kRi X-Proofpoint-ORIG-GUID: V9ALBE7ECjArrnrEYKvFk5M2NUIC2kRi X-Rspam-User: X-Rspamd-Queue-Id: 053494002F X-Rspamd-Server: rspam09 X-Stat-Signature: qukkzix9um4utb1ont8p5suiqe7uf4ny X-HE-Tag: 1682438394-776809 X-HE-Meta: U2FsdGVkX18GffnfmLx9VmDdyURE2MbrpmyluSVy+1PqAEBULDezglY8V5bS3NfDeTPHCiGN6lfB0ZWr2CiGftCWtstJOk6XUhUP3c2g5kotP3gM9ftGOGkRJkIidyTEDtOhxaJUXCWppi85+WxlRCDmULsuwQJYtMsfXVu5XO/Do7+9nLNbkZqAeGBGDwZ6inwR2x5eAkZ6gvkoD1j10NKuFtbW7jvaGlyMUUiKAvXx7NgO2DjAymkeOh6eZDz9EbuQKaGyGCS5LBUTAi8NZzGNn8M8NldyhVzuVxgsc5SQwJYAjkOdbQGaBMNN05dnL/0BAydkAipoKMfJrmPxMAxr7kPiUBZnq77BMlhSnnWDD8Zt3bgDSLNDOcdx4MA1+xf6QVueioM1eJJpc9XA+JHQ+OTuFQarB1q9hbLMeGnaXd5/OLdjQLwwYvt8r1knSTFm5K2YoTLfuHuQ1RwzSp53YQAqMdCPd5ym1sWSofHmfvubxn0eceg3UoayxZrsOc+ppOnmZV8e1gSdUoSE1IPa7X0zZuiN60fVxPam6av3xgmQXnUeRdrqxdPmdsDEuWw2ZyxYeZqe+9vYqYw1JgFWWY7x0lS2buq2UT3x/b2gE6uSEAx1J9vVUHVdxGd64r2eAkXLNVJY5c/OX1Y3uo13tEsTF1XDV60Y//j4m++L29Xoh4WJhIBOFUpgAXBMO/B/xzWKhGXRZbb7TnkE2sgkQ9bQKebsU2hpIZH6S19YWm4uyA4bVRpkzn5XeI6pAJoKR60fe88dIrNWVXsUlh818LrvGrnEQ0uD3eg5aLymBzh1pIHH/uQ/CEBLaL0TNmGNbsoVUwmGZRhYZc4xpC7xNYUwjH8ew+kHf7ThjnfQw/mthQxjtAfMo+NyrydobXpw4T+MK6p/i/9hp/QO17wnD/XViYJGgUsn0zZ93sjBSvnbkkMg4NkTM0tuv5TE4R8hW+EomKMkU2g1MR1 0virO/NO WiZlr9nqvX0iarMJb+ZSUeF2UtFPsrmzUEeHN/NT+fQWgQ6PhxKE3XYcIok78sKWXZBLNvc5Km0trlVidwhOdSGmok0dUqpyBPUInETTWgwEH8C0RQJqqPA53JVa21b5b23t0jwJZOvycEtl/3aaTRboila/kpya+uagirk5I4eABZ+pxXZaH+eNsO7bYupv4NcsiZmrYRnhrZ90wUAW829YPgbxgsbKKsfDZOuT5xVa2c7A9chn3BAMwo6ysgpq2/eePuQ6i1OgoSofyS3SURRMGlZyZvaQ5tRRfQcubtRAJNmoCzNy2KSaVCOb4vjgs0n/gxR8x3y+GolE5klmT+tUXHlm3wFi/C+mma6yw/KH30/Df+fqNPXKtwdXJiGwAcRGnJnpywc3reChmUXAjY7Or5s2OvQEpDiHZQVGZkfGjTW8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 140fb271be4a4..204d7941a39ec 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 535efc39f7758..a4c880192333e 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; } @@ -7252,4 +7252,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 */