From patchwork Wed Aug 30 18:49:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13370634 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 4C727C6FA8F for ; Wed, 30 Aug 2023 18:50:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 070F244017B; Wed, 30 Aug 2023 14:50:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F3611440178; Wed, 30 Aug 2023 14:50:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D168744017B; Wed, 30 Aug 2023 14:50:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B2D74440178 for ; Wed, 30 Aug 2023 14:50:46 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 948E6140277 for ; Wed, 30 Aug 2023 18:50:46 +0000 (UTC) X-FDA: 81181662492.01.26CE484 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf28.hostedemail.com (Postfix) with ESMTP id 3CB47C000D for ; Wed, 30 Aug 2023 18:50:43 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=0INu6VVv; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pxcH0wXl; spf=pass (imf28.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=ankur.a.arora@oracle.com; dmarc=pass (policy=none) header.from=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=1693421443; 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=ZQUSDAXAq2hTKgg73tSO5DT1RApTyE+5aqfIw3lJuGs=; b=59O5f5I1mwOiNQgKK5arUkw4kkZk+qsT7y8qsmH47hFpUlux+uUy/Bh4hs2vV19PQUMw5K ZAwLcRQno1KFofSSFcuYtj7Jf/jvx+Oh99zdjDGg6UXe+irUoQwlbWQlDb26Yt73bfa3rJ fhajm5ZRjijSMPu9pNS+RjbT1LH2dBo= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1693421443; a=rsa-sha256; cv=pass; b=iqZXzEgEbmCozCujAr7tCqKn0JMrx9h05ggQF1heYouBuN5odGfFkqNo22RE0BHQdtQf9J UH2LtPEt+QVc0WvUHPTOVz2LguzcGsXDSFwBcFd8uWxMrNAUpUJ6zn/xqVoB7Bz1o4SbUE k2h5GrwZlYJ7+e3enMix3pGbv6Zz2bY= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=0INu6VVv; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pxcH0wXl; spf=pass (imf28.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=ankur.a.arora@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37UInqUt018036; Wed, 30 Aug 2023 18:50:30 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=ZQUSDAXAq2hTKgg73tSO5DT1RApTyE+5aqfIw3lJuGs=; b=0INu6VVv0GEMTTAIEQmj3IRUbaAkWGlnNLkcMfKUsq+nqi0t28qnnoXevRoJJxEtuSyx VB2XmzK/k5I0OCTCnA3Me57Cka7WdAJGRutZJnwW/WiR8ep/mJva6fh7AmhPWxxnDeqf 4R3sdHOYUOmQfS2fiOSmp3gdkO5wi1q231JzTqome0Sa8+Um27rFZS6J3XKjM4TkhAPQ ODR/HBUeCS96Px2WcW6kD49BkGHGEaG2IqX2TVjwC/VWWtPW/pFjFO6rDOAZAR3x1EyI IM9Mhc5QM9K+c8ptIjOAzUTpIJePzO4Xrko4OPfHPltWvxN7zyvo/SN0t3DAFcm9gLN0 TA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3sq9j4g76d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Aug 2023 18:50:30 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 37UIVmJV002385; Wed, 30 Aug 2023 18:50:28 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ssyw43vmg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Aug 2023 18:50:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eeBUntXapP+PwJX3vGI8EfwjVIpabiZp/+hTtWwjj6YvhqCeIOKH9+EDdOFKNPZhvvhPyhLlqX/83URG+rNLJ6pPH5vwpzqmjKBxhNjZOJ9jR5oFDTNNiQqs8du2ar1ir1VXXCWVh/BEdTVTuQzY0wHTuGjDDsSaJS19+m4YtVdtbz4qxs3qhfIIvOnipjvGOncvOA05FP8MVVw6W3pF+wjzlRR/xQIVyWlQrmuePQE7TEWdWCiUHtTeKD3Vv883euo55SAqAcn90+rv6c7idsAr+Zq4Vv/27TxYTfcYJvdcSUBcErBjRg8/xpTkC4v9e3j/JIwVGKbiqvQz+TR40Q== 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=ZQUSDAXAq2hTKgg73tSO5DT1RApTyE+5aqfIw3lJuGs=; b=cRU1wsqZKWUw89kkygDeCjAGloekB2TNxhYLexHSZ6+pReZGESmYXg8ZWZjAHsO2ne13cwWou3m72JKs/lgANEgemT5FtdbasxS6PGIbUO/XPQIppBfMKv/Kr6U8EItri41/ITJnUBVjJcI2Do/EnWen3OWIru/ErE18F2RYWF5EAaw67afC1OVOr+SmIFATYVcv3INTEDY78T8RDPCP77BG8cUNy9+VZRnVuB8OHSo0SgubPRMNl5crYJg6LqGMC2G7pPPVlLthDR0oxIeV2xP8f0uTHowt8CqTq2nfPMpvmPMjcEZ73WfA2f8z4rdGYDsBVcg7BLxqpcN+dAEy1Q== 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=ZQUSDAXAq2hTKgg73tSO5DT1RApTyE+5aqfIw3lJuGs=; b=pxcH0wXleHNC7zGYlqE6t5mRFwY6E+knl73bCte126V/QJptfWaico93rZR+/RNQy46X9ATAqCTvFFDRWFxxzydA3I7amqfiJRu7JIJ1lck9V+TO3wPD7ySx2F9blSsuCJzFZSRCMouLGRLVrWyhB2nCh24AvAfBULeThhkHs14= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CYXPR10MB7897.namprd10.prod.outlook.com (2603:10b6:930:da::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20; Wed, 30 Aug 2023 18:50:26 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::238e:5e86:cbd0:7415]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::238e:5e86:cbd0:7415%4]) with mapi id 15.20.6699.035; Wed, 30 Aug 2023 18:50:26 +0000 From: Ankur Arora To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Cc: 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, peterz@infradead.org, rostedt@goodmis.org, tglx@linutronix.de, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, Ankur Arora Subject: [PATCH v2 8/9] irqentry: define irqentry_exit_allow_resched() Date: Wed, 30 Aug 2023 11:49:57 -0700 Message-Id: <20230830184958.2333078-9-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230830184958.2333078-1-ankur.a.arora@oracle.com> References: <20230830184958.2333078-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR03CA0231.namprd03.prod.outlook.com (2603:10b6:303:b9::26) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CYXPR10MB7897:EE_ X-MS-Office365-Filtering-Correlation-Id: 859026f9-65e8-452f-5177-08dba989f916 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9vhy3ZQGGhzt8VqtEpcbh/jak9MnZ6SaC9nzjmiZ8LO4Y/bzDt4Uq1mdXYePczh4yeAEQbE6MvOVSo7R2vVvOF/yqtkjp2hsM1dD94+KiDZoKQKmUDlfvcI2jDjBUdFobZ+V8ekRcCbLArx7D6R74j/YhkDHzfOKg1gUZheiQ4j65IFTceCsxvJ00JppKo5S6IkYEMARGBLYLcE4mLSJnYcRlW2/w7Cfh8oHmt3LCyoC9JBfogXSc2d/klZ9b7Xh/LanPXTw16wtt7brYpgT0nG2Pqu+aKMpqeUVeF3fZFCG9SCB9RLnmi6B1Zbj21jB6j+1hXatG7zV+4ETst9NDSN+oNmE3LpihSsKvyUKdaB5a4WiSJobxHiqC9y6HA5t8SGsvfQ6Mb+5mlrhD9uBJfyvwyIOcENh59AFdYSU/vx/YHwVpnEgYxxLOrXdyq+HfJaD24ecM6ya88oAFFxZkhtOKY4RruQZky4UQHwR0KM+Ny21yizEe8pK2yCU6xOJxvoAtimOOo2gJDG3Tq1i8oVQU55rBANbeQoAtJQFFmRg29ge9XL43BirwMGK71Qy 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)(39860400002)(376002)(396003)(136003)(366004)(451199024)(186009)(1800799009)(478600001)(38100700002)(26005)(1076003)(36756003)(66946007)(41300700001)(6512007)(83380400001)(2616005)(107886003)(66476007)(66556008)(6486002)(6506007)(316002)(6666004)(7416002)(5660300002)(4326008)(8676002)(103116003)(8936002)(86362001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yUHmZYk5hcuhGYVVWykHTIFUSr0HeoGfE3wZnab1E5X64dXBkPaWmnO08hC4neSNrivKQ4W8WeGsa3VHAxKCXc68ht0iwP9qg/t7RDAMWIqGBTJpTCYFeWqX8is1G4G//4GqvRd7Xz4Rni5q3cBfRSceeJndISpHelO8GKQchjpbhFViLEQLmUCdNnKXznsHrYl3/2OuJ4s2y0tWpqUlBG9BPH9SkwyGokPIpnwATJx1wc6oIGtMnh4xyCNltQOZkAnXZJKLRcTQHrYQDF73WPwJcBQ2dpQ/h9+I+Qxd20UnyDnMefhtREoMk2egWjDIqGUIQfPdk5jPcUuGzD9pMXoZ0ijnAC0wPvyBl67xq7tVpYLl58r4tGb0VFShNuWNwLyTJYwkVdXRGbpdsThlkNkz66l1/uuOF6/WTwMbPMFl2gpxrm0X3pbIvb/PBmaIpUNwkdXA59R/Jml2QsQnQTiaoZB2F6seQjXXbGfR4KpbqFF/q82M8Z0ysyQ/cs3xKnh/Ym4nIpvHfFJDVIYRJs2nxVeNKZCIw0My4OhZh0qm2AnDZT8AewENwT/nMxbguxBeqSAgP5Ruxjl6lNiIRtzQw+EQuPAKxtenwYLqFnWmkwwqQ6Aw9X/1dfRf7VP7PiyaXQs3a1OGGbxQi0vvC5quS9qOWuavNrjET/UTlbGgnQNCuvQ+quBMm0voIrSUSElwPLAmdIa5PnzqBcqQH6/3oUzrnk0FA1idBfJ4S1wSRJqBBMk9nZhFbTQHLuiOU94pjWqbeiZZ+xhK5X61OEIUFPRgIxCiSHa+0pyzbvYSOlTDgVgm92c3ZE1yAc324byPhEhx/PyPDPbbRX4EaMg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4ngakf7i6dcbBPvBmkKgdS1CSk3//aqYd5f0iECo2vRQ8ZSAMNHJD/SKt1/Oek15Er1oWlCnXMfaEVEh0ABxclbw1Jjm7Lmx4pJMW1EN2QYxvluWrFdwf7kiVrlgk7FDJuckh+y+PcmUiR4g299RZ65xMeBOsPuvwcDfQ+oAPPxs0IOBR7JVJK32L2eJAP54YjgLGhDw9H21+d1djLSk3rlI5f83fxT7wfcvYCwQwhFdYxEpVZ2gN9k8RVXXx0N8IRd0ANNgXJL5ioHFgDy6RbdMQQAVabm5GG3iT/CaAHGhvWj3b0/sSu/ic2+lYgKKrGYJUdboLkdQ2+9836dGz4u/heVY6e6zRbb8ZRpwwrKZZQ6X1zEZfVoghrBsNwpFLN2k5UPnHn8WpPPFMBC4up59RAI+4hKtEf+zIe/KwcKKKfBrZonJxZgPaIvsJ0eDZbHCef9lfospmFBhs59zYYH+MsNkQcNvVuV4ntxB5XCZS6UNguOQA6fRlL+NFWOrBwUBNL396QqUp1jj0ySgpEwHwYlFaXPP7ghQECDPdKPTosY5JhRjWyat1ydk0F26MqWNFQLYmCpWbguwUwDLhJ6UMoS41a2dN0Owiy9uRD6lSllSh8n8RcvmChJ0l4UUvym43WUvcZ7xfH2Nn5tsjWDBylXaEUhk6x+Vt92/2eZjOzD07jwzbYJjLhxHDcn4loy3F8wwS8hAQWX8mk0cswPYAEgr2W6fyFeUJtLFHoNDneAQVMhPO3unfZoP6zfWc9uZRO0f23d7yN2Fi33Vnmy7vbNYQIAw+nS+JaMIkMqaiLJhP7MUeXshVdxKF6AKKzgUkth0rNFaIPPQnAARVDQricMk+ucCLnSjIMx3Z0VKz/FZBk5IhjLrAU/FA1f3yVm8pLCJsgLeX22jwmo8U8sWOugbC04S+1OS+s/nh4xF6+ToZYZMsS6XMt1r7eOgCY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 859026f9-65e8-452f-5177-08dba989f916 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2023 18:50:26.0338 (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: tlIgP7oBt4bn9kBHfx27nH4m1QBsyiqqPqvzxlkyXxrPgJo/M3YfWLTMudWUdNpf7TFhgOYfWbNjs8ZpJFvc8jUNklM2kIClMyGBnmFqRF8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR10MB7897 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-30_15,2023-08-29_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 malwarescore=0 spamscore=0 mlxlogscore=482 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2308300170 X-Proofpoint-GUID: mb-hkt9pfv4cL6pGQ4HITQCjtSzH_TkP X-Proofpoint-ORIG-GUID: mb-hkt9pfv4cL6pGQ4HITQCjtSzH_TkP X-Rspamd-Queue-Id: 3CB47C000D X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 9cykf3kjebrnqhbnaferd6mi1pcpb1cm X-HE-Tag: 1693421443-757742 X-HE-Meta: U2FsdGVkX1/UsAmuij6nGBrXm1QgCf+u4uxYJG/sCNpqS8I+GNIxB7v3xVI7MT/RT1VuPydjWXJLT9jPOSe//TMJHIF9W94JxKaLNKahK1rL1aFdRVJOUcGCUPE52c2KIQ+ybkzeC4QChswtJQxPAeGwouw11pVcYw3C1vIeXQCTGnlHVsI7+eZphIZleE81xIOHY1PzB7hSKTPSoSoi5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W6RmO2v47U5fIbTS4gajo47x7RZ44NRO3NBaRNJAXkxH5tEOaZHiN0vJgnLX3YWWBCkpLjqhslxXFD+x1gsa65qzviOsJfrK5J0gky8kiUr/XjA9plkXVNw7A0JtTH9fUrJSSqBBlMpPPhnQUFxhOlanb5v49hY2mWQHiLLL4VgJM4OeWupp1/c2ksMp7Cuv3PE4LyBR5Nnvbr8dvF0XK04YZSKY01ydXEV6Yav1It6Y1MM3Aoib22a7oSWwgAQtF07PScWWHtK57to9o3/HjOso3CpaOwwJcRvD61w19knXtsGma7L4Xs4xNGs= 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: Threads marked with TIF_ALLOW_RESCHED are preemptible, but do not have explicit preemption points. Handle them as we do preempt_model_full(), by rescheduling in the irqentry_exit path by calling irqentry_exit_code_resched(). Co-developed-by: Peter Zijlstra Signed-off-by: Ankur Arora --- include/linux/entry-common.h | 13 +++++++++++++ kernel/entry/common.c | 13 ++++++++++++- kernel/sched/core.c | 32 +++++++++++++++++--------------- 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h index d95ab85f96ba..3716c223a703 100644 --- a/include/linux/entry-common.h +++ b/include/linux/entry-common.h @@ -415,10 +415,23 @@ irqentry_state_t noinstr irqentry_enter(struct pt_regs *regs); * Conditional reschedule with additional sanity checks. */ void raw_irqentry_exit_cond_resched(void); + +/** + * irqentry_exit_allow_resched - Conditionally reschedule on return from interrupt + * for tasks that are explicitly marked TIF_ALLOW_RESCHED. + * + * Enabled for both preempt_model_none() and preempt_model_voluntary(). + */ +void irqentry_exit_allow_resched(void); + #ifdef CONFIG_PREEMPT_DYNAMIC #if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) #define irqentry_exit_cond_resched_dynamic_enabled raw_irqentry_exit_cond_resched +#ifdef TIF_RESCHED_ALLOW +#define irqentry_exit_cond_resched_dynamic_disabled irqentry_exit_allow_resched +#else #define irqentry_exit_cond_resched_dynamic_disabled NULL +#endif DECLARE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched); #define irqentry_exit_cond_resched() static_call(irqentry_exit_cond_resched)() #elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) diff --git a/kernel/entry/common.c b/kernel/entry/common.c index d7ee4bc3f2ba..b4cee897d6f6 100644 --- a/kernel/entry/common.c +++ b/kernel/entry/common.c @@ -389,6 +389,13 @@ void raw_irqentry_exit_cond_resched(void) preempt_schedule_irq(); } } + +void irqentry_exit_allow_resched(void) +{ + if (resched_allowed()) + raw_irqentry_exit_cond_resched(); +} + #ifdef CONFIG_PREEMPT_DYNAMIC #if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) DEFINE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched); @@ -396,8 +403,10 @@ DEFINE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched); DEFINE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched); void dynamic_irqentry_exit_cond_resched(void) { - if (!static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched)) + if (!static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched)) { + irqentry_exit_allow_resched(); return; + } raw_irqentry_exit_cond_resched(); } #endif @@ -430,6 +439,8 @@ noinstr void irqentry_exit(struct pt_regs *regs, irqentry_state_t state) instrumentation_begin(); if (IS_ENABLED(CONFIG_PREEMPTION)) irqentry_exit_cond_resched(); + else + irqentry_exit_allow_resched(); /* Covers both tracing and lockdep */ trace_hardirqs_on(); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2299a5cfbfb9..3c1b1b0cd575 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6570,6 +6570,8 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) * - explicit schedule() call * - return from syscall or exception to user-space * - return from interrupt-handler to user-space + * - return from interrupt-handler for a task marked + * with allow_resched() * * WARNING: must be called with preemption disabled! */ @@ -8692,25 +8694,25 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); * * * NONE: - * cond_resched <- __cond_resched - * might_resched <- RET0 - * preempt_schedule <- NOP - * preempt_schedule_notrace <- NOP - * irqentry_exit_cond_resched <- NOP + * cond_resched <- __cond_resched + * might_resched <- RET0 + * preempt_schedule <- NOP + * preempt_schedule_notrace <- NOP + * irqentry_exit_cond_resched <- irqentry_exit_allow_resched * * VOLUNTARY: - * cond_resched <- __cond_resched - * might_resched <- __cond_resched - * preempt_schedule <- NOP - * preempt_schedule_notrace <- NOP - * irqentry_exit_cond_resched <- NOP + * cond_resched <- __cond_resched + * might_resched <- __cond_resched + * preempt_schedule <- NOP + * preempt_schedule_notrace <- NOP + * irqentry_exit_cond_resched <- irqentry_exit_allow_resched * * FULL: - * cond_resched <- RET0 - * might_resched <- RET0 - * preempt_schedule <- preempt_schedule - * preempt_schedule_notrace <- preempt_schedule_notrace - * irqentry_exit_cond_resched <- irqentry_exit_cond_resched + * cond_resched <- RET0 + * might_resched <- RET0 + * preempt_schedule <- preempt_schedule + * preempt_schedule_notrace <- preempt_schedule_notrace + * irqentry_exit_cond_resched <- irqentry_exit_cond_resched */ enum {