From patchwork Tue Nov 7 21:57:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13449406 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 6469FC4332F for ; Tue, 7 Nov 2023 22:00:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 412128D0084; Tue, 7 Nov 2023 17:00:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 39E768D007C; Tue, 7 Nov 2023 17:00:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19DCE8D0084; Tue, 7 Nov 2023 17:00:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 027858D007C for ; Tue, 7 Nov 2023 17:00:25 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D4A36160B53 for ; Tue, 7 Nov 2023 22:00:24 +0000 (UTC) X-FDA: 81432527568.11.7CD5491 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf29.hostedemail.com (Postfix) with ESMTP id 59C73120015 for ; Tue, 7 Nov 2023 22:00:21 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=qY9JE6Nj; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hI0E1Rhy; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf29.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=1699394421; 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=WnmL+bkPmZbyvp+KJh3mqXxxiny0hkTiE1G0LVNwr/Q=; b=sLEAa/vwtwhQvZV8VWgxJYnWpQvLrrpDuJnThybp8eRIHjJB6ej+PtO/V7P8pubW6oVJH/ /fKgmKPKeSWRrxXHlewAcpG2Ni0Vr0aDeJLrmKedPe+9hr4jBT2tpPYEsMVp/Uo+6J/g+A DKxzT8VbwuXGwHsvz98XVF+pJt5eC2o= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=qY9JE6Nj; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hI0E1Rhy; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf29.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=1699394421; a=rsa-sha256; cv=pass; b=hfrTFVP4fNLoyjvA2+dwy7rZGVGWjT+MEbhm8CfXrgE/mB4CN+HUaKRd/pv4cmm7ib/cDc h9EOQnPhl2SsAWcBlZfT/edxuwzElvXefnmZqrojdOgwOJ5+JbnDqaTPqGF+eZZEbxVPDd hd5B22SSUN/aQuC/sHfKMwmgGfRudS4= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7LJpZ7020719; Tue, 7 Nov 2023 22:00:05 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=WnmL+bkPmZbyvp+KJh3mqXxxiny0hkTiE1G0LVNwr/Q=; b=qY9JE6Nj0yvz6yhRcfrTJcSJBIy4+9riqqrwwUD1WmsEqJ9AUsXuUjBPk7+Dvkb/UyxK QhmGUQoX55O35qFdT7RpDY/394oNMRQrNMNwigz4f/gLvPfCemjXPNxljPNbCojb3EXo m1jGLlh6r/TzT0P7Q8IUERvHQy3jvnNxu8UI3ixxIQDqW7vdRy2bjj2833EQZAAFATby hkhbDuITMnCZMFZn5NiMP0RFWKBBydH3OHuO+IS34LuB4RfJp001BLI+W7Y7Hurxq4Vw hz8Jr8RW+hoiiIynjgshY4egsCfwNfmsGHjwH3poE9mop6ONnYQy/2lsubco9lfBlWKL 9A== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w2202tc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 22:00:05 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7LJPg0023842; Tue, 7 Nov 2023 22:00:04 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2041.outbound.protection.outlook.com [104.47.73.41]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u7w241h35-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 22:00:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F0weliJ7JxpsnMTQj/PqvNY9aUjvHZFpBzCNYRAhkOOnQ4fXnMsJKs5lVOj49ZSZR7w+K67tZr2tr/96rtm0Auzfoi2tQvvxoVgE1LDdW9aNLCDbveuybac27yJ4kcBzAoMuMeJXcoeiXZtgBc3IwaOa2qQaVqriJX0MLibpDJUrZDQqhFV2/xVdDM/M984WS8u+Mi5SbCc+M886VDZjZumIL5591Nt9bOK2gaHAuo6kgEZc2jBu1ySgYpMGKfDr8vCumPCzNDHvyhb1Iqkb8NQbh8USi4G3ZNmdtCeNnA5zb1PxVkAcr1XgJrpzjM0zlealoZRD8YBv9J4K/54nfA== 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=WnmL+bkPmZbyvp+KJh3mqXxxiny0hkTiE1G0LVNwr/Q=; b=jgtd3zT+N/gmFH9aWH5FU0uI1CvczLPppLPmH6t7eutUBs/3njYd79NN+Bl1Rk0XZH8/ulgdLfX2F1s4C6HlxPHIOB8X+luLJGJL7A0KqGcXAvQ0UXVgu88jLEYVKVnPNFUyrQIQAZ4Y89VtTRWgbHDUEEl9va19lX5hNtmYPRfAtqXDdVPsRV4E7UOzm5hkrgv98D7aHBDsL01VolU8A0c//10Lv22qDCAwC3MgC3PL597VXP1kMF1ZW43NtlG2tumlTsD6bjopC553lyUrE9SY6IXINdcvAfrBa7MM/tP2byc1Yz+v0kJyIdb5aqoT068Fco5hQtWIYscM4g4NyQ== 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=WnmL+bkPmZbyvp+KJh3mqXxxiny0hkTiE1G0LVNwr/Q=; b=hI0E1RhyCQl91//KCyMJnmETawH51D0XlXy8FDKEP0HvNrq0unGVwkr2Z4eW2o4UpL7DQY0eMw6mh7s8GuXRhWAvj3SANbPOiI6uUeeYDjOgtU3jadLJCPp+Dd9k0bPVY161c2utOMz/zoW89us1MNZ2rBqnq0R294b1pIltn7s= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY5PR10MB6141.namprd10.prod.outlook.com (2603:10b6:930:37::21) 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 22:00:02 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::1ce3:4a8c:4c99:acea]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::1ce3:4a8c:4c99:acea%7]) with mapi id 15.20.6954.028; Tue, 7 Nov 2023 22:00:01 +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 Subject: [RFC PATCH 45/86] preempt: ARCH_NO_PREEMPT only preempts lazily Date: Tue, 7 Nov 2023 13:57:31 -0800 Message-Id: <20231107215742.363031-46-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: MW4PR04CA0169.namprd04.prod.outlook.com (2603:10b6:303:85::24) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CY5PR10MB6141:EE_ X-MS-Office365-Filtering-Correlation-Id: b64a4c84-2a99-4663-0218-08dbdfdce3f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fio7NFuFJ3uqjdezuagLqhd26OuG8EPxBqX5iidIIG7OmFt3KvN4WGFYtcGSG5LxhzAAJMIwQv/GFgS2OrZAMKaH9A2t1G46W95DIEgWgg5KMqI68n8OwrAuqC1tcMuSCygKnje8TNWyop8ZHuRGgbgVVg6p+eLno1n16udYGwdBW7NisT6DT/xyBLJlC3F79jOeV02X7VdRSsnJFwBCEiM/QjDrU35GfhlIAT1ADKxq7KRliw2J2t2F7Nj9zsG+4nhi5dbcfN8/vCNKKytB4p9j7I/Ome3rEW1xaJZ2HoiD26TNbcB27rfDgZC3AQd3mjZNYupXGWa6N/sOJI/6HwIEavvN2WQi3zJoD3JYWqOayufgCrkBXq4hv9MJJQ8ot8CW+eSLV9iisK8h3ZWDDnBhxKiGOw/qYe4aMFIYp7EGmboL0gx/+QFXKgkqaj8a7kbq+pKq1ZVRlZRmjnuBOD8fEdHuSNCPaG5e9WuPCT3+FPzGYU0iyjEpHRbFeMjGOtyy0bVysdhXy6bHkwvgJku0Z74YHnDXTkqIyiQWaML/JbNEvvVAjBIboRRXdz7B X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(376002)(39860400002)(136003)(366004)(230922051799003)(186009)(1800799009)(451199024)(64100799003)(6506007)(86362001)(103116003)(8676002)(478600001)(8936002)(6486002)(4326008)(6666004)(38100700002)(1076003)(5660300002)(36756003)(6512007)(66476007)(6916009)(66946007)(66556008)(316002)(2616005)(7416002)(107886003)(7406005)(2906002)(26005)(83380400001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kC306ikyQ+jFprZ4Zl2SU1LJyIVMjr/TtfN5WwlKaru+Ohl41NVoQVEfOKlykU1d9L2FqsgsioMO360RLEJKSi6BGlAP7VzM6rzJ+RJfDCvuUn8es/naug2C5nGtDR6FKrAOyipgbWg1181ajUc8ND1uLPVNE15Bwefjz2+Mji+9tNRczcAxTfDvvJn68JMWOoFPWAh4gui1ohHb/SBLrt9kA27tQ5/X+jNge+mxIKaAX4vV3ZYydgzFj8I68YW1ZgQamOTyuzi4keIVXw6zs59c0TvpzD8lidvXaaQf+YfoLl0yLKadzV7QgXA+aqxM8TvHh2paStSGBLiShL1SwpOuG/t+JerJZNffuKTGLiHLBBFlnYISoiye4++oIXkgWAY0Bni05lf1ph9vGY9aUwgTbzqEcVdO14ce+KsoWlIWZ/pM/0imBeBN/SCDnBsnOOTvlMsJokQd6khj0Ycr32whkusSe7P6MrpUFgJEeYNuDOjNgtsOOBck4iGq+8c+j9sJPZ6Dd2WYCv4Lo7dlgOU0Dm+Mlz+lj6/DpI4Z9Pzw3GMY9KrmO0+1jg+HKVliNtmeomSYvZwkZ4EJ7gPOdceXBo4kFKRg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/njksMScCAakqm6jyhpOFDxn96NymgYmRR4uIZps/ppHjHgGPSKMdVafzgWMUTbvmkJdpjDRE3GGoBpnzsjoX0gpMU7W34UkXJbqNEVA5O9PT+iNko3B0YxK2ZH5SYBWTf3SU2DX5IG3z76R/V8rjljkWua4mrxjEr4bPDqCJI5a6kX/8LI9OuCBut27npROhmlivrL96VSAxHs7efaPytvuG0E2YNCs71ANmK/tRENU1OlWjt/Zl2v1GeUWvRfKB4ek+XTV5CXVoPaX8zGSIDrl19/NAL5NSaONLn7P0mL5N/pCzj5kjNSB5ncPdD3foRx+FomFdzzVSqkLpBCh60TyuhN6ZP4tt1AyBGnXwfEguYrwmgSlueHoWJvapKuR5b5yzFo0TovV226TlQC6ab9kPTKhwpHv267dIXsv5JwNFZN5HEO98m6W9Z9mtkXtIC0wqHdRjy73FKzRO8jZxFm8lgwVeZAyOxYTA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b64a4c84-2a99-4663-0218-08dbdfdce3f0 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2023 22:00:01.8975 (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: TjfXn2mpkJGCUE+jZiUIWmWDqbRJ6NDOPlNNSo4Fi6JuqdsFhIiyBqomRkrmKPMr8yGa0SavMAOIpT6AbLsKNza5a1KaAzM1OXx3Ytog02A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6141 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 mlxlogscore=999 phishscore=0 spamscore=0 mlxscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311070182 X-Proofpoint-GUID: J5fkcx4Vl6lfchMmOAheXQL5eqLEplXR X-Proofpoint-ORIG-GUID: J5fkcx4Vl6lfchMmOAheXQL5eqLEplXR X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 59C73120015 X-Stat-Signature: 1w9g58xted5a9x7tuyudnmdo4sakojd5 X-Rspam-User: X-HE-Tag: 1699394421-516090 X-HE-Meta: U2FsdGVkX1/enh5UQqiv99iGCxYWjtjNhIy0ZPdtLVoL1NgQMysZAXzCDI7OQOiyVdEjPakb8+cxzzlzhtyH5omPGthZ3ibzHsvbvmkq9Hwoj2GzS+MvzP+vDm8YADuSfI/yAHgFpz+DNn/GQLMo54SRJza75dj0Mf4da+tTu61ht+EbmzImOTbwq9fePj1XcCyTNeEwXMcBrilaZntxQrmecNgpwl/fWctyAChZBJMuqeYljHK9HzO8sVQyrLllYE6HE++yrd6zA6bCIDUJj54VjFllZEeDexBClw8ZwlcWO0FT/58SXWBGrIxjEM6cjNmxkp/CCXJqfAVS0O3yYsJ6s/i/LycFtAxcGEhr2tpSv1gm32rEn1Ld9O59rhsUflerR8DrGknT4xsUDZZW+0ZDJpbED+yVbvWpC1O6pfaA28i2QXKtLXGDVDSWNDHJAJYRCTR+HTuX84Jyo6eVDU3lyKx3yeJaBQbQ20y6SlmCiyU5+mUtHlUkY3RRZJlTEqYQ0FmBwKxq3MFw3Bd6y/3ARmU3n70qjOsoxfstHPo12eIvLP/TEtnVIHKUTuvDYIsRtHAv7It0YnHqm7X6gX4zAvjeJDm9d7/G27C7lv4wNocPvqmWCBWnzat8++bRycenoJG4EflqYT3engCpgqe6o1iG6knDCPuo1KJrAf2pDwsFIR6+5mB3X5u9WPs0fMrCPnC/BScfY0y+ExrP863RszrZXH8jXu4lOrAP7oiilyYFOsvpb5xd9IOaUYthi4IsWQbAchu06+sTKlgF6yTqd0b0JUkZo+gy0ekDuRk3xVco6DIiw4aHrDkgSS1p9oGOiW7M9pjebFK/rozCSZ43w0JQC+ufe8N5dOtM3hK8KSi7Xo82h8HR/WVUy2czCY/PdeIW3v2lEPIdeE+nKzokeT1imJ6s2oacahSHbtz0OBjIy3fGLajteNxWvvWYpcfkIUwswSwWOfqknvd 3VjAkFJB xU2LVp6+sQnaagi0w8QeRSM11Xj1nMzl3fqPkVASuyrkjTYVozg0tl45OmYdeVRAEdCdvPbAqO0NNneUIsWK583iwRK9QUTpe31R6oa9w6qfz8G0l7+v4INVAta4Tb0NiM7LuFP0TtXwT7E9mAQ9Cn2nLAuqdB5sranw7gWDhOWgP02t3fMBRogTxBHJ6kU7E9xw7eEcah2sVhlbQ53GCW33oh+WFP3R7esdMpo5qS1jaG858lHxvH4IW5s6iMYdDk9FK9yA8ZQWKe7p01EIZd3fXlqvqtfo87TZdNCtKjjlHnnhxq5FdQifsCQoy7eq23fgwOtBoDeidvoqD3i3jdvf97nF/fqBd/JYK/PdHHAiYNuRLbZ0Tx09PAf1FaybUAxEW8ksXoJ5i0TPsWZw/f7I3AuepwMvSjqzZenMlFQlFPz8pA4jBydVmn6kT+xp8WDrUiTFHnpvUWc+9zCjldoTDnw== 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: Note: this commit is badly broken. Only here for discussion. Configurations with ARCH_NO_PREEMPT support preempt_count, but might not be tested well enough under PREEMPTION to support it might not be demarcating the necessary non-preemptible sections. One way to handle this is by limiting them to PREEMPT_NONE mode, not doing any tick enforcement and limiting preemption to happen only at user boundary. Unfortunately, this is only a partial solution because eager rescheduling could still happen (say, due to RCU wanting an expedited quiescent period.) And, because we do not trust the preempt_count accounting, this would mean preemption inside an unmarked critical section. I suppose we could disable that (say by selecting PREEMPTION=n), but then the only avenue for driving scheduling between kernel contexts (when there is no ongoing userspace work) would be explicit calls to schedule(). Signed-off-by: Ankur Arora --- kernel/sched/core.c | 12 ++++++++++-- kernel/sched/features.h | 7 +++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3fa78e8afb7d..bf5df2b866df 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1059,6 +1059,14 @@ void __resched_curr(struct rq *rq, resched_t rs) trace_sched_wake_idle_without_ipi(cpu); } +#ifndef CONFIG_ARCH_NO_PREEMPT +#define force_preempt() sched_feat(FORCE_PREEMPT) +#define preempt_priority() sched_feat(PREEMPT_PRIORITY) +#else +#define force_preempt() false +#define preempt_priority() false +#endif + /* * resched_curr - mark rq's current task 'to be rescheduled' eagerly * or lazily according to the current policy. @@ -1084,7 +1092,7 @@ void resched_curr(struct rq *rq, bool above) resched_t rs = RESCHED_lazy; int context; - if (sched_feat(FORCE_PREEMPT) || + if (force_preempt() || (rq->curr->sched_class == &idle_sched_class)) { rs = RESCHED_eager; goto resched; @@ -1115,7 +1123,7 @@ void resched_curr(struct rq *rq, bool above) goto resched; } - if (sched_feat(PREEMPT_PRIORITY) && above) + if (preempt_priority() && above) rs = RESCHED_eager; resched: diff --git a/kernel/sched/features.h b/kernel/sched/features.h index 9bf30732b03f..2575d018b181 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -90,6 +90,12 @@ SCHED_FEAT(LATENCY_WARN, false) SCHED_FEAT(HZ_BW, true) +#ifndef CONFIG_ARCH_NO_PREEMPT +/* + * Architectures with CONFIG_ARCH_NO_PREEMPT cannot safely preempt. + * So even though they enable CONFIG_PREEMPTION, they never have the + * option to dynamically switch preemption models. + */ #if defined(CONFIG_PREEMPT) SCHED_FEAT(FORCE_PREEMPT, true) SCHED_FEAT(PREEMPT_PRIORITY, true) @@ -100,3 +106,4 @@ SCHED_FEAT(PREEMPT_PRIORITY, true) SCHED_FEAT(FORCE_PREEMPT, false) SCHED_FEAT(PREEMPT_PRIORITY, false) #endif +#endif