From patchwork Tue Nov 7 23:08:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13449436 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 44922C4167B for ; Tue, 7 Nov 2023 23:09:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AFAF244018B; Tue, 7 Nov 2023 18:09:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A8069440186; Tue, 7 Nov 2023 18:09:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8379844018B; Tue, 7 Nov 2023 18:09:40 -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 6976F440186 for ; Tue, 7 Nov 2023 18:09:40 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 47B611CB4E1 for ; Tue, 7 Nov 2023 23:09:40 +0000 (UTC) X-FDA: 81432702120.05.3619CFC Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf28.hostedemail.com (Postfix) with ESMTP id 62A65C000E for ; Tue, 7 Nov 2023 23:09:35 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=XmwyzCdN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=chQK03sW; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf28.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=ankur.a.arora@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=1699398575; 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=8OOP07ZJ5K6zJC39RegnS+KEULj9FcngGrvEUb0ws6k=; b=gKNXqApCHOM+m3i9UPhaF1wUJeQMzR65PzQsTKP2qLHM6kjaFvze3ielLQrJbq+j8oLoYJ al0KxHv527uYFSVVhfS+UtK7xquRbdEP1UHuLupG0DsuVA+dQp8cILaP9PoGfOnei/uyPt 2GnJ4A55gI15Syg9FRbt7yECDcf4XUo= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=XmwyzCdN; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=chQK03sW; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf28.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=ankur.a.arora@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1699398575; a=rsa-sha256; cv=pass; b=BpXdVQC/g5DxYuVIL1ob3ANS6Kp01U4EThHWhn7YFA2jlSz42PUStJtZdYe1SlSIcV4QKw tfOAtS+Q6wGvL7owJPV/yenNyCDwQuN1bGrjtyId1HwBV0AHslYWCC2ORAJii2M57PvUNw yh7dXsyE+8MY2iWlB5cM/A6KmPGafaY= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7LJw4U004992; Tue, 7 Nov 2023 23:08:59 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=8OOP07ZJ5K6zJC39RegnS+KEULj9FcngGrvEUb0ws6k=; b=XmwyzCdNvorDE0taCW4iQoVJcWUOkisSdhd0zc36J37LmN6Grzy67bBU8uOxmfNu+gfc MwGkI4Y2C+0T/3hYgYaorQGA/AIA0Ozf95PgJXYm9adbnu/C+hSTkgfbE/9V9NKcIMgg HRMeJHRNIBuicTGs3UQ+sDREa7IliIfsFCFabvRGb6TsGW3SSHpPtHbx0yIy/j1iKuf3 TDUrl8Nh/82Rvld9cf9IM7ELtUzgAgFs+Gr0ul9y9bsWQcAs0KNrYW5oAJA2Gg/PdMoT b04VtXAaq44YyyEtVt3RD/vSlwXSv8nN8ebYcfV9FKa8Vy2S+MC3aFG0FLFpc0trmbZ+ Ww== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w22g6aj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 23:08:59 +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 3A7N2EWc011007; Tue, 7 Nov 2023 23:08:58 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u7w1tv9m4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 23:08:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DK3DOo9G/Cu4iKnECZHgG1Rfs7Pu7IYi1qkcCjeaimK5p+1v44+4eQAnCswWXoJYTrbywwrjeexk2pv+VADzvQHzezV/S9Un3RSIO3gxvO1Wb4udyxgepzQzTsz1UWrLHsFziwfC026qrGBhjr1xrEuqohcfclL9dacezv9eJeE6JnUwR0WqpdulQk0JTeTjIXQSfG2DF8JX1jZluaLEnwpmqz7OfSQCfBrgN/LpcQqpqYJo4T0slVFe+ZzBDrf9kKFpqSw9zVKl6WoLZJ9cG/4FcB2NLZFcVjy0wuN2P0PZqnUjkg/HP+T+aFHVcV/H8S41ypsT9FizPVs2bKlQMA== 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=8OOP07ZJ5K6zJC39RegnS+KEULj9FcngGrvEUb0ws6k=; b=DbJKLtrh631FVTCkt7PW3L5jjxA2svLR9XENlLXilRbohygi1N0BKW7ktoKywHC8oZScBsoD74GyZNRO9mFCpuo1+mPGu5frNUe+LQm0kesC6WzCbZ6IVWO637LVrQYqwTMrmTZ2QcCSn8PjzTh0yL7fExt/RZwyfdYROuuNKlHpWUCQ9SnruKFO2NnGCcTaerNdkrtYlxsvxqhnTEAEadUbVkG8E0RtdhLTLfgLCaVY4bZXg8bKYh/bJ0+eZxEegR8hn/8G2szr6lMOZQjvz3pDhVWM8wj+CFoGuaas3E/BwImbDA65o9y6a4eMrGEiQT2DuXNkY7coiwFVcSoA2Q== 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=8OOP07ZJ5K6zJC39RegnS+KEULj9FcngGrvEUb0ws6k=; b=chQK03sWHUl3IwwtZ4T148M+FywzSg1R2MIFMPabA9H7dHkR7Cov3PNBR2BvOxilnCUSPFreo8A4fA5PdMIRc+Z3YJfjM0Y7ydn72Nz+Kf4KuCAtalljX3DWnGnf9WK7TbBbknSY+qXFPuLDWGQyE392JucY/+KqvUeV6PploFg= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by MW4PR10MB5704.namprd10.prod.outlook.com (2603:10b6:303:18e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27; Tue, 7 Nov 2023 23:08:55 +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:55 +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 , Tejun Heo , Zefan Li , Johannes Weiner , Peter Oberparleiter , Eric Biederman , Will Deacon , Luis Chamberlain , Oleg Nesterov Subject: [RFC PATCH 66/86] treewide: kernel: remove cond_resched() Date: Tue, 7 Nov 2023 15:08:02 -0800 Message-Id: <20231107230822.371443-10-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231107230822.371443-1-ankur.a.arora@oracle.com> References: <20231107215742.363031-1-ankur.a.arora@oracle.com> <20231107230822.371443-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: SJ2PR07CA0021.namprd07.prod.outlook.com (2603:10b6:a03:505::23) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|MW4PR10MB5704:EE_ X-MS-Office365-Filtering-Correlation-Id: f1a33053-30f6-4fd4-9b3c-08dbdfe68414 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zaRAPPZXVgVD5Jt/SdHiz1qj7K32eddOMxf14d9iiY/DnHBFukcb3pAQxBQhQcxjdyH1hTXTOqVzxkP20S/KfcxpSHos+3Ds45nFMmDLl2e/QNlkIdFQei6ggXiPbLzHQ6iq2PYxhQjHwrh2GaGGeRhh7SQto7ByhxxmPUSYgxWfIffx6TaNsfVsxhsMPlQ9FSAIAmDCfxAVmq0KwRojUl5bEk1usi2pkFErUNs1BtMUxv+jpyZSlIQPkuA2VsNinK8An8g7i0kGlnCygA9l9E+xs1h4RPjymAeBPDPxSwEDkcLPxJ30asS1lWG+et8E/wpgbyzxm861a8pXY5MwGCu023XBWHiZV+Dy37FDZOR0dpnhbc423+o4t0b66l6lYCqm36KN7hvB144H1wFmi3Uhocet0BTbtCrd7uqVDBWIaEgg3REXIOVVXaEwlURK7C51iPxmcPLT62J7NztvCURkJ2NCbe90ivpxzSo31dtYC22CNT9v1VDOer/j+WxPGjWt6yuPOePbzvx+vl/3bzbIewEBmogblbfjCXPV698= 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)(376002)(366004)(396003)(136003)(346002)(39860400002)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(478600001)(41300700001)(6506007)(2616005)(966005)(6486002)(6512007)(7416002)(6666004)(7406005)(8676002)(316002)(4326008)(8936002)(5660300002)(83380400001)(1076003)(26005)(66476007)(54906003)(66946007)(66556008)(6916009)(38100700002)(2906002)(86362001)(103116003)(36756003)(66899024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Sx5Rda8oJzkLUFM3YvoR2Jsf3Wy+79Wb2k2dv4GlFGHCz3bVVovekmudqSyGpc09icC5RhDEY3c9nGs/3DyIBVoHtcO6VLps+BbvjdeGpZtB0lmuFtRYc/JID0g3+VIm7CH8wyHU5kqMzJr3/929DRsykjRGjjQQUnzPOZ8kEmygQU95TejL8Ve8zoWBp7TQUBeVla0mNh2g0WY6DoNPoV4F1TSkjCttoXIs2A9dlgB75xpjz3Txj0k6WiaGBIyR6svYxSvOA0XieqtEPdCP5X3aYxH+76QaOs3RB0mbTc3UmbO6VPW1mSco2828rhQm85qsQ1f1zogj92aMfyNoBGOOOv678D40x5Vhvh+m5z+FrIf1dSMqzMZA1e8lzlZQ3IQ/EGynOqWAoxP2x6H6Te7xI+PMRQPBZa+A4j7+2sfAJjH4ioWwVViiaG92Qw21L0eHZsioOi7LipSJZ7L/zwE7JA2Gdh8uMkLCk89IbP29BYhkSPCAZHJAU7Bsj7D8/RRBZaQpW6uDCPhb+jdqJAL1rebImndNH0ReoY2S6p5IW9Vyy0qBmCL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2WcuJ/mJNICB49YxEMA6vwjJ63O9u13I1rFSjGk4qds8c8xFFwwAAFQBy5IoH32DVrmIx5PIfpZItaUumuPzHAq3k8WnFnujch9QsVKpxMNw3vem60gQPdItUTAWDShniS5pR3e9bNgPnoJGHjM8adUYT0/GainFslUjCieOgS5eeiQ5b1X1Qr033+/SE4o8nRPTVXHEfekmT0X4lfg5Zm97zeHz2Grxe8TdY8+RZVPReZmuOhUOIrg+Xz1Iqrj/4LIeVh4sEFiDATLtlQ5u1dQZVKt9x2VDE8EwXEdm3AUmvbXKqjBx13gGEqQLIw/W9WQS3sCHUe3dErXTF146UnUGpuO0NWpuIJ3j2zMqsuNSflb+bcwz/YfPE3dHsjcEbFZ3vRqv1oTDxCqueHOlMFQwqReKS2TqtT923/fjwEDaG+/leGNaCM7BdHsAJIpb8YGfMAr59F8EgOJCI7ZUq1LTzgzXjm48WexOWX7Zut2RLbMaMFmRXAA8Qu6GgYW5TdupjySpEYYxC5TPOte9l6kZKe+Epvsj7/V0OkmcooE/QImTnEIJ8PG0Z3NH4GdOvBPOj7SP5aDTsfcbb1f4ww4A8LUrTtF2D+6G9JS6OnV95Rgzab2DctxEexym87XXEdhc3WkRLk2A5+P4WoMyDupYmyYmlQv+dCI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1a33053-30f6-4fd4-9b3c-08dbdfe68414 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:55.6255 (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: n5q7pLPijrvOPMona7K8sU5qbJw6ZOVffbtpr00rtxqqt5Evn4cX/JYxn1imiHYiz5Psfx7T4TTh8hzpUEdhbuNwfUq2keKJI7GE8TYkiVA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB5704 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-ORIG-GUID: pdLlzmeJJ_4t3JNhsYOqts4QHNbXtwH6 X-Proofpoint-GUID: pdLlzmeJJ_4t3JNhsYOqts4QHNbXtwH6 X-Rspamd-Queue-Id: 62A65C000E X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: ywcf67sqgfxfft7w9zeijgnsfp9w9f1t X-HE-Tag: 1699398575-371079 X-HE-Meta: U2FsdGVkX184qhmTBK/SQadXlOmMKH4rj7o09VxDeNl5e/0SfNjLne+eA1TFMUZzzGhN+SwaL2pwnfAhPPuh8G9oSu/OlWvmwp/aD3IeLes0KrVz5Z+PrX6gw8n6wcZwhCfg5ydlAOTlhm8gYCicTVvuP9xMYYUvcHkELdmfrg5feW2irGtADTlbiBmQJ3j2cWXOTsOD0tCTuPmU9sJICiGN1Jisu7CDDmL5vK1npSpg1fMTuXWlkhjOiTHMOsMZBnZKwX9QMHEE8bdEhdAj/5d65nOZXEzd3fG0FzHfeeJxSsD+q2r1cHGa7/eRX5IcDRwd8N3De2bmWGJUkDWBNqDz13uERUSkKlV6vOdF7vpCuvdU5azzlhOW+Bic07dJ3DHkaEMLWlw73j/hUtpwZOGtR/mikLNAmgpHr+OHyKTJHNTepQfARaYk2C7cNqHhMwWd6Xh906WP+GqvaRXKSxwczp4lLiSen4Tqi/F65rNnavMJKMDkRcwRP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n/WiPpSu+OjOQTn5Y3s0t6+6sHLhX0LB+J+EZe+1ErMduC9Gw/mhSasAcoki2QoCKSmwSKl8OVGolm+/vjz+8W3RjYjWQgdiZI/mrjRf/NK2Ra7W1b+LNOyZP85dkZWrQYEcal1lyCjwMopga1QWPY05x2zoGNhV57Ot+FN3NUIY92e408SQnvhm0K96rcDbGaly11NhsKs= 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: There are broadly three sets of uses of cond_resched(): 1. Calls to cond_resched() out of the goodness of our heart, otherwise known as avoiding lockup splats. 2. Open coded variants of cond_resched_lock() which call cond_resched(). 3. Retry or error handling loops, where cond_resched() is used as a quick alternative to spinning in a tight-loop. When running under a full preemption model, the cond_resched() reduces to a NOP (not even a barrier) so removing it obviously cannot matter. But considering only voluntary preemption models (for say code that has been mostly tested under those), for set-1 and set-2 the scheduler can now preempt kernel tasks running beyond their time quanta anywhere they are preemptible() [1]. Which removes any need for these explicitly placed scheduling points. The cond_resched() calls in set-3 are a little more difficult. To start with, given it's NOP character under full preemption, it never actually saved us from a tight loop. With voluntary preemption, it's not a NOP, but it might as well be -- for most workloads the scheduler does not have an interminable supply of runnable tasks on the runqueue. So, cond_resched() is useful to not get softlockup splats, but not terribly good for error handling. Ideally, these should be replaced with some kind of timed or event wait. For now we use cond_resched_stall(), which tries to schedule if possible, and executes a cpu_relax() if not. All of these are from set-1 except for the retry loops in task_function_call() or the mutex testing logic. Replace these with cond_resched_stall(). The others can be removed. [1] https://lore.kernel.org/lkml/20231107215742.363031-1-ankur.a.arora@oracle.com/ Cc: Tejun Heo Cc: Zefan Li Cc: Johannes Weiner Cc: Peter Oberparleiter Cc: Eric Biederman Cc: Will Deacon Cc: Luis Chamberlain Cc: Oleg Nesterov Cc: Juri Lelli Cc: Vincent Guittot Signed-off-by: Ankur Arora --- include/linux/sched/cond_resched.h | 1 - kernel/auditsc.c | 2 -- kernel/cgroup/rstat.c | 3 +-- kernel/dma/debug.c | 2 -- kernel/events/core.c | 2 +- kernel/gcov/base.c | 1 - kernel/kallsyms.c | 4 +--- kernel/kexec_core.c | 6 ------ kernel/locking/test-ww_mutex.c | 4 ++-- kernel/module/main.c | 1 - kernel/ptrace.c | 2 -- kernel/sched/core.c | 1 - kernel/sched/fair.c | 4 ---- 13 files changed, 5 insertions(+), 28 deletions(-) delete mode 100644 include/linux/sched/cond_resched.h diff --git a/include/linux/sched/cond_resched.h b/include/linux/sched/cond_resched.h deleted file mode 100644 index 227f5be81bcd..000000000000 --- a/include/linux/sched/cond_resched.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 6f0d6fb6523f..47abfc1e6c75 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -2460,8 +2460,6 @@ void __audit_inode_child(struct inode *parent, } } - cond_resched(); - /* is there a matching child entry? */ list_for_each_entry(n, &context->names_list, list) { /* can only match entries that have a name */ diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c index d80d7a608141..d61dc98d1d2f 100644 --- a/kernel/cgroup/rstat.c +++ b/kernel/cgroup/rstat.c @@ -210,8 +210,7 @@ static void cgroup_rstat_flush_locked(struct cgroup *cgrp) /* play nice and yield if necessary */ if (need_resched() || spin_needbreak(&cgroup_rstat_lock)) { spin_unlock_irq(&cgroup_rstat_lock); - if (!cond_resched()) - cpu_relax(); + cond_resched_stall(); spin_lock_irq(&cgroup_rstat_lock); } } diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 06366acd27b0..fb8e7aed9751 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -543,8 +543,6 @@ void debug_dma_dump_mappings(struct device *dev) } } spin_unlock_irqrestore(&bucket->lock, flags); - - cond_resched(); } } diff --git a/kernel/events/core.c b/kernel/events/core.c index a2f2a9525d72..02330c190472 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -125,7 +125,7 @@ task_function_call(struct task_struct *p, remote_function_f func, void *info) if (ret != -EAGAIN) break; - cond_resched(); + cond_resched_stall(); } return ret; diff --git a/kernel/gcov/base.c b/kernel/gcov/base.c index 073a3738c5e6..3c22a15065b3 100644 --- a/kernel/gcov/base.c +++ b/kernel/gcov/base.c @@ -43,7 +43,6 @@ void gcov_enable_events(void) /* Perform event callback for previously registered entries. */ while ((info = gcov_info_next(info))) { gcov_event(GCOV_ADD, info); - cond_resched(); } mutex_unlock(&gcov_lock); diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 18edd57b5fe8..a3c5ce9246cd 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -19,7 +19,7 @@ #include #include #include -#include /* for cond_resched */ +#include #include #include #include @@ -295,7 +295,6 @@ int kallsyms_on_each_symbol(int (*fn)(void *, const char *, unsigned long), ret = fn(data, namebuf, kallsyms_sym_address(i)); if (ret != 0) return ret; - cond_resched(); } return 0; } @@ -312,7 +311,6 @@ int kallsyms_on_each_match_symbol(int (*fn)(void *, unsigned long), for (i = start; !ret && i <= end; i++) { ret = fn(data, kallsyms_sym_address(get_symbol_seq(i))); - cond_resched(); } return ret; diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 9dc728982d79..40699ea33034 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -452,8 +452,6 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image, while (hole_end <= crashk_res.end) { unsigned long i; - cond_resched(); - if (hole_end > KEXEC_CRASH_CONTROL_MEMORY_LIMIT) break; /* See if I overlap any of the segments */ @@ -832,8 +830,6 @@ static int kimage_load_normal_segment(struct kimage *image, else buf += mchunk; mbytes -= mchunk; - - cond_resched(); } out: return result; @@ -900,8 +896,6 @@ static int kimage_load_crash_segment(struct kimage *image, else buf += mchunk; mbytes -= mchunk; - - cond_resched(); } out: return result; diff --git a/kernel/locking/test-ww_mutex.c b/kernel/locking/test-ww_mutex.c index 93cca6e69860..b1bb683274f8 100644 --- a/kernel/locking/test-ww_mutex.c +++ b/kernel/locking/test-ww_mutex.c @@ -46,7 +46,7 @@ static void test_mutex_work(struct work_struct *work) if (mtx->flags & TEST_MTX_TRY) { while (!ww_mutex_trylock(&mtx->mutex, NULL)) - cond_resched(); + cond_resched_stall(); } else { ww_mutex_lock(&mtx->mutex, NULL); } @@ -84,7 +84,7 @@ static int __test_mutex(unsigned int flags) ret = -EINVAL; break; } - cond_resched(); + cond_resched_stall(); } while (time_before(jiffies, timeout)); } else { ret = wait_for_completion_timeout(&mtx.done, TIMEOUT); diff --git a/kernel/module/main.c b/kernel/module/main.c index 98fedfdb8db5..03f6fcfa87f8 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -1908,7 +1908,6 @@ static int copy_chunked_from_user(void *dst, const void __user *usrc, unsigned l if (copy_from_user(dst, usrc, n) != 0) return -EFAULT; - cond_resched(); dst += n; usrc += n; len -= n; diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 443057bee87c..83a65a3c614a 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -798,8 +798,6 @@ static int ptrace_peek_siginfo(struct task_struct *child, if (signal_pending(current)) break; - - cond_resched(); } if (i > 0) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3467a3a7d4bf..691b50791e04 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 448fe36e7bbb..4e67e88282a6 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -51,8 +50,6 @@ #include -#include - #include "sched.h" #include "stats.h" #include "autogroup.h" @@ -3374,7 +3371,6 @@ static void task_numa_work(struct callback_head *work) if (pages <= 0 || virtpages <= 0) goto out; - cond_resched(); } while (end != vma->vm_end); } for_each_vma(vmi, vma);