Message ID | 20231107215742.363031-46-ankur.a.arora@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp544418vqo; Tue, 7 Nov 2023 14:07:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEv9SoZT00n0lC4WCs7OZRzC+VkH4PSKrr/pgPxAWEyCwLCLO/7LkfQs+AT4rpfSwxstWzC X-Received: by 2002:a17:90b:1d92:b0:27d:222c:f5eb with SMTP id pf18-20020a17090b1d9200b0027d222cf5ebmr79338pjb.11.1699394834253; Tue, 07 Nov 2023 14:07:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699394834; cv=pass; d=google.com; s=arc-20160816; b=VsuFkV2XPuEeM9+lBBs1Bnsbct33ySCqdlQgRHuyVEhsep83zef4mOZExXFm5ADlga K3BpPY3Hcc6x4ZqEgIO2ciibmsiX9SWFPP3KoViC+Pfm5RlJkH1cL1hQNCGFDd5gFA1U SN3NJsaNHcJ7xZmuiDYHZgSfdyI6sw4DEJWiihqZuo38gV+GkB7VWa7LP3DPX9INKICh wRRpeWjq9rgMqj9RyEZeelPdv/tkiaef9ozudNohYbimVqyRV8NWXHy+StZKHXBZRkxv WTm3DBYJtRlT80gKQXZBP0VzdEOoPav7qRiSorFjj9bC9KdbwA5HE2pBRQ/mX3GzCOZf eEeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=WnmL+bkPmZbyvp+KJh3mqXxxiny0hkTiE1G0LVNwr/Q=; fh=nHnEAWNp+qNKUfhTYdiVYwv41cALFixOy2SlfWaTsrM=; b=fUscS6v+VQJcMD9qClWnipHLL6Hlny5KdvJXSuk7BuNfZLiFlfRVHEro62ZbPK5OAy l3/b4yl7xJUysWKHdD5M5gh/R/sLAdg8Zq6BbGyZ96392hU9sPml10yMxRxz6C1HUaNn URxfvFaXP/qT/ypWCNGqXrU8vbjQlCAOzy8cgZhqmD1gvDne+awNKAjpwW3IKSR5aKfT pwUWOrHZDXJCtl/swxFCdABlhDQoiWFcx5xsY+Z2SrfKD6a3Oa6ftfb/+fu5ZcIjk1XE NMrOUi5E/v+KVKn49lDUGrKa5mUisJ46ShfhjUV1Fa150eftM0BX1gcID8GCY3XnbtmA rELw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=qY9JE6Nj; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hI0E1Rhy; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id fz3-20020a17090b024300b0027e1cdb4f93si700415pjb.67.2023.11.07.14.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 14:07:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=qY9JE6Nj; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hI0E1Rhy; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 6C42180D6A18; Tue, 7 Nov 2023 14:07:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344285AbjKGWEq (ORCPT <rfc822;lhua1029@gmail.com> + 32 others); Tue, 7 Nov 2023 17:04:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235522AbjKGWDs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 7 Nov 2023 17:03:48 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 230DF26BB for <linux-kernel@vger.kernel.org>; Tue, 7 Nov 2023 14:00:58 -0800 (PST) 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 <ankur.a.arora@oracle.com> 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 <ankur.a.arora@oracle.com> 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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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+HKVliNtmeomSYvZwkZ4EJ7gPOdceXBo4kFKRgS9EaESQ7Ib2n1NCgNDnNApc5y2B92VqIrcYTluK6l7zBnfBYLp/3hqTaXjvD9FxCgRUciL54TVE59Wm91gQHBJHyb++C5PDvcrG3HF3n7WhQn9JGW3yeDMxSYqeBJMOVe6TDE3LGCNEh+t881a+/+s1gfyn7yWESksAKhz5TNE2lqMqkaN7zHS71MEX55zHiNQewHXE/+J6/Y9lC3/6zvgfUKxNlFadExmUyLv9YchJcrNEb+Au9ba48x35zPzc4dgecAiYoFwtXpiqiLgOrJwJGrIKby+EIsEngQ9cpJd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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 Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 07 Nov 2023 14:07:07 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781944637513652999 X-GMAIL-MSGID: 1781944637513652999 |
Series |
Make the kernel preemptible
|
|
Commit Message
Ankur Arora
Nov. 7, 2023, 9:57 p.m. UTC
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 <ankur.a.arora@oracle.com>
---
kernel/sched/core.c | 12 ++++++++++--
kernel/sched/features.h | 7 +++++++
2 files changed, 17 insertions(+), 2 deletions(-)
Comments
On Tue, 7 Nov 2023 13:57:31 -0800 Ankur Arora <ankur.a.arora@oracle.com> wrote: > 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. Is preempt_count accounting really not trust worthy? That is, if we preempt at preempt_count() going to zero but nowhere else, would that work? At least it would create some places that can be resched. What's the broken part of these archs? The assembly? If that's the case, as long as the generic code has the preempt_count() I would think that would be trust worthy. I'm also guessing that in_irq() and friends are still reliable. -- Steve
Steven Rostedt <rostedt@goodmis.org> writes: > On Tue, 7 Nov 2023 13:57:31 -0800 > Ankur Arora <ankur.a.arora@oracle.com> wrote: > >> 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. > > Is preempt_count accounting really not trust worthy? I think the concern was that we might not be marking all the sections that might be non-preemptible. Plus, given that these archs have always been !preemption, it is unlikely that they would work without changes. I think basically we don't have a clue if they work or not since haven't ever been tested. > That is, if we preempt at preempt_count() going to zero but nowhere else, > would that work? At least it would create some places that can be resched. I'm not sure we can be sure. I can imagine places where it should be preempt_disable() ; spin_lock() ; ... ; spin_unlock(); preempt_enable() but the preempt_disable/_enable() are MIA. I think even so it is a pretty good idea. We could decompose ARCH_NO_PREEMPT into ARCH_NO_PREEMPT_COUNT and ARCH_NO_PREEMPT_IRQ. And, as you imply, PREEMPTION (or rather PREEMPT_COUNT) only depends on ARCH_NO_PREEMPT_COUNT, not the ARCH_NO_PREEMPT_IRQ. And this change might make the task of fixing this simpler since you would only have to worry about neighborhood and paths leading to preempt_enable(). void irqentry_exit_cond_resched(void) { - if (!preempt_count()) { + if (IS_DISABLED(CONFIG_ARCH_NO_PREEMPT_IRQ) && !preempt_count()) { /* Sanity check RCU and thread stack */ rcu_irq_exit_check_preempt(); Geert, if you think it might help I can send out a patch. > What's the broken part of these archs? The assembly? Not sure anyone knows. But, assuming m68k is representative of the other three ARCH_NO_PREEMPT ones (might be better placed, because COLDFIRE m68k already supports preemption) the patches Geert had sent out add: - preempt_enable/_disable() pairs to the cache/tlb flush logic - a need-resched check and call to preempt_schedule_irq() in the exception return path. m68k support: https://lore.kernel.org/all/7858a184cda66e0991fd295c711dfed7e4d1248c.1696603287.git.geert@linux-m68k.org/#t (The series itself ran into an mmput() bug which might or might not have anything to do with preemption.) > If that's the case, as > long as the generic code has the preempt_count() I would think that would > be trust worthy. I'm also guessing that in_irq() and friends are still > reliable. True. -- ankur
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