From patchwork Wed May 12 18:48:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 12254589 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A180BC4361B for ; Wed, 12 May 2021 19:45:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82193613AA for ; Wed, 12 May 2021 19:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352000AbhELTjJ (ORCPT ); Wed, 12 May 2021 15:39:09 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:41674 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358827AbhELSug (ORCPT ); Wed, 12 May 2021 14:50:36 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14CIk7Ys012846; Wed, 12 May 2021 18:48:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=MkmPNWWPBNjceUPGxZnN6+6oSKmxDnlQGP66vgze8pY=; b=Nknv6RJuxF046zlb8IWLaOGv91wQPJLNxTsbaZeAntGYFq1PGpwShxylVqARvdySSVL4 VauNt22znGCcwUZfUeg69MBM3IXR0igPohnEJT55WUOzoGpkHo3HoJvC6mAQxLkSzR/F gwB8yRdgDEJUJRaryOExdl2lI4pHWQ3k4fJna4q+1C+pVRkkCHjDn8iXmmiWHGD2bW9V BRvELt5s67X/9BqrrClY3oHYzuo7iBHREH4dXegw3ftCs3QSQoIRL8AJWbvLKFv5+xPR TRxtwleE4uwVijB0ewOdYezr7NRQBRKKVgxy82yDM1GuUvUlQ9d3eTFWAtzLA2GYlz4V zA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 38djkmjyxx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 May 2021 18:48:55 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14CIik8D186150; Wed, 12 May 2021 18:48:54 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by aserp3020.oracle.com with ESMTP id 38djfckhf3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 May 2021 18:48:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ScCSeMF7cCH822AabMZZZKHeL56FUHyKxN8+G4H/ye5iv2qZFdT2Aa1w+gRAwyXpGaW1x1Xa6vPEcfY67+ZZwFYMQXn1jR0N7zZFC8Kpi87kSvPBVlSQ4ZlgOU7X5hB70tATVUQgsZjpchUdI0bdxcWNPswSxFwimuuqLEY/zWpAZ0Tep96dwrFhUpfduWt1IbRJ8tfWdmEIINOu9uBJtnDnHGRGTbNKM4RHiYubw/04PHsDxe/JrU2X6MAxWcSaJue2cKbcCUvDGtUFFup8195P3bFSbuGt+GLGOL6hm/D3QeJtItrC5y65MQJl9OB+vUXRKfyNrWk1MwO3UqA26g== 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-SenderADCheck; bh=MkmPNWWPBNjceUPGxZnN6+6oSKmxDnlQGP66vgze8pY=; b=TN1Rx8qZX3MkRhmGit+HfhysXdnw67VIimbBfgF7UCg4ngtV7W/to0F4hrBmtpfHxfgBmnbgG/PdyL6GRsD/cNij4N1xxqOUF6lLGXamKTLTwDEsp+n3Fww7uC/DjL/YWGFOmQtkqSmnxeqqVJll8K90V5NHi47MRUiSN+ELJ8BBHP4zDN5i+HS2Sj6IQGqCZ0zaKVJXqOJNXnWQIEa9cc6JwRCU0IxsE44KSwqCRaKMbMvGslIZmbfMV4b+7N6HvuXwN45rQR8BkhDW3uru/nJrTucn7FQmFnH0ZptSD2phl230sPNrrqt8V07lXO2XYRTeKKOspoutrHEMkJDFhQ== 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=MkmPNWWPBNjceUPGxZnN6+6oSKmxDnlQGP66vgze8pY=; b=EZhAd2ZnuzhifnsmkH7fVrgrk0ROvgosL2mV5L+/efDwcGH+EPZuEMPeKvoMXIf1yJy4uOYSgyWXuq/G2kTKdfLP0va05AomgWiwmormMjQbvcMBjjNfEN3Jw+DmHauAnFFFm37vB8t6BWDvHHRi0tS4FD2Pg/hdG6SOYRLJpEY= Received: from MWHPR10MB1582.namprd10.prod.outlook.com (2603:10b6:300:22::8) by CO1PR10MB4785.namprd10.prod.outlook.com (2603:10b6:303:94::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Wed, 12 May 2021 18:48:52 +0000 Received: from MWHPR10MB1582.namprd10.prod.outlook.com ([fe80::353a:1802:6e91:1811]) by MWHPR10MB1582.namprd10.prod.outlook.com ([fe80::353a:1802:6e91:1811%8]) with mapi id 15.20.4129.026; Wed, 12 May 2021 18:48:52 +0000 From: Liam Howlett To: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Matthew Wilcox CC: Liam Howlett Subject: [PATCH 1/4] radix tree test suite: Add support for fallthrough attribute Thread-Topic: [PATCH 1/4] radix tree test suite: Add support for fallthrough attribute Thread-Index: AQHXR19zptPJuWt0S0yNBUHtYnlPaA== Date: Wed, 12 May 2021 18:48:52 +0000 Message-ID: <20210512184850.3526677-1-Liam.Howlett@Oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.30.2 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; x-originating-ip: [23.233.25.87] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 10c69998-6adf-4bb5-6cc7-08d915769670 x-ms-traffictypediagnostic: CO1PR10MB4785: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LF9gaMEDTvMYFGCGeiYqWVp2gXCTZI77HGfxqhnB7jTBGNWsSGQOLIETVUq2X7PVDhC2CfdJXv4diVbYRkgLY9DSCi/kL1hNoTvsEiAMD1lHOY/2cnZYaoXnor0d0cbbug05TQzJ+klPC3lljAGbBNnqR8BK6llJrorFaJppqJpcFy6SjebbN9QWTXJ5Uo4Yeq0KwajMXS83hovTQeoO7kCJa/8dTKLZPmSpIdS9wU72IZXfgjcT9nLpndPBdQbKxCoAip46MEEgR7Zw/yB0hmmNp/bIpjGWC6iAdIbd68iiNk47AtBEkFDTFC5t5HB3RbXdPVL2TQtia5GR1KaFOg4FpDZGK4bGUV2WPb9rhBprZfbjYXenSHjEdANdZFNBEo/SAN9ewEYCcSX4/+9yfGwcUX5jSAPhJpOC+W6DbR/CbMCTdGArlMYMizhBGQTIkCdZAdqsQbSPDoBDKAJ48lYmp8qSWQyhOLKIxS2yuL0zOZ4m6dQWkqflvRiCqPNpEomWR6vLeTxvOS4//DVfNFygWchjF89LnsJNajqpEaubtjii1qhJMS4fzBkCL1FXP0DS9CHxlNBkDu0PV9pTn1kjp0bRfIgFtYsnG+fFyiE= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR10MB1582.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(366004)(376002)(136003)(346002)(39860400002)(36756003)(107886003)(122000001)(4326008)(38100700002)(186003)(86362001)(71200400001)(8676002)(5660300002)(44832011)(4744005)(110136005)(2616005)(1076003)(8936002)(6486002)(2906002)(6512007)(66476007)(76116006)(66946007)(66556008)(91956017)(64756008)(26005)(478600001)(316002)(66446008)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?yT5MSJX/26pj+ZB95zt+gurno?= =?iso-8859-1?q?QwMdZRbUIjSnKgANaoYIiMNnJHCAItpDFb6FMVcxUuGXTc0yUZiVN0enpFQB?= =?iso-8859-1?q?0Y2MJE9Esv2ZOgxwDZ81bMvf9+5NPPTNs3AIzHe1uRhqzCCQe/1Vov25KYf6?= =?iso-8859-1?q?eSsBZRzwvH1nYIESmW7daz99GfCWHRjaplrMkxxP+dR2m1xsbGv4wCzVnXPg?= =?iso-8859-1?q?EuqvCFVqXQ6y+TXFxWZK544NKDQUeCotYK89NXKA2elC7s1Jh1SzjJhItD5T?= =?iso-8859-1?q?5nnsoqCWisE9i1JBNaKois+UPG944BmrFjJYOpconbxJba6pteJvwgEfvMHs?= =?iso-8859-1?q?HwkPRCghewtameix8uHDkdrZt9Y9hIW8S4l7S7P7eG2HDqZAPyJ87pIEwHER?= =?iso-8859-1?q?BcaUZMhp08lO8Onvo9+KCJSHnisE6OHRvEvp9LER5tsBYp/FQWiRX1/OUuR+?= =?iso-8859-1?q?CTn7fKfqPhdFJfi+3Uyq/J+REiGzKle9qRJ2piF6FJc2a+dqtVo/8AydgsYR?= =?iso-8859-1?q?hUwG7+Kvcuwr/IIfRcEH/N36n2Zh5aU42gXqfPZa0dUzoNb5iP7VNVDpQGNb?= =?iso-8859-1?q?QRnBMpJZueum4iXl/9jlQT2lgEOfZqVbbqBAORNtKfjmaM0QyQOGAWU+si+9?= =?iso-8859-1?q?TM8vY9KL8Gh0is5kxAQwrjg41+l712D36W6bBkw8u6v4oTxQBGiyueehjWK+?= =?iso-8859-1?q?JUiOSegzvOgqtscSjoL2eFoSam66gWy6Hf+3ZpD5ikeelrhOFS59jBb6E0Ll?= =?iso-8859-1?q?x/aj7kRv3VrJu43y47MrrFLX3WMlLg6DbXbu7JsFdShvZ4bNcz1KCSs8VmZl?= =?iso-8859-1?q?hHR8y4XqUj9BV4rvXcpxoLqkvkNw4ecL9i1ZFn4XSjvfgvA8DbQ/nFkjPhke?= =?iso-8859-1?q?guXI74uAeYUqU80YQQNt+9IuLULVUVCO6EE6cchUDDjcqlepZhokXTlhmQ5N?= =?iso-8859-1?q?zgpKGlKIwNs36Koaq8xgi6wKwraulLk0y/pxL2or1VmKByOpYx+rxgMdF4Og?= =?iso-8859-1?q?afColJXJO9iNw74YldWNzT6jE/yDtmGzwOygbIuKIFnJF7QFiFWwf3piibjQ?= =?iso-8859-1?q?U/UkOEVf7J48LKIVBpwpwN7cBwhOmDAmiKr6t8edpFcK6qrqw3LJA7W9lB6C?= =?iso-8859-1?q?1/LSYk5nSUePrDq/eQzPmxqLqQzCXZ6WsnuNplWka2gs7WlTvIHEet2l9FjS?= =?iso-8859-1?q?5I3BkFhaauALmAC/HO7gH5iE1nZrLe9cUBYIoGg7lQS/1tNcqGgC6a57lvXc?= =?iso-8859-1?q?GMuA7v9/o9mP55eRVHR6g9UzHsm2ZQXlFik8EmsPADJnc2aZzwLLbL30FVm6?= =?iso-8859-1?q?pkfFdRE10+C660Utn92+gPcs9Nt/mIpn02/q5v0uZ1Ywr89uuDwetinnGAe?= MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR10MB1582.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10c69998-6adf-4bb5-6cc7-08d915769670 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2021 18:48:52.2800 (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: VKau6vLLoJ+gX0IBEplIQDl8WQgczwTLakOKa/wy3Sa0+dFiqh4Q0aPKJ8XXf/jEV7El6WoXjZg0bbzuNetS/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4785 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9982 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105120121 X-Proofpoint-GUID: wxp1YBpP5suD_hrtEqY9vtaIROMihjoZ X-Proofpoint-ORIG-GUID: wxp1YBpP5suD_hrtEqY9vtaIROMihjoZ X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9982 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 priorityscore=1501 suspectscore=0 clxscore=1011 bulkscore=0 adultscore=0 impostorscore=0 spamscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105120121 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Add support for fallthrough on case statements. Note this does *NOT* check for missing fallthrough, but does allow compiling of code with fallthrough in case statements. Signed-off-by: Liam R. Howlett --- tools/testing/radix-tree/linux/kernel.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h index 39867fd80c8f..c400a27e544a 100644 --- a/tools/testing/radix-tree/linux/kernel.h +++ b/tools/testing/radix-tree/linux/kernel.h @@ -23,4 +23,11 @@ #define __must_hold(x) #define EXPORT_PER_CPU_SYMBOL_GPL(x) + +#if __has_attribute(__fallthrough__) +# define fallthrough __attribute__((__fallthrough__)) +#else +# define fallthrough do {} while (0) /* fallthrough */ +#endif /* __has_attribute */ + #endif /* _KERNEL_H */ From patchwork Wed May 12 18:48:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 12254587 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C119C43617 for ; Wed, 12 May 2021 19:45:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B94861438 for ; Wed, 12 May 2021 19:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344785AbhELTjC (ORCPT ); Wed, 12 May 2021 15:39:02 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:37724 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358813AbhELSuc (ORCPT ); Wed, 12 May 2021 14:50:32 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14CIjvX1006443; Wed, 12 May 2021 18:48:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=NhwVY7y1bG9It4IlggO1sX5H3wGNfypj5ulRtF2SJMo=; b=yylJ7vgMMR4C8ZjnoCSReNt6QXzdOiJeoor1GrsJXJOxfYlIM87ewQsy5FQYOYfVE9Vw JOaxROwssDXJaAnLu2bTOS7rGF4TaL6mMWtPuVuXvl/rQErwN7F2Em6jqfy3ypv42y5S Zzc/CQRmTvnGaW9ULXZmHCZJvStBykNLXfw3Cou47Kh8J2kwTwLjq4IflNzipq+qQtAF uGmQEylcU4+9K8i+Nuc52XHttJfQgw6XTtEqop2e/XleCnmoVtnPKV+OZjqj11wu645A DtCxnonVX1evoSXHCu7orEMaw5KK5ZiNQdM691yq/pJUTmD63Tjr158H+oyf/pIyX8UO Ow== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 38dg5bk446-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 May 2021 18:48:55 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14CIik8E186150; Wed, 12 May 2021 18:48:55 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by aserp3020.oracle.com with ESMTP id 38djfckhf3-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 May 2021 18:48:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KQHK6vEH4C2RGNmxaj1nGUAI0yki+NufDPm56c7i8sP9SES39B9V90AcYorXG5WA14izLBVR5ddvbcwcU+cAdoLJyvFq4y33v80urph8rFsE9HwdXrXTs4cajDmCnLb9rhMUU2gDtN7tpEj7Rm7P7o97MXEgkJDM+YZpc4l9WBku/PlAuSEtoN8C/UyL88jWGaT46gZ52lTd+TOy0fumqJAKZpEUWU3+6XDeVRXJv07dOOHF+VDFY7CYqhCWdGcHeG9y1yUERCKyEHVptCQpAJiVHkxyVEoje9xmk03IZcU73kJpAFdtth09AHT3ZZUOn2hU2LVL57f1MSJ5RTl0eA== 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-SenderADCheck; bh=NhwVY7y1bG9It4IlggO1sX5H3wGNfypj5ulRtF2SJMo=; b=byt+ff5xvePhYF7v+NQnEU9Wvec35Nwm7ctC/ki4kohOzIKM+Rd4i4gO9ZQYIh98IUMUI/xdMQgAqlhnkU0NtIGF4UF8EFebtMbk+i0LOFHaAxs0GdcMpprvgOoTDPaDG5O9IE1QhI2moziGtA5/9COKdUEjW2y0JyDlW1wScT0vP2xaCsYX3Ygaw7mqov9Hv7nnnz7YYf7KKf/5xqAMWOzn27ZX0TbpYxNRC5Wh4/AcP20GebAc0N6GsGt1Jl5DvnV+/Mz05Kv0zl1crSWKHv8J5gxzSlSYgyqGcQJI5xxss9SV4FEA5/C3DCy5ruCeB59jQ8jb+QjK9UkE6rCS1w== 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=NhwVY7y1bG9It4IlggO1sX5H3wGNfypj5ulRtF2SJMo=; b=gr7sZN5r7roOmod4T+HEQA2NfN8XeCCOv/XvqIsQJj5KbztirQUxv4MlHYWZ8GUH+dChD3Ku8tacc8O3XIYoETDrBujrlm2BGxHtH0A7sfMHomk7CLq2Tb6P6GT1Mh78eukKtDcdtai6jEFpEjHJgRNd1LbHP8Djg0CKjau8oHc= Received: from MWHPR10MB1582.namprd10.prod.outlook.com (2603:10b6:300:22::8) by CO1PR10MB4785.namprd10.prod.outlook.com (2603:10b6:303:94::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Wed, 12 May 2021 18:48:53 +0000 Received: from MWHPR10MB1582.namprd10.prod.outlook.com ([fe80::353a:1802:6e91:1811]) by MWHPR10MB1582.namprd10.prod.outlook.com ([fe80::353a:1802:6e91:1811%8]) with mapi id 15.20.4129.026; Wed, 12 May 2021 18:48:53 +0000 From: Liam Howlett To: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Matthew Wilcox CC: Liam Howlett Subject: [PATCH 2/4] radix tree test suite: Add __must_be_array() support Thread-Topic: [PATCH 2/4] radix tree test suite: Add __must_be_array() support Thread-Index: AQHXR190eoWyOuXiYUWELoogebyZ1Q== Date: Wed, 12 May 2021 18:48:52 +0000 Message-ID: <20210512184850.3526677-2-Liam.Howlett@Oracle.com> References: <20210512184850.3526677-1-Liam.Howlett@Oracle.com> In-Reply-To: <20210512184850.3526677-1-Liam.Howlett@Oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.30.2 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; x-originating-ip: [23.233.25.87] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 62557113-ccb2-4250-06bb-08d915769723 x-ms-traffictypediagnostic: CO1PR10MB4785: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1O6W0EOV35Wa/cLb5+d+1rLhy6R2nobH6x08C+ouiHONMfV6dRdMu62iKyM41PiaIz5iaoIs4kUMKNF1V96JXetJBv/jFt9GKkyR7uGJU+F4yN0ecysrns20p4jden+ggoXzU6lg+Ljb0h1+aWptmg+iqJZJHdZNNqhz35F9Jpbyt4ke9tMtdHAkl/Ilca2rTVvIcPZM6N2v+IvFje8JZUujbUwnzkQucjM4iUrIeGxsE4twLyMYiwBshFnLnWMtfd3MRA1ul1/dZ92uEyeFj0gmRC1B9nVK/fQ97+ECH7mt8Zkb6vrZ9lXLMRff41p2CnAcl1V16hulu3SPJXC8x7l0QUI1Ae8lntP0PBnXqs+igm7icAVB9+VoTK0cLabN0IhwY+chFZTP7jEbuIwaS6BCvHs3BeGoKTZZ7rqo5Z8TF987P/+gUH5nCfrBFcyQuzsgWEnVFa9lyjh5EUd5cEJte2r82Mn2YESJKf13MVyVFboKp/0DO7DoU0kDsGTzfSwyqZ+G9ak1jG5dJR9nK8kG42QNNKiAEBpC/wW0XV8ooucIa8Mux7OKGbX70qTy8Aato1LhbRDigtHiyS2LiLxVKZ7I4UtKkK1fvOU0r9Q= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR10MB1582.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(366004)(376002)(136003)(346002)(39860400002)(36756003)(107886003)(122000001)(4326008)(38100700002)(186003)(86362001)(71200400001)(8676002)(5660300002)(44832011)(4744005)(110136005)(2616005)(1076003)(8936002)(6486002)(2906002)(6512007)(66476007)(76116006)(66946007)(66556008)(91956017)(64756008)(26005)(478600001)(316002)(66446008)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?IlEkD3ISGvodtjM8LXcsSnZW0?= =?iso-8859-1?q?NwdsfnPGZAQj1SAHC4idEvw+FEx0Tor8UMJaDYY7nctYGdPGuExq6X0jVpwq?= =?iso-8859-1?q?ksQgiptG8jA1y58x1L9jTrBh1Ppeenn76UzD9VQXFC4Kayd4wjyU8rWJ7PWR?= =?iso-8859-1?q?f9gf5jS977zXM6XU1YsJIrLfURPSl00XAj0mglegy6Gj1hsqRgxSb1vxXtRD?= =?iso-8859-1?q?SSXlWI1GlVeXtZOFGAI1lAJN8+6jEtBUzUQaEwxOsY0cudUQV+N8/QooijWy?= =?iso-8859-1?q?eEMjH2HeM8PQsiLdAnQLeqrApCuKm4BVg0MfUcjFXE5AtxjqN7E0yUDMvGGz?= =?iso-8859-1?q?gsHDTSGbjdZe6Bw0gdm5jaibaQ7AbHCgAvsTbuczmHS3rFw34p4jyRTbIYSD?= =?iso-8859-1?q?MPSXdWtC8TBTfGBgVBZJ+52DxrdVoj/jPaSDCoqupmones0YdYN4oCNjRItV?= =?iso-8859-1?q?51tVzdjkcXcJTOBPT7MIMLv4dfHsC+CiLybr2CWIy7hQCLGRW0ie3EDv8eQH?= =?iso-8859-1?q?iGzLWvYtrj9BvC8ITjHsSoOGCq/NvgfpmMspuXoJO8JFxjUnGJ2ZiRYrNJlu?= =?iso-8859-1?q?vHHPqSVs+NcDmZWhsZtae0csZoQBewGuJEzV+ugGu0sG3MC1NBWQFfQ8mvMp?= =?iso-8859-1?q?4sXg7MXXETSEwbty0Q0nE+f9AeIzByF0QdIpB3nv9wv1jZIrx8q7WkGbDlUh?= =?iso-8859-1?q?igqogKFKWy6A27YGTPPeNGdVjlXisL8I+92OXgf70z3M/zjXirFfTxbP746R?= =?iso-8859-1?q?xZYbf4A49DnK4s1O5weRkAgOBH3dNBlCTo9xO77eVwign1I0RSaK9uP6MEmP?= =?iso-8859-1?q?r4J82M/VEBB8Vx0H0kcif9AFV6yHFqiAKXH5rStLoFtpn+Mv2zj0gC4kSnVl?= =?iso-8859-1?q?IoHAYVEegaPsH1dm5m56lSRDcM6mRKs1VwWzCDHRiK5D3nZRX3N+EDeBbMYZ?= =?iso-8859-1?q?w/AVZqhs6EjPzb5YwQr/eFsW2BCZUfWXjgPB2VvykCdgF/VusLyxn48T04jw?= =?iso-8859-1?q?8XXxsysFdAueuDiORGB1iHNc2VvuXmQLk+ww1k2nbvgFQOKEe+dP9RX8w6JW?= =?iso-8859-1?q?aVAY0ShDwtgZ51H9FCbCsbie+hvDrNLomNWs76267JZ9rP+R7fwOXj01r9CA?= =?iso-8859-1?q?k2R8BwIDuue29rf3SRjaBDGzr/bL+nGaBgFnhW2lH049rewPyinqT98KIY0u?= =?iso-8859-1?q?269/reEmzcHleGlHAxHpb2J7un0aXCfcdD806xcQo3vBkIbBwOuTLsc4su0F?= =?iso-8859-1?q?7TWD7HD4PuLfRxjrID2TXvI1lozxpUMKnxc4ITwrJWqrDtrgwhk5/AXy2Oop?= =?iso-8859-1?q?5vsc0moWXndaeytvinunE98sEnlXS9xJHStTV4L51cbzeeuCZQPvVTaEzXh?= MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR10MB1582.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62557113-ccb2-4250-06bb-08d915769723 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2021 18:48:52.7778 (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: 9NSKiddYiqtjFVTdOF8H5q+RWOJjTSp5PfWcVN7eEbBs7dLS8AE0LDIO2Pk3ELHoDn4e2LtK/cbrwZCD+trC2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4785 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9982 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105120121 X-Proofpoint-GUID: cjS1dQCz5yOQcc3fa94S8Bxco6JQJH88 X-Proofpoint-ORIG-GUID: cjS1dQCz5yOQcc3fa94S8Bxco6JQJH88 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9982 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 spamscore=0 clxscore=1015 priorityscore=1501 adultscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105120121 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Copy __must_be_array() define from include/linux/compiler.h for use in the radix tree test suite userspace compiles. Signed-off-by: Liam R. Howlett --- tools/testing/radix-tree/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h index c400a27e544a..2c3771fff2c0 100644 --- a/tools/testing/radix-tree/linux/kernel.h +++ b/tools/testing/radix-tree/linux/kernel.h @@ -30,4 +30,6 @@ # define fallthrough do {} while (0) /* fallthrough */ #endif /* __has_attribute */ +#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) + #endif /* _KERNEL_H */ From patchwork Wed May 12 18:48:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 12254585 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBDD1C4361A for ; Wed, 12 May 2021 19:45:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E9A961420 for ; Wed, 12 May 2021 19:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376640AbhELTjT (ORCPT ); Wed, 12 May 2021 15:39:19 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:37736 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358835AbhELSul (ORCPT ); Wed, 12 May 2021 14:50:41 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14CIjxjF006493; Wed, 12 May 2021 18:48:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=Y63T0yUFSSQTzb0SMa1dqSXd+GFHpsKHbP9JoGjZW1U=; b=IQFA0nRcSZVqNWv5OEGNJXPWVrv2WqlY5byflZAuk+bULfyjIgVYILfHyE7aea5xbpai 7Qvuk58Q+Sg+2RaEC/AKANc7B2rDD44iDHYbTp6aqXUJSADnJntiN6cvZv3F1O1pArDl C4wYnMcGoCASpZl5fA5WVbAdFNDZ92AxVRyzS1+bpET751k+xb2lNzN8ZYb1BcRcGTYq TKW0tfsRabctLSFKSjR1qL3J9zQ+bBTz5Rvogx2/tgsmUCCM0re8tHQLSULrW3hz9yu1 q5D8pJ6mri81YqEmdOSGy+f4z8K8fzXTtQkRr/gBSTdEAx5YxdqS2B4uGS1cMqYNSD1G wA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 38dg5bk44j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 May 2021 18:48:57 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14CIk5nH085840; Wed, 12 May 2021 18:48:56 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by userp3020.oracle.com with ESMTP id 38fh3yj59b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 May 2021 18:48:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HGduYFIbOViB+NV0XmLfpuke0jIwMEc1eRp1qKOQ8CSwi0RVaqTJhS4X15q2DcSHB+1XodwflqWLgieM+E1eFru0EP3uAmH4kO999H6uRYIYS9IPehy3Xa6wNEG25DQYgJ5vdcXvjHiKsQWcDPun4iMV5d8X3wKqpeNSR0gtmM6LC4/JVwDHpVeGYDuKCP1/SewPY0jR/K97LYor7pZThPV8kQnotqurYM/9BZIx24ZJgzP+w/vxMO5fd6czF8UvHQpqitC/KhOnaBYhgFJ3we9AZSUDwrWhoX80RQ2zlc/yPia+wrIbQ/lZQWNbtIozRwkAWXU5/jC7Rdb7xxtznA== 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-SenderADCheck; bh=Y63T0yUFSSQTzb0SMa1dqSXd+GFHpsKHbP9JoGjZW1U=; b=l9TVBapusBY2juZA9VibqHPgxJP0+toegpQQI6JHYSoR1r65AW3t1Xiu93ARnWmg9qV7JKgecmks1qSIbGdM6rH0znsQEhEEv2ActXFbnJraMCoGn88qPXHpBFigSuJuoSSbiiP4j7RDmXsf7bD2kZDRfeZ+xHywW2dTsBVDFQYPus1GaSkQtbk1CDzZmLehgWcb8+YrFeY4T7speN9O5WnOqxhnVn9cYPYg4GFGC//OmPtBHWL89+MlKpTJWThVNCAWAI+8OOw97OGSXIC38WUFieVZ61DCS9nHc99e01J0NFUxXUnughITfaGOxwnqxQoCWh+M/8CFL5+ipfB+mA== 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=Y63T0yUFSSQTzb0SMa1dqSXd+GFHpsKHbP9JoGjZW1U=; b=LS0ot6AOkdmpSd/YrO9VXlW1Nwvr8EbrojTJP8WAgpndB8l2Iy1X/FBoqBAx/Xxyj6x+tI+F+SGhUry/5OwvXdln/TIzPJqmw5olLRN0p24oCXkU+KUgyW07tF67EcjmagCGHnJzDTLVtCKHZRJNDYM43YLbKL679l6ytsqeGCE= Received: from MWHPR10MB1582.namprd10.prod.outlook.com (2603:10b6:300:22::8) by CO1PR10MB4785.namprd10.prod.outlook.com (2603:10b6:303:94::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Wed, 12 May 2021 18:48:53 +0000 Received: from MWHPR10MB1582.namprd10.prod.outlook.com ([fe80::353a:1802:6e91:1811]) by MWHPR10MB1582.namprd10.prod.outlook.com ([fe80::353a:1802:6e91:1811%8]) with mapi id 15.20.4129.026; Wed, 12 May 2021 18:48:53 +0000 From: Liam Howlett To: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Matthew Wilcox CC: Liam Howlett Subject: [PATCH 3/4] radix tree test suite: Add kmem_cache enhancements and pr_err Thread-Topic: [PATCH 3/4] radix tree test suite: Add kmem_cache enhancements and pr_err Thread-Index: AQHXR1901beegMufDU6I/WagSlLBNw== Date: Wed, 12 May 2021 18:48:53 +0000 Message-ID: <20210512184850.3526677-3-Liam.Howlett@Oracle.com> References: <20210512184850.3526677-1-Liam.Howlett@Oracle.com> In-Reply-To: <20210512184850.3526677-1-Liam.Howlett@Oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.30.2 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; x-originating-ip: [23.233.25.87] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 15b8e143-5998-4015-642e-08d91576975a x-ms-traffictypediagnostic: CO1PR10MB4785: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Nu+mvqJ/kIDuA5efqLxvsuUjtsT3pNCO4N0r7Rsr+UDY1S+MA6SDtBgighvcOOyLC0lj8i2GJp0SwQVR3rK9ZM4O3iW4PBY7JQCinSl22W17Re864BF0eYMCtro/VwxsimehXzsirYjCITjNXk7u9BIEa9DFxQorLamrfJEshIOshNfadYDC1HW+EUohEqqnDdW0WgcRzCQtXDTqUj7JviwxDLycRfxl2ulv1vL4kSlowNy27WaZNBMs2z7Ys5WGAt4ww8QLad3RW1oeYR2k45VXwIqbXxU6eVeMMRZWlHbPqAWPG6hibwt1+j/MrfJV6+LsUqRr+dU4bL3xf/5KZdwdFt3MXDevUJI0QqOH0R/jJ4Wwr32WOS9/PeBPgxQHMOEBZlCrkGX5ZoXowOT8ZqFdr02BpiZxTv9o3PuIIe3NqrYp+MfZF4TGVmmZsiCLrzLcV2M4tYZzyOf/nQztYpn84QXeQPNhN8krLC0Gim+9BnPbZeSECtspZDH6NuLIPG6cuxz6qP7UXWT/te0KO1t8nFfmRhceeYeWjsIpPFwyl5HkRGntRnH7C0fM/tDacdnxDnHL26slxrmAoARqyRuJmtiQYjmkCBmZzTzrf5k= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR10MB1582.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(366004)(376002)(136003)(346002)(39860400002)(36756003)(107886003)(122000001)(4326008)(38100700002)(186003)(86362001)(83380400001)(71200400001)(8676002)(5660300002)(44832011)(110136005)(2616005)(1076003)(8936002)(6486002)(2906002)(6512007)(66476007)(76116006)(66946007)(66556008)(91956017)(64756008)(26005)(478600001)(316002)(66446008)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?BxdhnTxDkCf09NCktj0XWu+JX?= =?iso-8859-1?q?zy5I99+yo8Mjj/Xh/7rmdjnRVf2Vvj347OSLGdH9hICjFwljl3WKK57Ma8GJ?= =?iso-8859-1?q?fMYW4jO1mmL6t8FVOSI4m0uQ7mdHaF9C3Hmy3Pn455f4h5nsEwebAhUE/496?= =?iso-8859-1?q?xF2RWf0MJrkXz3FvPqUonaKkvIqbFtMZYpVTcHEGE8O+pb3QCkYCIKFOwXMo?= =?iso-8859-1?q?ERmQFXFJ3xjJr+0/dUkmxPSdtPqlZQFjp27L+OmLGxIrEwe8DpAGnrfsZ2ez?= =?iso-8859-1?q?X0V/dzK255F3XGQobi7vfan6+ouyS7NFkh01K9pbrl/MBNMAUlMT1dPSGFNL?= =?iso-8859-1?q?ybQmgOAW0ddlbh0V+aYwYLx5aQW0Y4Ink8E0bq+Z9FnD9Elo/FqD30cLlR+y?= =?iso-8859-1?q?bcDs0L164KqUYFYjnhQt/9uuU46zL7jOdfaOb0uJtwWdnQ+IS2YFQL4iYvYs?= =?iso-8859-1?q?d6eHK9qn5JYkRShgvcWRzrjrftvLFrmUC03r/uHXESE+5Bc368ElNiXqgr+1?= =?iso-8859-1?q?P2vCat2oGA17KN0P7dhgxyoWI56WLwDEoFkKpcMfmh5zjCS1E4yxuQM7gme4?= =?iso-8859-1?q?F/QgBtjQOVPYevRfVgV4Br+CwfWpsmi26My/ukJDgdubex8exe3ob8uVZZvO?= =?iso-8859-1?q?eN4fwQM1Ia0k9thyWKF1frJttwi/yDiAcH79DizbT/QwZgvPqCaYE7OcCUzt?= =?iso-8859-1?q?IA27y6FHzZ13fPb8cuqX01bfGWm2ee4fLEXTJjq5KBE/1/tlGgwp+D14Br5n?= =?iso-8859-1?q?D6LFyjGJicLP8FwHdaP85y/zpqDKyNWvVud7olnmeLdUyGkidTNXdHc/jRIT?= =?iso-8859-1?q?GmxERdXs624C5+1MCkR6TIXVKchJY8oIXlQpcWqV8GzZJkf30KttkxNZEiZA?= =?iso-8859-1?q?n5VqM/l3Ebkokg0onIG8z1qxCVcfdqTV9L5TUtf73gbOLA4S6SjfA29qdr23?= =?iso-8859-1?q?wdm14jXWK2WKW3ST0TKJEbcrTwC5V/tD8Wl01yLVhcGPvRYM0SSkli9g2Vdr?= =?iso-8859-1?q?Ihvb7i+9c2H41DbY/v10VFpU6XHGzlDQECEANK90B0IG/4fDSFSgJRbqYQbx?= =?iso-8859-1?q?/ChefbePdAcSjl329pY25b/aXJagPhVnSLtsHbTLkNpgBbirz1P+FLOpiB5A?= =?iso-8859-1?q?SNdu4XV8SPEEU9CZob2/iM/nUNPXqgAh41BbAmOezGh4G4oEg8QWsuUZrMBp?= =?iso-8859-1?q?1LELlMW0G2ZljMzWuXRSgbF9MgHh3uBph+B8d8gpAs4LWJ81xuSR9k7ZNCmG?= =?iso-8859-1?q?E61jmKwSPUCZf2AQW4eA1lsVi0Phe8ewOhY+AuasRHQIm5H/4V204GwfMzXq?= =?iso-8859-1?q?t6DfcF9Thw7XIOCBzrNFkw0DW8jkUmG0EKBvYTdp+1h9BtHw48Xj8C+f8Tn?= MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR10MB1582.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15b8e143-5998-4015-642e-08d91576975a X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2021 18:48:53.2516 (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: v9h47eQVThj34u/BLbCHiw8lj4zK/v6f4AnkPLcDZESDWKCNLLfUOdzk9hC0pFhDF+lHLktJCXML+XBv7bUg0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4785 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9982 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 malwarescore=0 adultscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105120121 X-Proofpoint-GUID: fG3ZXdV_QpaITavQzP35wrtQcEYGl8ZL X-Proofpoint-ORIG-GUID: fG3ZXdV_QpaITavQzP35wrtQcEYGl8ZL X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9982 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 spamscore=0 clxscore=1015 priorityscore=1501 adultscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105120121 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Add kmem_cache_set_non_kernel(), a mechanism to allow a certain number of kmem_cache_alloc requests to succeed even when GFP_KERNEL is not set in the flags. Add kmem_cache_get_alloc() to see the size of the allocated kmem_cache. Add a define of pr_err to printk. Signed-off-by: Liam R. Howlett Signed-off-by: Matthew Wilcox (Oracle) --- tools/testing/radix-tree/linux.c | 20 ++++++++++++++++++-- tools/testing/radix-tree/linux/kernel.h | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c index 2d9c59df60de..7225b5c46bb6 100644 --- a/tools/testing/radix-tree/linux.c +++ b/tools/testing/radix-tree/linux.c @@ -24,14 +24,29 @@ struct kmem_cache { int nr_objs; void *objs; void (*ctor)(void *); + unsigned int non_kernel; }; +void kmem_cache_set_non_kernel(struct kmem_cache *cachep, unsigned int val) +{ + cachep->non_kernel = val; +} + +unsigned long kmem_cache_get_alloc(struct kmem_cache *cachep) +{ + return cachep->size * nr_allocated; +} + void *kmem_cache_alloc(struct kmem_cache *cachep, int gfp) { void *p; - if (!(gfp & __GFP_DIRECT_RECLAIM)) - return NULL; + if (!(gfp & __GFP_DIRECT_RECLAIM)) { + if (!cachep->non_kernel) + return NULL; + + cachep->non_kernel--; + } pthread_mutex_lock(&cachep->lock); if (cachep->nr_objs) { @@ -116,5 +131,6 @@ kmem_cache_create(const char *name, unsigned int size, unsigned int align, ret->nr_objs = 0; ret->objs = NULL; ret->ctor = ctor; + ret->non_kernel = 0; return ret; } diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h index 2c3771fff2c0..e44603a181da 100644 --- a/tools/testing/radix-tree/linux/kernel.h +++ b/tools/testing/radix-tree/linux/kernel.h @@ -14,6 +14,7 @@ #include "../../../include/linux/kconfig.h" #define printk printf +#define pr_err printk #define pr_info printk #define pr_debug printk #define pr_cont printk From patchwork Wed May 12 18:48:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 12254591 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CBB8C43470 for ; Wed, 12 May 2021 19:49:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D1B06141C for ; Wed, 12 May 2021 19:49:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378107AbhELTj3 (ORCPT ); Wed, 12 May 2021 15:39:29 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:37842 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358836AbhELSul (ORCPT ); Wed, 12 May 2021 14:50:41 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14CIjpcO039831; Wed, 12 May 2021 18:48:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=2AUChyL1YDsfAL9qtR4tOnBwVF+/pbaF+GWIekH6RJM=; b=AHmpb+juOOz9459bDA8Sr1rsQYnqhR4rxB8AzMb6QvqOuUfvN6A7Lbn2Ck9kebRUt1Cq u2SeFDwDjXkP/RtZqWrqpTGalMOdMDivFdChV1SvyJjbtphtf2vD8DqaKj/USEhfrQTF u5qVievBX2uIgnicnySoNjJwatqvavvduv8fahhlQ1eygSCxXtW0kPst03sF85afRhvN XbzuEXloR+BIL/OMm/OAQcnU9A5Rd8ajQw0Y5Sf0CMzQLIJeA9K4NUmJS4nHd2Oxnnz2 j7vTSS40h9bL96AQogQKBGz89kLRTeotHEzFKF3dmWNrgRzYsqLG3/iElL2L1hMfyRng xw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 38e285j8k3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 May 2021 18:48:57 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14CIk5nI085840; Wed, 12 May 2021 18:48:57 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by userp3020.oracle.com with ESMTP id 38fh3yj59b-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 May 2021 18:48:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kB9waYSbxUPMWRqNAACUeWZtukYXgG9ITXDDzhZXJrQ6ghnUsAfTI9J6Nh/pU52YFZi51Pa8gmhsmiskOfd544vr4pmATd1IcA9NpGM7r220SqSMBOGVj9WVF6VgydTIFWN6x0N4KqGYeVCdVnHvUYeam9dUrofvWJwdf7CzKb6temUWA6RI8EeaNzCzuyVx/WLsei6OkcZLNQrkLbw/ScAOKF7ydM/hLCTD+DGp8VcPLBcVWFPeWyAg8lbrNdZz9Muhe/YwaxW8LeRm+LLlAxRb5O83+Pj0t30gzsEUkPkxq5FuKAvBu2RIbk0PwbloZOM/4ffyuuGlS7sCyoa0wA== 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-SenderADCheck; bh=2AUChyL1YDsfAL9qtR4tOnBwVF+/pbaF+GWIekH6RJM=; b=GCvGoy0NPDA+SjmW1sK1wH9U0iyfRDxdCsz65TrITA18pxp0F5WISFo/2NQmFTGHGMsb0cRgttEFTmeAFkZ5qd/fwiX2wy2iSZyQ7i8PkV8uf1kzATPzpGqZfvEYlyKoTn4II8MAHsa+FtKyEDJBjt6+NNYQqWg6oWPP/xe6pp60BeUM6rIC2o9abvtfyDUjPBuUboMUqB5+wt2b0G89H2R1eBQlsd8pKzMLPrpKp0skMySB2lkch/bJJEz9AS243ljsLj/nBG/hL9hnpHI+tQOeUouBEINVZSSXFon3mGxliYlDXwZMkCGDpikhKpYkmNONsdAxe2QNisvT/WwSWQ== 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=2AUChyL1YDsfAL9qtR4tOnBwVF+/pbaF+GWIekH6RJM=; b=zdOkLw4VLt3qCtxMPiqy9noCKf/1OxjwZg543uw+PjzUR8wiY25LRt1yhoCXIsrrHjgGlM2LYmCfW0SJSCPxSqkmnvIisrJfoUtcVYt+Q7EnpYaTHXsZfL3SIjqFooKLC8sPX+lqErZkrxImX4fRqdPoxXmo2eKptYNzahhJMDc= Received: from MWHPR10MB1582.namprd10.prod.outlook.com (2603:10b6:300:22::8) by CO1PR10MB4785.namprd10.prod.outlook.com (2603:10b6:303:94::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Wed, 12 May 2021 18:48:54 +0000 Received: from MWHPR10MB1582.namprd10.prod.outlook.com ([fe80::353a:1802:6e91:1811]) by MWHPR10MB1582.namprd10.prod.outlook.com ([fe80::353a:1802:6e91:1811%8]) with mapi id 15.20.4129.026; Wed, 12 May 2021 18:48:54 +0000 From: Liam Howlett To: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Matthew Wilcox CC: Liam Howlett Subject: [PATCH 4/4] radix tree test suite: Add support for slab bulk APIs Thread-Topic: [PATCH 4/4] radix tree test suite: Add support for slab bulk APIs Thread-Index: AQHXR190ZG3e9pzf7UmqWG6nJYdkiQ== Date: Wed, 12 May 2021 18:48:53 +0000 Message-ID: <20210512184850.3526677-4-Liam.Howlett@Oracle.com> References: <20210512184850.3526677-1-Liam.Howlett@Oracle.com> In-Reply-To: <20210512184850.3526677-1-Liam.Howlett@Oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.30.2 authentication-results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; x-originating-ip: [23.233.25.87] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 32010078-cca6-4692-2a22-08d915769786 x-ms-traffictypediagnostic: CO1PR10MB4785: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9OR69fU+j5VyVmBKyCF1kJ76uaLzjZE3zhLW7UTpuceEmmcX12J6hlN92if6JREENCIKSHRJl7d6BRQfF4WcDiTxWVrbT9YNd/NBPxodTH77B/aBWy75ZVqpModxohzJqIKJExEXvULn95K+O/n8t3YY+PEQT4oYYJyOs9NyF8St7uhwEaSxPLdCcbrg3jKkHuURl7Is+wwcAdgGm389zyTPCkyVsUl+8RwvO6dWe0fvnsqzPfTnzcjgS1q3Huw2eGfjgtO1/P5FTe8FXRt4nKMZ+N69Mg24rZmnlj4DZhlYJFg4Jz3ProF99bqD5Npij7NVdzBi/YWTlQ6AgNcgt08FlLc6oFslPbmIEQ9VKAoD4MeQus5EOomeMtjD67m15WVQIY+srZh9FDT2IBnmtB0TcBJPLmLDrpwCAbuhhTZGhrVvugCwt/oSr8O0S3GfL66H96r7jLzbThd29YsXBd/hFX4T5nlYPJYGcBJwo7qcHjIj3fBjYX6Wt6uDi1+vb0JBy7UG+am6TP3Q3ZQOVihylNFZE1Tvh/lpfs7HW4sNPBQ1NSt6q1mqnVRTolblJFSeM7t0yzoadjcWLvs66b8tjtOmCH5hQ6UqeW7MFkk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR10MB1582.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(366004)(376002)(136003)(346002)(39860400002)(36756003)(107886003)(122000001)(4326008)(38100700002)(186003)(86362001)(83380400001)(71200400001)(8676002)(5660300002)(44832011)(110136005)(2616005)(1076003)(8936002)(6486002)(2906002)(6512007)(66476007)(76116006)(66946007)(66556008)(91956017)(64756008)(26005)(478600001)(316002)(66446008)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?q?Ez4JB+99URFVzuohlJX0TJ2DZ?= =?iso-8859-1?q?UsVCuX6ZBdiEdeJZS8GiWciccz2h90/fu3HwLG/QxqS61DgrMPC0Pt06nUiw?= =?iso-8859-1?q?zQFVkUFXRu3gRvyCfxiEJS2TQp6sDZ+JMDjcUNVuhNyAPHncD0DnNrdnXoVj?= =?iso-8859-1?q?h/u2G2grvjAf2NDjd9vt2OaXIJRgf8wkp+HtRTAFq8zAodD/K2HHwQ7FhTV+?= =?iso-8859-1?q?unkfMUrB72yI9ytkKI3Spm2uRjJ62B36V5VU7yduQAYUHSjPFk2jbbyLlYdD?= =?iso-8859-1?q?BpPqW/YLVdu/UCIQL2DPo1/Dai8IKDBWGgP/cCWAyPfuFMPpeXKXpMS3E5Ee?= =?iso-8859-1?q?4VBRUqlbJdq8nKlSmVlfNOatkJCGX/VhjQAd5i/o1rk0Ob+rH8gOXP8CA1IV?= =?iso-8859-1?q?Wg0+ILkhFOtQ3qM1qw5uv/mvc7m2IkGcCg3ZI1QCAQVZhENykbOKxyF0tbrR?= =?iso-8859-1?q?CSWok4Q0TNyAi3yjYjej/ZWsMfyDSE+JgFFz2QvaHAacqIZxRIa2UWf5qI+O?= =?iso-8859-1?q?zmbKmuMkcfnoKkp93CvecowBitS6F/KgW6ALdSrpQ2I6BR19sep4ESsnauQm?= =?iso-8859-1?q?m4CP2UTnG1PcTkLLYxbMxW4tU1fyXLLFTJcZfzuqb/FuMEA2DCseMwmolFIL?= =?iso-8859-1?q?Kw75UOE3PijzI0JufkrjFVZZ8PLxag9yayt6NPE/NE1EM0pWqkAh8oCC1DVa?= =?iso-8859-1?q?k0+eq/OUmnB3P3IFW78Wnxe7sEkTvVHsLvPwIii/LGtyd9E7oSjpKlOfPxAl?= =?iso-8859-1?q?X/pHNfdK6EXfE1dPC2OYHbyOe08kXZ8Qu0pRxfcerJ/cRW1jttEuHP5NiugA?= =?iso-8859-1?q?N1dsDZ66UIkBzaHxZ5qh3Cf+kNjWkmj35AA7u92Bp5lGhcCekCusLbT6++os?= =?iso-8859-1?q?hTABJmJcDKkcsfghl0oHi2snvTYNvtNyj7w1Q1EUFY9XZ80FOGNVssVaeLN8?= =?iso-8859-1?q?7Un36amAAR470rhrQ8zLLuraOEzvGzHxqZ0QsRCIdvtMDlThuZAewkzbPiP/?= =?iso-8859-1?q?NSAhF7PSon5g/G4u/3UDEQN7LkLQUQYOTnpQ10C8funAiBVyiY7D0GroEddB?= =?iso-8859-1?q?y2n9SQ/FQFPADWjIAZekoMWGMhgQhSb4pal2c9eVoeM77wY42juf0zxALrAX?= =?iso-8859-1?q?SkB6h1lOGnxK8IayTNHKDd7ABybLqJ+1wTA9Hn7csAPvgoKBWfa+ZHDedDQE?= =?iso-8859-1?q?Ewg0GxFIXM3dx15HAXuuykrIcqsf/OwpGGUYArVMrVwQtPY1Yd753KORdaRi?= =?iso-8859-1?q?ZzX1hIZ337ZjU+BTSOJdTtr2IJ3f09wpzAw1VV1vvyV7CItT/EeXQc1hpyjk?= =?iso-8859-1?q?8TJBaNF364avGav12FSW9WD3g+pzm5Gjkq2POfDDLTUFApv3RGpYeoXbnVC?= MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR10MB1582.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32010078-cca6-4692-2a22-08d915769786 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2021 18:48:53.7844 (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: Mg4HXCK+QZmZzbLw7gJhewZJI5fjVADqO8vbrcqxmAQhYFw2aHNG4xMRqiEUQQjbvYiU60XKwfy/3m6Zmdc1Dg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4785 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9982 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 malwarescore=0 adultscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105120121 X-Proofpoint-GUID: yLv5BSgi0Qd9xVdXizG7k0Z5PRMK4mpv X-Proofpoint-ORIG-GUID: yLv5BSgi0Qd9xVdXizG7k0Z5PRMK4mpv X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9982 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 clxscore=1015 impostorscore=0 phishscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105120121 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Add support for kmem_cache_free_bulk() and kmem_cache_alloc_bulk() to the radix tree test suite. Signed-off-by: Liam R. Howlett --- tools/testing/radix-tree/linux.c | 61 +++++++++++++++++++++++++++ tools/testing/radix-tree/linux/slab.h | 3 ++ 2 files changed, 64 insertions(+) diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c index 7225b5c46bb6..726407f934d3 100644 --- a/tools/testing/radix-tree/linux.c +++ b/tools/testing/radix-tree/linux.c @@ -93,6 +93,67 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp) pthread_mutex_unlock(&cachep->lock); } +void kmem_cache_free_bulk(struct kmem_cache *cachep, size_t size, void **list) +{ + if (kmalloc_verbose) + printk("Bulk free %p[0-%lu]\n", list, size - 1); + + for (int i = 0; i < size; i++) + kmem_cache_free(cachep, list[i]); +} + +int kmem_cache_alloc_bulk(struct kmem_cache *cachep, gfp_t gfp, size_t size, + void **p) +{ + size_t i; + + if (kmalloc_verbose) + printk("Bulk alloc %lu\n", size); + + if (!(gfp & __GFP_DIRECT_RECLAIM)) { + if (cachep->non_kernel < size) + return 0; + + cachep->non_kernel -= size; + } + + pthread_mutex_lock(&cachep->lock); + if (cachep->nr_objs >= size) { + struct radix_tree_node *node = cachep->objs; + + for (i = 0; i < size; i++) { + cachep->nr_objs--; + cachep->objs = node->parent; + p[i] = cachep->objs; + } + pthread_mutex_unlock(&cachep->lock); + node->parent = NULL; + } else { + pthread_mutex_unlock(&cachep->lock); + for (i = 0; i < size; i++) { + if (cachep->align) { + posix_memalign(&p[i], cachep->align, + cachep->size * size); + } else { + p[i] = malloc(cachep->size * size); + } + if (cachep->ctor) + cachep->ctor(p[i]); + else if (gfp & __GFP_ZERO) + memset(p[i], 0, cachep->size); + } + } + + for (i = 0; i < size; i++) { + uatomic_inc(&nr_allocated); + uatomic_inc(&nr_tallocated); + if (kmalloc_verbose) + printf("Allocating %p from slab\n", p[i]); + } + + return size; +} + void *kmalloc(size_t size, gfp_t gfp) { void *ret; diff --git a/tools/testing/radix-tree/linux/slab.h b/tools/testing/radix-tree/linux/slab.h index 2958830ce4d7..de3befdf14df 100644 --- a/tools/testing/radix-tree/linux/slab.h +++ b/tools/testing/radix-tree/linux/slab.h @@ -24,4 +24,7 @@ struct kmem_cache *kmem_cache_create(const char *name, unsigned int size, unsigned int align, unsigned int flags, void (*ctor)(void *)); +void kmem_cache_free_bulk(struct kmem_cache *cachep, size_t, void **); +int kmem_cache_alloc_bulk(struct kmem_cache *cachep, gfp_t, size_t, void **); + #endif /* SLAB_H */