From patchwork Tue Nov 7 23:08:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13449433 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 53262C4167B for ; Tue, 7 Nov 2023 23:09:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D41A6440187; Tue, 7 Nov 2023 18:09:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CC969440186; Tue, 7 Nov 2023 18:09:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A332B440187; Tue, 7 Nov 2023 18:09:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8877F440186 for ; Tue, 7 Nov 2023 18:09:33 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 502E7B4F37 for ; Tue, 7 Nov 2023 23:09:33 +0000 (UTC) X-FDA: 81432701826.08.5FC3283 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf04.hostedemail.com (Postfix) with ESMTP id 113C44001C for ; Tue, 7 Nov 2023 23:09:29 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=EhwtlKrL; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=v1L7Z2Rg; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf04.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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699398570; 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=2jD7WozsO3sS0iyfqYqPRu/00V2ZOC6HVnfrprImW20=; b=GV0OYEbBXFRgMN4M5s4vozbGN74/HCqZAMKpxBc1r/3H3HHlsjHbOUGyPNR9xgucQx4BOv syw6TG/oxNiOyjXO3ffJXSoET/oz1L1sbFZpz2ZuExMrsjhek/SodWHnQ0rCgrA0rK07nb TN4PLLLFDguQgvH9qbMTVZsQo2/Jl2k= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=EhwtlKrL; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=v1L7Z2Rg; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf04.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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1699398570; a=rsa-sha256; cv=pass; b=0hQwGOp2KwpLE463UHjfo8I49lGtb4J0FdSdvFJHQMughHp9h5G+JAoZXfg90rMIqzh57i 4Z0GSkcJFh9vp7k3raeqgBYybix0gt+dORW0OYgw3MLk8gxah8y4Q89FV6vQfJWynaCDIo lE9VzlSaxwCq97ie5aWOJL86HZIGgqE= 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 3A7LJlMc022696; Tue, 7 Nov 2023 23:09:09 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=2jD7WozsO3sS0iyfqYqPRu/00V2ZOC6HVnfrprImW20=; b=EhwtlKrLrvd6cEVBar6TXc5IuLxYWIuN+x2cBO2h+r8Wu7owtWz7dHDm//PSwE31y2Up XDi7Ajq9aYVAWGv6iJ/dm+V9rGN77YLGKXvqhah/ivzncbsVvxQQFolwh4pBM8o0AGii gf5WS8R7C53tW1lZ2ceMXNNm23KMrkwaN4BDi0M4jUx4qRQFtUQ0IYF6oG3IBCoDEoki 0gDU6QQLN2UTxGc61PbPZA7uWa3/UpzyOokCAGKTzHiVDVLu1I/XVwjxv7Bxk9MU/O0n gjbw87d9UY8qK5lv0kDO566AVuElq6OenxbXStLu+47l5iHVa6DlnvaBuDkPZ2cww7VC TQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w2006f4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 23:09:09 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7N31DE000659; Tue, 7 Nov 2023 23:09:08 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u7w1wvdcg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 23:09:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KhxaafEh1PxEsEmewSzicAsbTGYBbS+qTrbhCbG/9jJ7RrCdsT/rSq3qb6XzTvBWG5jDUE6EiDvFFHBaEv6dh/OvJRLQ+XTAemPniidqSHbNxCTOe+QJ553ZkCuw7WhwnRBk0Q29BgqfdF4ZL81tFGvrTgupmCyyPEUdZOIjvW5j13huHY7ntLa1mQu+4gMCxN8UDwx0tUR/ZpHfyQ6pt97aocSctpKHBEPi6EwmjHDlbt2sTBtuq8sA2zCgP+on4ieX3Afyu0lv/zuVz+yVZWSphMQqR8iq7YBzqC+bsziGBOY+ZpHZqYUmZqPWFje0wj/HEiTckT0WV/2xZvlm9Q== 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=2jD7WozsO3sS0iyfqYqPRu/00V2ZOC6HVnfrprImW20=; b=guFr1ZxJsjNTzH2F8PPl2IrSJHHVztZsWCytv/OMyw3h4NGAMJalEN43ulsjfMuwv2vWMr4PwNAsmh/XNnC1mnBaQnnhb1CWbMDMxR6VZfZUNUNfNqLAv5PViMEOQkyiF2sy5FfM9f+sF/g5Xfj8gJ0aNOgEMF6c92ixeRhESH77D+aRE7+5IcKgIbimXfvoDjXuzOhPkcRAiBv50ZD4+XL/EzNIPJY6rnjCDO99o3jwMnPOVMa65IDqQu3jM+1PIneOGMD9sGH0lBcqdI9vIywMDvMwjgYCyo+WFVF8IpGtLVEd8MpVZA0nnNPXNZsA+MtwpE+FgOyLK+6RG7W4Qw== 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=2jD7WozsO3sS0iyfqYqPRu/00V2ZOC6HVnfrprImW20=; b=v1L7Z2RgmWsKziVrnAm6MU0E93ZHJvV3mOQYd75DwXWKDLmX1gqWExTiSMOlfP0NE/qRK9X1J/fZtKY/jUo1uiDu5nkksTvC5YTp4ZoPtZ1TbKECL57/VhojSRIEBa/Yo9aQUVYWo3lLgxQbltD7iYryXQE2llJQ1aod67CH8a4= Received: from DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) by IA1PR10MB7261.namprd10.prod.outlook.com (2603:10b6:208:3f6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Tue, 7 Nov 2023 23:09:05 +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:09:05 +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 , Jens Axboe , Pavel Begunkov Subject: [RFC PATCH 69/86] treewide: io_uring: remove cond_resched() Date: Tue, 7 Nov 2023 15:08:05 -0800 Message-Id: <20231107230822.371443-13-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: BYAPR11CA0038.namprd11.prod.outlook.com (2603:10b6:a03:80::15) To DM8PR10MB5416.namprd10.prod.outlook.com (2603:10b6:8:3f::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR10MB5416:EE_|IA1PR10MB7261:EE_ X-MS-Office365-Filtering-Correlation-Id: 037a34cc-5da8-46f7-22ef-08dbdfe689e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6HAp59nF5hzeS0imqUZMsnhLBbyHRKlOz/Fm8KHZfM89LujnA66rZb2grngam+KCaaTGNkXs3goCMupTPfJbbT0A0MEvS3GtWn3dGq3yU0KqBCBvyze0Np0Dod/JmdIW8QTQ4Wv52uWLjkfsGXVnuo/hDfOi+yDJ/QuBKd6b2Ae385FIi0jv3Q8KAGbcGgiGS7paXMHSvWMdYfFJkesBA2BkhUfNqX4hp/Gsh9wG+6PGHdAkY1RoYvxwBOXASvDlGIFE5F6zZLfWrwjjEdeQ8t0b6g/suHxyDNJJ8WD5U3XkoOlLuuGGBc9Y/wp8OBsS+AHVC0jazjCB8s0W+Vs/aDIz/QrmYzxhlAp9PPFeh2P6Nm6hlxFxDQksNe6GS0cygM5RNAv50Z3BQ/PA85WQXhL4EMY7s+/F2ZpSKPvMlS/+0pWFgTxzujJ2tLfsQ6QC99PQxgtI+PUJ0l2RXSUg5amunqDJ2qyNqtpckbmA9GM/oekjC3LL7fw45JjbO0IpQrd+kL9hlZOIQrqYY5EbXB1k8lz6reAx1sFRjZ0pHz0= 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)(39860400002)(346002)(376002)(136003)(396003)(366004)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(66899024)(6506007)(478600001)(6512007)(2616005)(6486002)(966005)(7406005)(36756003)(103116003)(38100700002)(86362001)(1076003)(41300700001)(7416002)(5660300002)(316002)(66556008)(66476007)(83380400001)(2906002)(54906003)(26005)(66946007)(6916009)(8676002)(4326008)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 07RocDaw0M+5QCCN1Q+HwGsucKRA6Xk9wKBG3KgpT/PmB0K3NnKl53C9ydqWX+3nqgAyK7935NvVlRICoen6V4YwnP0/2CIxdtfGhg3tjcuZ8t6UA/wOnTLFDIEq/sA1g65u+FS+buXFL6P1LzF9i4BbkHAUdtIS5Le1jhkWTCcqvLuuHL1P2a7zHR17jIU2I5uUy6f2pHTou9EpeyohkLiaUD/XQHcby8zxqqe+h/CPoXJtrZFRzbbmc8y+KlTA+xWdQg5QVxpX4RoSRC56scrdSwgrPPTmL217go1KPUhfPMRVlI/r3rwamhtg1yZUzsxEA2/YiyISOnemwaGd11FpwB+z4u6s68ViIyReWK9HNOQIGwVDOU+Ku5J+7CoRNus6moaghZ6XHj1YJdBelCGu7ky+4YtDS+BcKUHN8Ash7O8kMtwAMy94ZT3mslYtu/ctyzPpr9VUQuanTTUvbcrPFjPcKUHeQNI3kvegIAFU4X9E5c/BkTZVI55uYQTIWSSeO4OB42J4UJu1n1nlh8MBqKJ+N1FduTeRM1Oei4xQ3hHC7eFB0EQgtYpOeqFCxn2w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Ylc8itlzCNZq8+YoHEPakYZL7JfGqD7k4wHPplR6A3T53DamZAaARUxYCv4jXxmEdNYgpMGQEnSDvFWRcyOSYXaO005684kQHji9aJcGltfaOlMsciU9aAg7du+eRg9Qg1isnTAe2ajgKNwV/QqCkMUV8j99+RDqByjbnUIphLNdMVxGLnwCwfZUWUmwBs/wmqDJQsO2+oni5NtIS4W1zKCF3iF09fj77cndPIZ2mEJM1PXJoOzRcSySPadyiFeUNi7ZjoGP0FtVkAC3GcBQLUsvF2LmYgmDxUCvmKCEDjzz0JO0UQA/MpeEbrsrlTE5tmY7TuOvsaGm7styHgFnq963XaO+qKejuWJaBDD46SpXEBJuqZ0Ot0CMjQHJAHTVRQ2fOLa3mGKqbi3UwRMM/wgmuqbrfsRP71gQ8BnTsz2BIZjfLopQRBh2Skb+v6+FUC3sKnr8JQmpeTlm5lDNa6QnoEbBo/w45fUJXc43Gvmo1YFRE4ASOllFrwCtO0mAfd8EAJ2CY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 037a34cc-5da8-46f7-22ef-08dbdfe689e9 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:09:05.4180 (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: eYrSngIXJnnJKtafpAIa0RwpROW+Bgot+DXJbLp9pZEgvkLm+5VUR1w1OcJAunB3ehHRUteZIYIVQq/ogOFl9R6acaX1FsZtdafbUSM6yg0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7261 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 malwarescore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 spamscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311070189 X-Proofpoint-ORIG-GUID: ZIktjL8K13Zfb5YT99yWNidmuPLZEr1J X-Proofpoint-GUID: ZIktjL8K13Zfb5YT99yWNidmuPLZEr1J X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 113C44001C X-Stat-Signature: musn791jsp5crcypyn4y113ui9mxu17p X-Rspam-User: X-HE-Tag: 1699398569-651707 X-HE-Meta: U2FsdGVkX188Y1l47s/rUpa3yl5Pacjc+KnT5baxCknyx6dYiup59o1MMA+TKMm3B/j92R7OKu0MaS8HEg6iloWqXxba0j+uz5notlT51MdnW3CTWYypOKAXEA63aB5a16qNvZbRIx7x1FFSrS79z6CksJP8BlQzF8kuas7rNHb5R7HEMJGgteLUGKDpq7ISI2HlN1HXxhN3VQgfXurBK3clSeBHRC67DuKD6hzbTU57TMVpkxhkfdPcqJVlz09HtZNFZa9GyBlvaCufHv96yWcz7E+saPN9Z67IG5Ytji2MTYt62Va4+FuJN/9FHo3PKtaD0SveA+WIgV55f4g9TkNURQDz4GxlyWBTbB1huzdgHamgIzpSnrJFoiNXIOUJk+U+XzzA4ufHfbRnPfAb+z6/ZG0kNTQ2V4fKuPopWcjV5HizMRDU1MINTlcIFNcDzfc1WzsI/RPXvGf4yuBczHRxHHZq+Y+rh1g61CEfILT4pZRiXHEPq/m615RVqyIh9xYHeJzvrWKy2+PFBItrjIQUB75ezHDaiOn/JFZM+JGAUs6RXREe24r484c2DQ0SJX8H6Ezyt0CNKBHymGxmlrN+gy7mMoyyMvXpaDq1HHnha+aSyKBdTNFgUbReonzjHX0twovi6mOcUvT1opjuKoSxjhGFXzLd64FTZcQedJkC9C1kGg5TffMNp8PeR2jE5xtNvJWoB/kwWnYwxpKK6szR35c2JNVHQ2fq7YcLQsg9xXDw/f6bi2xceFfYZpA9RDQ7dvYAr65F6ShiBRfWdXaCo/ggzbEeOvcul6hwj7EwI1u4QVGEg/t+1S/75zdDMTSwUkAC8zDwyy/GkvoKd56jc1pKR64gosiH1aUFmyXLVNovoXwFu+jVVZwGdb3C0ScUi3MKQcvrrWfhdlFr0ulIYNR5D8mfWwToox/4sloK6UL+oJ9CO23K/c/35Ch+ijvOhkFIumRie5aawdF O/U2YOk7 CK9GvKLCjP/P3cgHyx6p9Ccz+MifvwJOhrE5bNoeigQKxbZxjyYKx+ohhzQgc1cK7hNxE3L3+QTHzo/isrTexfQHkW5oQtkF8vjAtMg2cM1EJFSdJABcmzVS3kisZFUd70umlkwvCrs0jBDTXOD+Z+pC0S5DKDvvmlTMQB6XTm4Mc+VHFo6LJRZLEp7Y+npBRcCKw7QIavSud1Tezg7OVn6umB//sxgsZKU9mtZYZOLFqY7cgmF1Cy/bqmX2YIphgOjUYvyQejCEwZNnP3zVLcpYDXE5xsF0xNa3ZF/2n7+7Xy1kfdSjWvQ6J148L07DRhnohkAYIJ8tKspsVE4DyZr1vMjH59rbSYQkyEeVp7/cjl7E+FfshTX1/4IE2DH5U6YF5fCXurDnWKNsVsZ61bTEqE/yD4/cja1la0TN3+BfxcZQX8RFnHaffqvw8RJZX3wfDxhR9jwUKeAJGWjpJ3+OD1ly47vHD3xo/3KUS0eDc8p0ZXY5zs1r1kkyvFplG6CLoenZKzhV8NoW2P2UgKYnb1FvOy0B7Toc+zb3L3IbKhfjKcWH6yqPYRHy1Yg/vL2KbPXSt2j9ZsXg= 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 the uses of cond_resched() are from set-1 or set-2. Remove them. [1] https://lore.kernel.org/lkml/20231107215742.363031-1-ankur.a.arora@oracle.com/ Cc: Jens Axboe Cc: Pavel Begunkov Signed-off-by: Ankur Arora --- io_uring/io-wq.c | 4 +--- io_uring/io_uring.c | 21 ++++++++++++--------- io_uring/kbuf.c | 2 -- io_uring/sqpoll.c | 6 ++++-- io_uring/tctx.c | 4 +--- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c index 522196dfb0ff..fcaf9161be03 100644 --- a/io_uring/io-wq.c +++ b/io_uring/io-wq.c @@ -532,10 +532,8 @@ static struct io_wq_work *io_get_next_work(struct io_wq_acct *acct, static void io_assign_current_work(struct io_worker *worker, struct io_wq_work *work) { - if (work) { + if (work) io_run_task_work(); - cond_resched(); - } raw_spin_lock(&worker->lock); worker->cur_work = work; diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 8d1bc6cdfe71..547b7c6bdc68 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1203,9 +1203,14 @@ static unsigned int handle_tw_list(struct llist_node *node, node = next; count++; if (unlikely(need_resched())) { + + /* + * Depending on whether we have PREEMPT_RCU or not, the + * mutex_unlock() or percpu_ref_put() should cause us to + * reschedule. + */ ctx_flush_and_put(*ctx, ts); *ctx = NULL; - cond_resched(); } } @@ -1611,7 +1616,6 @@ static __cold void io_iopoll_try_reap_events(struct io_ring_ctx *ctx) */ if (need_resched()) { mutex_unlock(&ctx->uring_lock); - cond_resched(); mutex_lock(&ctx->uring_lock); } } @@ -1977,7 +1981,6 @@ void io_wq_submit_work(struct io_wq_work *work) break; if (io_wq_worker_stopped()) break; - cond_resched(); continue; } @@ -2649,7 +2652,6 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, ret = 0; break; } - cond_resched(); } while (1); if (!(ctx->flags & IORING_SETUP_DEFER_TASKRUN)) @@ -3096,8 +3098,12 @@ static __cold void io_ring_exit_work(struct work_struct *work) if (ctx->flags & IORING_SETUP_DEFER_TASKRUN) io_move_task_work_from_local(ctx); + /* + * io_uring_try_cancel_requests() will reschedule when needed + * in the mutex_unlock(). + */ while (io_uring_try_cancel_requests(ctx, NULL, true)) - cond_resched(); + ; if (ctx->sq_data) { struct io_sq_data *sqd = ctx->sq_data; @@ -3313,7 +3319,6 @@ static __cold bool io_uring_try_cancel_requests(struct io_ring_ctx *ctx, while (!wq_list_empty(&ctx->iopoll_list)) { io_iopoll_try_reap_events(ctx); ret = true; - cond_resched(); } } @@ -3382,10 +3387,8 @@ __cold void io_uring_cancel_generic(bool cancel_all, struct io_sq_data *sqd) cancel_all); } - if (loop) { - cond_resched(); + if (loop) continue; - } prepare_to_wait(&tctx->wait, &wait, TASK_INTERRUPTIBLE); io_run_task_work(); diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index 9123138aa9f4..ef94a7c76d9a 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -246,7 +246,6 @@ static int __io_remove_buffers(struct io_ring_ctx *ctx, list_move(&nxt->list, &ctx->io_buffers_cache); if (++i == nbufs) return i; - cond_resched(); } return i; @@ -421,7 +420,6 @@ static int io_add_buffers(struct io_ring_ctx *ctx, struct io_provide_buf *pbuf, buf->bgid = pbuf->bgid; addr += pbuf->len; bid++; - cond_resched(); } return i ? 0 : -ENOMEM; diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c index bd6c2c7959a5..b297b7b8047e 100644 --- a/io_uring/sqpoll.c +++ b/io_uring/sqpoll.c @@ -212,7 +212,6 @@ static bool io_sqd_handle_event(struct io_sq_data *sqd) mutex_unlock(&sqd->lock); if (signal_pending(current)) did_sig = get_signal(&ksig); - cond_resched(); mutex_lock(&sqd->lock); } return did_sig || test_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state); @@ -258,8 +257,11 @@ static int io_sq_thread(void *data) if (sqt_spin) timeout = jiffies + sqd->sq_thread_idle; if (unlikely(need_resched())) { + /* + * Drop the mutex and reacquire so a reschedule can + * happen on unlock. + */ mutex_unlock(&sqd->lock); - cond_resched(); mutex_lock(&sqd->lock); } continue; diff --git a/io_uring/tctx.c b/io_uring/tctx.c index c043fe93a3f2..1bf58f01e50c 100644 --- a/io_uring/tctx.c +++ b/io_uring/tctx.c @@ -181,10 +181,8 @@ __cold void io_uring_clean_tctx(struct io_uring_task *tctx) struct io_tctx_node *node; unsigned long index; - xa_for_each(&tctx->xa, index, node) { + xa_for_each(&tctx->xa, index, node) io_uring_del_tctx_node(index); - cond_resched(); - } if (wq) { /* * Must be after io_uring_del_tctx_node() (removes nodes under