From patchwork Tue Nov 7 23:07:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13449424 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 31A51C4167B for ; Tue, 7 Nov 2023 23:09:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2E0D5280007; Tue, 7 Nov 2023 18:09:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 269F0280005; Tue, 7 Nov 2023 18:09:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EED34280007; Tue, 7 Nov 2023 18:08:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D23D3280005 for ; Tue, 7 Nov 2023 18:08:59 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A0D1E1A08E5 for ; Tue, 7 Nov 2023 23:08:59 +0000 (UTC) X-FDA: 81432700398.21.5746D44 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf18.hostedemail.com (Postfix) with ESMTP id 602D61C0005 for ; Tue, 7 Nov 2023 23:08:56 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=NKEQwCiA; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=x4HdgYbC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf18.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=ankur.a.arora@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699398536; 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=zK8SFzx6JjVEKci+tBZyL2d70uL/RG8LSxDqG81d3JA=; b=8QPF1YmsjQiOCMLwnXvsVYkooFiZbgzjkWOsiXzPPE89Rt5pOGZNB2P/JL5oZsbefRNS0Q ETVvZ8RNfoPew2UazthXb/bPt+PTBoYJ4iWXO+dWzh11UKQcnNPhWLd8UzQ3F+H8ccZ7K+ 445Q8bmokJvZw3v4nm3I573uvOku4cg= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1699398536; a=rsa-sha256; cv=pass; b=xMdA6KwVsUFmxDx3qucOBsugaZ1XhbffPE0VUUpl5A3FL91iFgjOk0hdaS732dVm+C6Saf 92G8w2P+aFVAI0gj8Hhza2rY4nXXVNMXQEwBXNxYLAb0q7ya03IEbu4XrMvExAcVQDbrT2 S0NVSJ9tBT9FpDTpm8hq+ur96ipyIIY= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=NKEQwCiA; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=x4HdgYbC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf18.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=ankur.a.arora@oracle.com; dmarc=pass (policy=none) header.from=oracle.com Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7LK6Lq026463; Tue, 7 Nov 2023 23:08:29 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=zK8SFzx6JjVEKci+tBZyL2d70uL/RG8LSxDqG81d3JA=; b=NKEQwCiAfgp3pJb2anY0CClEi4FMqkQ1xDK2Qyp2wUqDnTXcpfmzpY07MsQvRNmcZjPB 1biidY3UUYH5ovl4pLYuu4ajoYonZR6z93naAV4PuD2bNeT/85i7oyBlYB6cxSdHyxHb 5rDGmVpQ1u1+4eJg0NVKwgjM5iTbIxg5Y7GkUgm4CGIsqr8V4Y4rsXCUw3KMs6NARt99 l3tg1gzeyuu/+osKh7GNhNuSkoMn8BenBjTPue1fhcHKgFMkvZWz9YtAEcwI94kxPhWz zBAfPH42SYuhAxr4/o/mQQmAqIh0PtK0IzIsv7DBXVWpGmR8bCsUkF2pImcPUxAhAZlz kQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w2106ut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 23:08:29 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7N3tUW010979; Tue, 7 Nov 2023 23:08:28 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u7w1tv94e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 23:08:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O66h11kv6FJUxDYcbB5rlGAHepZGVteYkwskpd80All0VZ4dk6q6bkSISfi7DTbKPz1XqUtWCQXAjDt669WwusTtiqJhLVue0XQArWZ7mjXaXtima2Gc5mzKrGUcdyjaTtRlwjt1DEht+4k2EX7m+PfXvF5XHlUDUsYPrs417ZLPixPBND2+b7QHwOOxF5w5RuaW934xPR675EIR//c1PeDiXmBgaYnyKd1tZAOVTFzFzor+KKr8meuMYTfQxz19txEM9jGSkKdbfJDhW2gAsFMXor8vY2htY4CuYGjW6kk+mSyIHtCtCSveT2jRBRlSiOX81kuWJVtgyX0zOqI9CQ== 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=zK8SFzx6JjVEKci+tBZyL2d70uL/RG8LSxDqG81d3JA=; b=LLpn22HrZjK0iPVvhQGdWab2KpjwxMDvDh6xF70d8LnlaArN4sqvdXy7+ZObYQ0YtipHWdnTkdnlaV/lmhuzmodwAYZbMNM38z6rfuvq7QearGS17l7/za094S4I7KzUIMroH3BY2OLErxCYnfaypoY/CHQLUn4/p/fCKXd7uuJGtqEQmTAo4xKOLgB3+N/u4PgGN5oJpI8szQCu9fVRPy+ZwWI/XJzFUF8ncqRNrj4Abnyrgfn4cBu8k28lxYAmgBKGyNjFVrxoufiDv8+KKGZ36aJRhMUiwYRHqQ9edBuN5zSOsumeIK6r6805skCdR09wYX/UuBen3kOudf7ITg== 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=zK8SFzx6JjVEKci+tBZyL2d70uL/RG8LSxDqG81d3JA=; b=x4HdgYbCpPPhDE4ZRqEdm3eyzAf7E857m2UzlXYoZ/GTLJ1MhmBorSmoILpDPb/4qx4shI4KkYajRcwSjb3GIKsy9qcKq5nJnz0HahM6kCr+7Q3SS2iV62LyZTDX5eejCkQye7VIOX+DkDg4+Hn0sC6meazvYF+S2Lv8PGX3bj4= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by PH7PR10MB7010.namprd10.prod.outlook.com (2603:10b6:510:274::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.25; Tue, 7 Nov 2023 23:08:25 +0000 Received: from DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::c72:c098:4fc2:629b]) by DM8PR10MB5416.namprd10.prod.outlook.com ([fe80::c72:c098:4fc2:629b%4]) with mapi id 15.20.6954.028; Tue, 7 Nov 2023 23:08:25 +0000 From: Ankur Arora To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, paulmck@kernel.org, linux-mm@kvack.org, x86@kernel.org, akpm@linux-foundation.org, luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, willy@infradead.org, mgorman@suse.de, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, jgross@suse.com, andrew.cooper3@citrix.com, mingo@kernel.org, bristot@kernel.org, mathieu.desnoyers@efficios.com, geert@linux-m68k.org, glaubitz@physik.fu-berlin.de, anton.ivanov@cambridgegreys.com, mattst88@gmail.com, krypton@ulrich-teichert.org, rostedt@goodmis.org, David.Laight@ACULAB.COM, richard@nod.at, mjguzik@gmail.com, Ankur Arora , Julia Lawall , Nicolas Palix Subject: [RFC PATCH 57/86] coccinelle: script to remove cond_resched() Date: Tue, 7 Nov 2023 15:07:53 -0800 Message-Id: <20231107230822.371443-1-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231107215742.363031-1-ankur.a.arora@oracle.com> References: <20231107215742.363031-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0331.namprd04.prod.outlook.com (2603:10b6:303:8a::6) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|PH7PR10MB7010:EE_ X-MS-Office365-Filtering-Correlation-Id: cfc9d6cb-b1ab-4b0f-996f-08dbdfe671c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x5XANYS1fInMB+l7L72Xsq+KLEtLLwu6NcMM1VyhblfvZjMELnaqv7VLVvMj4OaaacN5UmSIUV4ly9wzVR5lIXCqXnEvY1ZHU38TOm2ZNwYoLRGuV/dBltjIFmlH41Ql4YUtGziVBuBBV8s3FvEtEOxjIBt+saOiWEzucDN8gEvOr5TtX54oDvkL0hBQshQcyOtqWfOVAVox3e47q8wbzGWP3nQkyVxAAaYKWO9euhCk2wwaTvhXNPugWgX68C/BPySi0jKI/hBxtZ87WRazx3BptaxBPj9uubiaKN1d3aHOWQn2KRvKroH5dAEQ06Rg5F5cCLY4GSyNwFoUCb2vXjStI6BvsnV0263pRzSvAnYA0yJIrc3vDNyN/NGEnUTgVXzP2b+18/eakHNOiFPQRHSlXJNT6G+DGmv+/eUQ3v6g9lOkcBb8HC5YInYuHZirSuhJ2vcweoagTUaIa9PpLujZTdnu2LZkpCwlCEMULos5j6wre0r+lBZc20RaigUSgrwkpYz1chNs9Gx1huiXe9ba7IB8y7C+HJzXle2Uzr20dMSjPf7Cr+UmSbKLOD4i X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR10MB5416.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(396003)(376002)(136003)(346002)(39860400002)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(2906002)(7416002)(7406005)(6486002)(478600001)(6666004)(54906003)(8676002)(316002)(66556008)(6916009)(66946007)(5660300002)(66476007)(4326008)(8936002)(6506007)(2616005)(41300700001)(1076003)(26005)(83380400001)(6512007)(38100700002)(103116003)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: G6rJbBB/nG5+yQw8C75xwNEb0oTLrR2vHz5hM7R0lrROez2FUOnMjx7iGIGYJOJi2dZph8PMoMK6zahixJdcNkS8ug7+liGDS5DAMe0sP77o1U1a23Qi56ca1nqDS2u1FAZE3hKATM4vibHaemc6MjngDczXzxqmked/XC8jK3y9MCBYni0Dag/na/Gui8AhnNFQ2+6RS+oej5CzFb3g4kg1sMjg8JlONpWj2J6x45cJwAJIHquozJga/pENywYikP5tdaD9tWYN4/wm7cLIbyE8Ibr8fIbO7XVcKRBOCOC3BfqHkqpr3Fle/MqGKVU8Xk+RlKBP45c3aOJ9Ehb32TKi1GggSeYVdI23O2klkcq8xwgbD+xruc5mboEfH7ZDZQuyQXY4IHAfWTU8qPoNLUMAePAtqmlY5fbhOUqoLwRARWokuDDht/1qBISO/EKnunuK6DfOoH8IBXB+I/DgshY5G7b2pDtc98fnWn1HKmlxRZOQgGcIGj517uCoK40hJlbgDWpC9zmlj1NfBhdrUYm4qc7e+ed+u4ZVaMdOooZj9G8cDy46q13v442T7KL5ZbecogfZlCcv/Ti87c/tcuEcl6nWy3U4Vd3Vd//vfwuUwZ6PE69iMSFBKwy0+8K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uq16PVKeC7ui33/QCNrKOFbeV7vZOnMlmKX+cqn1XOwZecv/YzK31yr8Xa7XDRNBW280JVcOWrzX73DygrmLJ4gKDftzdWILkOQjcfFniaEqtza0CPZz73GS5vCumTmQP/BxukGXvQNir2+2PiC6hbDZEAMcEH9HyWUuKrurBSO/r2FjW76WghMVUuVJhnQOk68rrOs3O00d/7mL6/Ym5rTQ1fL9ibdgQ7hs/hHmy71Yz1ww1scy/3HLtZ+ktuFoSCNPYBEdLE87eMGd7/R28rXB/9gdSkHJx6eKKBqICqCM/OTUqSAqHC5oAGXgsFZyjcq+WyZ08CUBGkGcEnTgWg4ux8Pr5yLtFF//frhxVzd+bEFV8vU5hr4/9k+h9fV8vJn7fFDWaU0jOTaxtFSeLYAiDXi6aZxlXO16kNLoqFwbhHRNnaDmCe4T6qBznEl57/hlBHgxHh8pVdtY9RTbHoYBFYMMRS9v2ZOwxyvWPAIGtoxms0hTdHfBiIF9DmDtl29oJmk1yP8SHoQ1J X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfc9d6cb-b1ab-4b0f-996f-08dbdfe671c7 X-MS-Exchange-CrossTenant-AuthSource: DM8PR10MB5416.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2023 23:08:24.9816 (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: Y8dd89tuqjYCRo/zdixBlJ5x3zaCTKKY0bW59zaMq39PL84wJTjjaG+CNryW11PjCujlld9cq8myk7PU1YAIuxGq30l+WoPKpQ+VQwIylmU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7010 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-07_13,2023-11-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311070189 X-Proofpoint-GUID: xYDt_49QsbCv8Qq5k0yBXTMpnqtVplvY X-Proofpoint-ORIG-GUID: xYDt_49QsbCv8Qq5k0yBXTMpnqtVplvY X-Stat-Signature: om9j5n4pxg7pyihdcgny8o388s4jzknt X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 602D61C0005 X-Rspam-User: X-HE-Tag: 1699398536-317570 X-HE-Meta: U2FsdGVkX1+5yYQseWb+kYvNGSnvwwH5xrzYmGNSttfj7y/sOeJtRRdiBA/eDPEd9xY7Qk6lNDWjDCFIPr3FM+TET2hDWwhUo6scwtPb7aUhvo78YlKazDCz9X2WEzzEaIunMLQ2F4y7p/b6fMTe8h+mrvaLfKWiL9ViAyEr1i+YJak4fdIqkLPE5sxmwLwBGhgOH7Kgh6pJ7wYLvmLCC/u/RdU4T4tL156Cw1y9j6MfehkVCeR9S94m7TEZ/VP4kJgWGz+W8WaDBJOqlbMRlACnF55XkOjvFS6ikxWVOjCOnPpQewTMlSe54GU9w9uO4BIQFeXTxmhUf19d5/WdrUOJTtGqYvsrur9UNq1QrY44uh70LmDqvIQ8TBbq2idIwvv2bYNrxiJ17znjPUdGs9D+Gv14IXZy7d67nepRMXvntulxWnbma5uOzLVYL+sMsn/NOUl1JKw9K1TxrA/BzuSEyNwnqMrAdsPqmseU7ZctSpfMUh0bnTKE1jOjLuAOz/rNANLr7O9ewI3q/PyO0knPzN+9Z5l6SdO9AG2rF5n6lG6SP9XgpXjD72T0iEYoPZlPDY5XBg5jyfrmcoaRyKUpCckjsDZJRrEXS7WSarGvmfQOeCBynj0U360CnWPvWxqNnHkk4JYEvuuh17pKecBwiWHu6z3HIo7ma+vpw7fZeJ7Pm6pqb61ijr8QVuDDTWYKDSTA4b/m7dpmuDX/hjRd2CYu6NureDPThHO7er8AGunyTkQQZGc2BY92ef6SImbZq9WPHl6XEhcl9wdnknr6iOdvkFHHeVs1bT6Uym0dTekOvbGAaws63bGOXfl9DhvZ2LUpskbA5FcQ4cnH9t40oj/EADQeaVoiDC0jfiG/L594xjmEZiJaCi9OB/mr0VGLPBv6ld4iXeOnUUvQXo9JTQPvGyuDSAWRd7hJg4lHPKdVufwELg4G/3f2Xeds4XR3aPJSHAilecgfT6N ++OS1U5K mquDwgGrMl9HyIFrSY6wM5mAB0eelhYE2G2Z0Jr0v58zyU4VTVfG5xBffJJh6wQk4aCaWL1YYnC5yBcmcrpjHOelWmW6D+ws5ytIemMoyHTm1fEk78POTvAblaQkFi44OTnVBo/TFSGXbwHmmhwC7OBEb7H9EI/fiQeaswHwqmqMca07uq5V7QyRPu3vKTrqok+oqkMMK5am1x2KKN0kX5GvYXOyQjgjr270/lOPrAzgsTZaoARbLmvHLHnTCYr7qvIfaxEBNlw3FaSYj2C0XY4joJavEgCSFsuvHTtwoxgrgVtxFOKNepXu9NCGi29n00bOEjV6dxujSHAdcFmE6UTYaRKCZpR2vjKNpCqW3URPpws4d3g/s6SdaBkGsRMvt5owzJdS8/cSGp91qfM/CSTMgYmWLlxDm8H0B6+K8+lez7mG6Zem7VSIu6tTQM2xE0X8nUKBNg8zcPJvoTMMIwHB8QQ== 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: List-Subscribe: List-Unsubscribe: Rudimentary script to remove the straight-forward subset of cond_resched() and allies: 1) if (need_resched()) cond_resched() 2) expression*; cond_resched(); /* or in the reverse order */ 3) if (expression) statement cond_resched(); /* or in the reverse order */ The last two patterns depend on the control flow level to ensure that the complex cond_resched() patterns (ex. conditioned ones) are left alone and we only pick up ones which are only minimally related the neighbouring code. Cc: Julia Lawall Cc: Nicolas Palix Signed-off-by: Ankur Arora --- scripts/coccinelle/api/cond_resched.cocci | 53 +++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 scripts/coccinelle/api/cond_resched.cocci diff --git a/scripts/coccinelle/api/cond_resched.cocci b/scripts/coccinelle/api/cond_resched.cocci new file mode 100644 index 000000000000..bf43768a8f8c --- /dev/null +++ b/scripts/coccinelle/api/cond_resched.cocci @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0-only +/// Remove naked cond_resched() statements +/// +//# Remove cond_resched() statements when: +//# - executing at the same control flow level as the previous or the +//# next statement (this lets us avoid complicated conditionals in +//# the neighbourhood.) +//# - they are of the form "if (need_resched()) cond_resched()" which +//# is always safe. +//# +//# Coccinelle generally takes care of comments in the immediate neighbourhood +//# but might need to handle other comments alluding to rescheduling. +//# +virtual patch +virtual context + +@ r1 @ +identifier r; +@@ + +( + r = cond_resched(); +| +-if (need_resched()) +- cond_resched(); +) + +@ r2 @ +expression E; +statement S,T; +@@ +( + E; +| + if (E) S +| + if (E) S else T +| +) +-cond_resched(); + +@ r3 @ +expression E; +statement S,T; +@@ +-cond_resched(); +( + E; +| + if (E) S +| + if (E) S else T +)