From patchwork Tue Nov 7 21:57:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13449404 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 DE8A6C4332F for ; Tue, 7 Nov 2023 22:00:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A2CB58D0082; Tue, 7 Nov 2023 17:00:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B52F8D007C; Tue, 7 Nov 2023 17:00:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B8558D0082; Tue, 7 Nov 2023 17:00:23 -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 618C08D007C for ; Tue, 7 Nov 2023 17:00:23 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3BB9AA0B5D for ; Tue, 7 Nov 2023 22:00:23 +0000 (UTC) X-FDA: 81432527526.09.2FA3454 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf16.hostedemail.com (Postfix) with ESMTP id 7F78B180003 for ; Tue, 7 Nov 2023 22:00:19 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=AwsiFAMD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=prbTUcMA; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.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=1699394419; 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=rR1rkZaAcUjbJhVUuuHUsBP4wRC0wqW6GVBbfHb15x8=; b=Rm4aNoWP7xISQbSWnGUugbLnIdtnu3fx/h4bDEitvYZSYP9P/SaIFvfZPZYPJfV2e4DLi/ VENsaerARIiYqUH+bLUFCLnTLxJ/7kSZG0jJSbhHQiSQtGsW+4uGqqnaiS/CZIxGAElQ1m TMeN4Hxa3vEHHoYl/FVnydYGkU7ypoE= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=AwsiFAMD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=prbTUcMA; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf16.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=1699394419; a=rsa-sha256; cv=pass; b=DzbeJxATbOQJSVg9fUlRcdb00C+VYpatEgHAY5RvGD0c8rCe/Mn0dJSniCyVdxux9UDYKI 7X/l3PRHqhYu5JX/GpfrI2uxHRXbYBKBZNECEWGKU+SA37ZvVcDDOJpvzM1VaVDXbcoGlj jx4LmWEoM10U0qM/czVKzi/4MGIHXDU= 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 3A7LJpwG026315; Tue, 7 Nov 2023 21:59:58 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=rR1rkZaAcUjbJhVUuuHUsBP4wRC0wqW6GVBbfHb15x8=; b=AwsiFAMDdloUNUPeyvfyMO+aMi0EkQXiEasxSzq735RWh0hj65kJw3RdfSFOhYfKeDcI NZCBfHXLWBs9BRKzhpHfZPxM2uURobrmETAhR947ypcB/+DDyJt5zF7RMZIB7pZhwph/ j/+hAQYbqel40grJYu+pTi4kd3lNjDNIFoqXYkAagofRMbLAzD6T/i4Vm7k1SxK5wsSD 0CuCCFyEg+Z/9xb/ftlJ7yBu8dI6k6rCxewAVwd+0GILv2y5S/aa/4MlD+OgTGnlckb6 FDKrhRN2fhL3f1rGd0FA413vuVsAcLoyhNW2oVYKvigyAYb1bo+4FKN0xvJZVVYr5V/x eA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w2102q0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 21:59:57 +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 3A7LJOlK023824; Tue, 7 Nov 2023 21:59:57 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u7w241gvt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 21:59:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KgOJ/mz5lOcv+9EY5ImUX1gsmXMkKYy+S/FeJA2HWTa/nGgj4KDo1dxEFP+uZpJKIquP318avQvTvXP9NRvFD9rVKsEFKL4VRVm9tnacW7XXsuNauwA1nfzR3+kv6nQLdOnBamoTQzzkx4ksDz3fH7nj3ik2XebLpjRzu2DSM01iBnvNDJpfxRpH1qXJH3dsb3w7oL0Qj+vx95E4E1ARckuLjdGy2xOYyfkaDuTgRTGIyT5kJAjt8ygsm+4StarTS/oMXq7ulJk6gKFHq9kz4sFKKUoM8Ucigz8vMVSPhq5MqOh0IQQ1evYrbNbs4oqt7/Eg32YNQaG8zD6pY/czug== 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=rR1rkZaAcUjbJhVUuuHUsBP4wRC0wqW6GVBbfHb15x8=; b=fD8qjFp29z2dFsmKcW9qRFcHbp+mnbwqhY0T5D2ltxokSwS4NVS0zKiepLWdajKSvs6xlBURIBeoIbLP2UfcPOFDbRWlxfWo7gX0cz8s/RMEa5JPIZ966KKZvz3ZdR+qekYC4m1X7tAXLkUNMzHqL7+xJykzNozH1r8EkS7TqGuAys+qP0H77oi9pj9Z8sCJg+3Duymo4lbB7KP7RL5UY8o1QuWfD3+n2AHnMm5Or95thDY95419F/lg/A+l4z3DqYloEc0/mV+Po6G6MgTN+Goxzlgz+XnSadZcPKFNpXu99w8aPd7fcEuUvMYs+vDIh9CKdHCAOqEGJkFKEeSJ1g== 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=rR1rkZaAcUjbJhVUuuHUsBP4wRC0wqW6GVBbfHb15x8=; b=prbTUcMA3tI9tKkKd8/zkGWi0pIGVmhSAuZf2HCEYNFzhYwtqz2rlQqDz1UVLXVpuy/8KVZLTlJLHtjZz7AsYT1PKtq5HNS3aP58ypdWl13N5e7pbjTD6LINZumT3nDybQx+ehk12cdLSd15W8JqWJRRfY36YhUyvsjiVOuMycA= 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 21:59:54 +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 21:59:54 +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 43/86] sched: enable PREEMPT_COUNT, PREEMPTION for all preemption models Date: Tue, 7 Nov 2023 13:57:29 -0800 Message-Id: <20231107215742.363031-44-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: MW4PR03CA0250.namprd03.prod.outlook.com (2603:10b6:303:b4::15) 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: e23fc83e-3569-4276-4692-08dbdfdcdfd9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4i1r8YnG08dLkmb/W3ggCv8d4f+0sRTbVy8b/3F5xsy7FBmrawbE7NtK1MUGNqkdR0AtB/h3WrCpQU3uDsV2y6KePXIeJ9No3f6HCTtHYm6SEdJu7Vom33RsJadq07TeOWtqGFXbBVhKZ85R7lZzaMaPDoplflD3ImHkB6cQcBX1PHcdD7WxihAaLA9YpBdI/54ZleQfh1azSAbxoDxndMQ/DFn6BUJ39jTXj2JuS3t42ROq+gYGfMbd4DhxFZJaR2j47742WlbnsOeCtACxhUozyotgudi2yF/2v6bISGo+mcUe7IBzEG8xcXoL9QLm6LgqoFkMP46LSyrPsBwrNVNX7mq+d4SP2ir+37ibkroNSder2g0YgUO3/KRT210DyOKWc1wbvOIyef/yaymY/bAcO4lKg5gI3JMsbwUdD6PPU58/RNOI3H5QpjEofTSq9zCDLEwpZJsO8JRZlPNzUmhM4K2BZyizNNLr0gawYICK9GDiBf8ggQ032nLZIr7AiCY+Qyy02tA11JzlHN7eiLCYsKvLsMIiu9xQX7l9y4zDdl5g2eUCC2kc4kRV2vlu6oAGByjf8ZNgxOsL14cXI0UG1PoJ4oiicLwCquPek+ZsiLqGYioas+tb/D8PaVCo 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)(170073001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GA0RiWnl/1dkrogtczrnNsfMGkIUWj61x5yAfnBKwG9t3oLwMx50leppf8/AA+WJ+hAJZ0Noa06h5GZeW0TNFvL+QaEEkD0dnHyKMKAldxG6nBf+0ZO6VajwFvaMyNMGFTRtWQn1a54ol0lPkr+9/K28wPNZhVuRiXR+LNL7QlALpNAsSC6BWGq+XH9C6I6Ryaw1/YQZWvjzopIQfl0vNZ3OmX+fdvRt/78VOWiZuH485uMG834l//D4cAXfcBAT3d7VSZpvKiZ+tJN0/EnVhe6a7F6dh+6Wzw6p9DhtVknNiQFcaEfSONysmXixpk+COiL1DTnzJLCcLdl4kicKJhEBMtfh8q+veJnBOMCvfkvifPWoWGyhYSjmLH/SgPzszjUmDeU0JzckUH3GbXxYsCR6FuBGWgMsbKaHsSTWz6IGkmpnLIRAh9r32E1DQdgM7rxLWstoOxdkTewyNGGA8E7SILQeb2igkRXUjCJopy97gGKI37uTO6br5jOVSkA3Fy5Z3vVlwH0LyOcaO1UIp5OuCr8zY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RuEQIfl8FVZs1ovLQMPKnB9l/+qPeCBGksrbmdtn7cTntf6opXldiuPR6G4M/jWOxOjTTCNY1U7Jp5Bg5k0oEGOA5fl7yuJBZtGSgagLU1wkWRI8vjc7HOTpDysDdfXx/XGxxkZw4Wn6+D+u+kitLJ3CanXuv3xW1aBVlvaqDgjn0PYCkBoBTPPa35SagzReKeKURvQAUoh9XRmhdQov1DaJZZsm505bNXlrQ0Imdm57bTkKJ4UYdsBLxHIQSYechSnCTFFTY+1bV8r7GYORMdafYktYausdEo1etI/AHR0GteopARaU75Jc8bRbtrGSoQLPwsseka5M5GBTL3hBsDUS7LAFFCRkQH3TLXUGv8nCZjJTqOhLinm0biMlvM5eIG41xca+K+o7wzj3v/2lDqMr92KF6kRnrxvla+NLi1H6QT/wX9BWpypnsQz/m2JCEprFXcXAaeHP4Ak0CItZQHMB+GdCMB/BUCvNHLs2tp2cyEWzGLu9+xSX2XK37Xa7QqOOQoKp+n/QBkZwLFFdyh/Yxybh54taQLBKn5AkQsVnFK0g/eGXzzRD+AYArfg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e23fc83e-3569-4276-4692-08dbdfdcdfd9 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2023 21:59:54.5899 (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: ov0nHQuUC80qS7AsA/au1oN20mO3i1UajO67O7HTy7M3+ukgONY0I2B7bLJDLBE+jyMztb/7m+wz6fxvCdOsE36pkQ/tw+Ia0+H/yaxPpow= 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=829 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: HUXlBx9Ae2D8bU10bNXdXpUFrxiOPGJz X-Proofpoint-ORIG-GUID: HUXlBx9Ae2D8bU10bNXdXpUFrxiOPGJz X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 7F78B180003 X-Stat-Signature: n6d59k4hjympfr8pdqhy44jjdqzf7d34 X-HE-Tag: 1699394419-391143 X-HE-Meta: U2FsdGVkX184arLqztDxzmCy1xpsJffN/CjT0Xx6XgEIPBeuGQ9E2KfRuCbxNu34bTfU4WY8C1wWjfXrLLD5CEbmPribcxe9T6G6lMzdYG8byLY1+hCvyM0pB4bK57lovi6sa5UmNSJmePAuUIXODjK8iAtbQUReIv7vzAPSpWOWoSI62hmjRIh7l6XwPsZAaZvZ9XxZXz6x2gbvM9viSNr0GFbDDxrbn0VsH4IwlZG2gwtQuZXPGmYuiJRijF4vqJcM6sUcVD0lZNvJShIuREbuisP7JgvD1A8znVEmZeNAZ07BUbP/9tAsbuSsw02JfdHHIVf9DViEO6HKY9piAZvZeKwMEtErH4HzMnzP4wHd9MrIZ1uyLXE/Bi05KZV8wNr3dCpGBHJ14qXDKydJQ/p98P034hsrypxlu8SQnpK0EXSdQ06Qf1Sa0I3xZ/T01v69hdsFPhO8a1IuZSbr3R78hhPhtxkxHkTw1OvgcxE+YidIlMw3+4pARyV4GN3sl9/JPiI0SpkPwuslMUifJX2OyRlGmf/fgDP8b+hUGThJsPcr8XzKeRF2vFKdc+IT/DduRGZKUNPdam1Rraxh8Xhu2OXPqCg+ZW8GoqApOvGCH2IN8KL4bRlVg1x5MWR1qfQi6cbAh34jYnpC81eeSVqZ9A8pWy4gUYuphHtjkopwEmv9GdBZ4NhF/en7le/atThq2yEocmHL8cEV+vBrynmOylHamra+uevuNwq0ob7dJn5b19xVE/OM4kS80mnyOSveXPNEHzN/85Q3O5E2ZMlsGsJEc2/PTSA9oUPCHXCiqghojVHS+IyrhZ2goWioCG7fpW07qwmjDu5MK1//tYjyc++D+RFnabGcjqY8t4onrpu5syzaG61ardtguks1CiMr1FcMx6I7MtHKTqo3vzBjiqbC39OFz54SXobWIO8pUYmG8B6WrND1h6jVoI9hlDf3vQCYvlVtoDx4i1q 1XzusYhs ubk/h8swQAJ3zT5lgZyLW3f7ykq+5SkYWkJkCphFBqG3ycvEoh9yOgOq5/siNPQHtFkW3zRF1g7hgyFv+tbJGGBkntXWpgX9oMvQuKjOOaZHPa5wK/6U390l2IPtnEwN1bAhUr5T8F5+SeE591xEXkt05/m5dtf/nuDniyL872l34rxPqZWyhSpa9S1B6ax8FvHN5FwHZAJrDIN6PCrZTw6Ze3yVC4S+c39QlLgRclBXo5DtGlVIRCFxgi1t+oRuGmD01RyTUVqALrxcrpcc6de7DHs1yoM2UBFh0gBnOv9Pjhyj4DQFreiwUILqbo7OjqyJBQjpNwuBCoHVBWBGnqOP+v+JZDJq7YAZNWiM/6fk5eLC/Qhx3f4Umuqk2y7uS/pVBq0PIADPqvgcrGgXg6ndLh8e8E5QPOPqYOq8BJ2xqpkFNJYiA/h74PRBZ3R8mNSgV+UnFBE2uqldqLUomCQRrpA== 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: The scheduler uses PREEMPT_COUNT and PREEMPTION to drive preemption: the first to demarcate non-preemptible sections and the second for the actual mechanics of preemption. Enable both for voluntary preemption models. In addition, define a new scheduler feature FORCE_PREEMPT which can now be used to distinguish between voluntary and full preemption models at runtime. Originally-by: Thomas Gleixner Signed-off-by: Ankur Arora --- init/Makefile | 2 +- kernel/Kconfig.preempt | 12 ++++++++---- kernel/entry/common.c | 3 +-- kernel/sched/core.c | 26 +++++++++++--------------- kernel/sched/features.h | 6 ++++++ 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/init/Makefile b/init/Makefile index 385fd80fa2ef..99e480f24cf3 100644 --- a/init/Makefile +++ b/init/Makefile @@ -24,7 +24,7 @@ mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o # smp-flag-$(CONFIG_SMP) := SMP -preempt-flag-$(CONFIG_PREEMPT) := PREEMPT +preempt-flag-$(CONFIG_PREEMPTION) := PREEMPT_DYNAMIC preempt-flag-$(CONFIG_PREEMPT_RT) := PREEMPT_RT build-version = $(or $(KBUILD_BUILD_VERSION), $(build-version-auto)) diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt index aa87b5cd3ecc..074fe5e253b5 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -6,20 +6,23 @@ choice config PREEMPT_NONE bool "No Forced Preemption (Server)" + select PREEMPTION help This is the traditional Linux preemption model, geared towards throughput. It will still provide good latencies most of the - time, but there are no guarantees and occasional longer delays - are possible. + time, but occasional delays are possible. Select this option if you are building a kernel for a server or scientific/computation system, or if you want to maximize the raw processing power of the kernel, irrespective of scheduling - latencies. + latencies. Unless your architecture actively disables preemption, + you can always switch to one of the other preemption models + at runtime. config PREEMPT_VOLUNTARY bool "Voluntary Kernel Preemption (Desktop)" depends on !ARCH_NO_PREEMPT + select PREEMPTION help This option reduces the latency of the kernel by adding more "explicit preemption points" to the kernel code. These new @@ -53,7 +56,8 @@ config PREEMPT Select this if you are building a kernel for a desktop or embedded system with latency requirements in the milliseconds - range. + range. You can always switch to one of lower preemption options + at runtime. config PREEMPT_RT bool "Fully Preemptible Kernel (Real-Time)" diff --git a/kernel/entry/common.c b/kernel/entry/common.c index 6433e6c77185..f7f2efabb5b5 100644 --- a/kernel/entry/common.c +++ b/kernel/entry/common.c @@ -422,8 +422,7 @@ noinstr void irqentry_exit(struct pt_regs *regs, irqentry_state_t state) } instrumentation_begin(); - if (IS_ENABLED(CONFIG_PREEMPTION)) - irqentry_exit_cond_resched(); + irqentry_exit_cond_resched(); /* Covers both tracing and lockdep */ trace_hardirqs_on(); instrumentation_end(); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f65bf3ce0e9d..2a50a64255c6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1065,7 +1065,7 @@ void __resched_curr(struct rq *rq, resched_t rs) * * Always schedule eagerly, if: * - * - running under full preemption + * - running under full preemption (sched_feat(FORCE_PREEMPT)) * * - idle: when not polling (or if we don't have TIF_POLLING_NRFLAG) * force TIF_NEED_RESCHED to be set and send a resched IPI. @@ -1081,7 +1081,7 @@ void resched_curr(struct rq *rq) resched_t rs = RESCHED_lazy; int context; - if (IS_ENABLED(CONFIG_PREEMPT) || + if (sched_feat(FORCE_PREEMPT) || (rq->curr->sched_class == &idle_sched_class)) { rs = RESCHED_eager; goto resched; @@ -1108,7 +1108,6 @@ void resched_curr(struct rq *rq) context = ct_state_cpu(cpu_of(rq)); if ((context == CONTEXT_USER) || (context == CONTEXT_GUEST)) { - rs = RESCHED_eager; goto resched; } @@ -6597,20 +6596,18 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) * * 1. Explicit blocking: mutex, semaphore, waitqueue, etc. * - * 2. TIF_NEED_RESCHED flag is checked on interrupt and userspace return - * paths. For example, see arch/x86/entry_64.S. + * 2. TIF_NEED_RESCHED flag is checked on interrupt and TIF_NEED_RESCHED[_LAZY] + * flags on userspace return paths. For example, see arch/x86/entry_64.S. * - * To drive preemption between tasks, the scheduler sets the flag in timer - * interrupt handler scheduler_tick(). + * To drive preemption between tasks, the scheduler sets one of these + * flags in timer interrupt handler scheduler_tick(). * * 3. Wakeups don't really cause entry into schedule(). They add a * task to the run-queue and that's it. * - * Now, if the new task added to the run-queue preempts the current - * task, then the wakeup sets TIF_NEED_RESCHED and schedule() gets - * called on the nearest possible occasion: - * - * - If the kernel is preemptible (CONFIG_PREEMPTION=y): + * - Now, if the new task added to the run-queue preempts the current + * task, then the wakeup sets TIF_NEED_RESCHED and schedule() gets + * called on the nearest possible occasion: * * - in syscall or exception context, at the next outmost * preempt_enable(). (this might be as soon as the wake_up()'s @@ -6619,10 +6616,9 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) * - in IRQ context, return from interrupt-handler to * preemptible context * - * - If the kernel is not preemptible (CONFIG_PREEMPTION is not set) - * then at the next: + * - If the new task preempts the current task, but the scheduling + * policy is only preempt voluntarily, then at the next: * - * - cond_resched() call * - explicit schedule() call * - return from syscall or exception to user-space * - return from interrupt-handler to user-space diff --git a/kernel/sched/features.h b/kernel/sched/features.h index f770168230ae..9b4c2967b2b7 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -89,3 +89,9 @@ SCHED_FEAT(UTIL_EST_FASTUP, true) SCHED_FEAT(LATENCY_WARN, false) SCHED_FEAT(HZ_BW, true) + +#if defined(CONFIG_PREEMPT) +SCHED_FEAT(FORCE_PREEMPT, true) +#else +SCHED_FEAT(FORCE_PREEMPT, false) +#endif