From patchwork Tue Nov 7 21:57:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13449401 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 83566C4332F for ; Tue, 7 Nov 2023 22:00:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 12C818D007F; Tue, 7 Nov 2023 17:00:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DDDF8D007C; Tue, 7 Nov 2023 17:00:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFC508D007F; Tue, 7 Nov 2023 17:00:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C97B98D007C for ; Tue, 7 Nov 2023 17:00:12 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A43EC40B41 for ; Tue, 7 Nov 2023 22:00:12 +0000 (UTC) X-FDA: 81432527064.04.B79F841 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf22.hostedemail.com (Postfix) with ESMTP id 46C87C0023 for ; Tue, 7 Nov 2023 22:00:09 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=MZyguyW1; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mqs1SxSi; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf22.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.165.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=1699394409; 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=2ZY6L9oPxrPlWmZKgAmtx10Uzt7Oy++Nu7qtHb6Gu8I=; b=yt4mkkvNn6R27ZfrPEaZt9E2aIZ2FOjEqpB+YcmMuV75etJ20WWD8NuPJb6Onx8Y0RPjp6 FVC96vzHX2q8D2sGHDrOCYKAZ8gUbHpgegPaBI2cm3CthH+ZeJ/glJR3kFIyGnkVv13Nbl RTOMC2GF13oZLQY4x31jGCZnYydRxGE= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=MZyguyW1; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mqs1SxSi; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf22.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=ankur.a.arora@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1699394409; a=rsa-sha256; cv=pass; b=M65Jg38X/kAjvKNXFXPadWfBk6LFTXC070+dafKDEieVu+bnin77YG3kYmPeABbgHugtlV fDFVUenOBuN/1CviDHU7HLi+rh8cHrNyePdfVQvvWonSxCL13DVQxCbvBKuEZMpHsS3Z9e Y5bfN9ftYjx9VjcGwTt89eCMOGTb7Tw= 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 3A7LJP6T004600; Tue, 7 Nov 2023 21:59:49 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=2ZY6L9oPxrPlWmZKgAmtx10Uzt7Oy++Nu7qtHb6Gu8I=; b=MZyguyW13tBDpL6bIvbuyHhlHOQMNOu4SA6O2pyfSrXZLk8wqlafyb/64NbsAwxEacbJ KEhZqa7ZxwwGagNDD4kxy9luiTbfjsAxjlqxSoIZWBrTsq+8mo0HUjVyNHhg9Tw4ZnMp 1B0L0PsSVbjfwaTvCe2Beoz94o5PGgkU30sOu0dInBWvN4AoJ/1BniHQsE1qpmrSkl1N S/POgciMCDithDUSH1RTp38nOtOLpBFSfcCq4eU2RYq8HV1JcdD7/FTdow7lglEd0zYm qvigtTeqS2yRoz5SR4inU5NH+UWj1OIK1imH8Wf5MIzRXjGcb/FZtT1R4VriMN48itFv ZQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w23g2dd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 21:59:48 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3A7LItTo003981; Tue, 7 Nov 2023 21:59:48 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2041.outbound.protection.outlook.com [104.47.73.41]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u7w1vsk1r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 21:59:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aiCEtZShEs0MffEv60cSkjoU5RjbfRq17TVizyEw+z0pIrG9wxJhlXvW/ctHRJRfJclpbE7ZogJuwOnZMleLyj8OUUzGxeaCItRLs4vzDjG/FwiuFUldbAO/4Wd7rbKvb1dB0f0oTy4zYqAdWFegiQF2U6awiZGgqGEubh1mOqDoydPVl63LKuYV/QDx1vDMWybryO3H+r78eJ5pLCRiPvXtxKK2Z5FXrTtqnkZvgQT3Vo2jOwACvrU60vvA1vnYow166xsdZGP2U4Dek5NlkBeph5YcHRjibZ9Al7nilntSBKOaGYaCQ0fsxMAMYtma9z3jpH9156y479yZEqGLvQ== 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=2ZY6L9oPxrPlWmZKgAmtx10Uzt7Oy++Nu7qtHb6Gu8I=; b=i6208VcHZN27A9JrVA+f+50gvE65HcrO6pvICsgr102D+tYrISfzsdukC7rmmM/DItqLV8eU7yeUJ1D6X9y8OyWG1KNcyUpQ+5U5CSjEeBmTW/pvz1Eccq30elgzXdkd/ChVg8pZCl2qVyMfVIyjFryVO7qd5w+NAJe/IPZti0aJOsEDVLsIlLhoUviY9VRcSk4efxzej+KyqtjibhSRdJmlxvMa9YeGPlD3jpg6MhgqM0sQptoLO50L+2rNhbb5wJBGQcd9EAQla3Z7X1UGISJizpARyxjz0E96CWj4AruPnmlKv89GIeAdKgOIUbalFhuKgZWGjOYC0yxTWr0qug== 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=2ZY6L9oPxrPlWmZKgAmtx10Uzt7Oy++Nu7qtHb6Gu8I=; b=mqs1SxSiiXo7UEmFNDHiXZoLuwQoXiw/usW58F0aqUu/iiwEBXkVVGYMER3qAl5befiSnxEtbHKibsll7qvquuXIMe0Ce2iF31InKPbiNOxkOzX/rVq8CAI6VDwd7bNXtfbEeQ2MtKKhzyLyKPIagKRp+hSotv5+Bvgz+AnbWYk= 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:43 +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:43 +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 39/86] sched: handle lazy resched in set_nr_*_polling() Date: Tue, 7 Nov 2023 13:57:25 -0800 Message-Id: <20231107215742.363031-40-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: MW4P221CA0015.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::20) 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: c09bc759-dae1-4d26-4eb9-08dbdfdcd929 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0Pj23+h+y26oGGWj302C9dY555Xj5Kf5fmfCodiWSLC8B4eseEc2pT3YmSRBh5SH7mcXJZ/2s5MEBs3PY/oDFLWq/w6viv+8GTjBRdm9EODO0hl4wGjIbACC7XG3lYwT5oGcS3j8MMXyF7xOqB3a6PTWTzhDfvH+NzyGzS5d07X+z3GMNo32onoMVLttKw2ZYCvTBHJFLIeNlTkpxQ7QMngo8IG9ZlNtcSLs2Sh990fG6oNnwrlibiTnyn4lKzUNg3cSun57fr4PceT14pfzBaoM2If+rzZ2U6e0PhuF+PaZY6vktbnte3pCEDQz8aZ/sP9a6AEi5/R5mZrezMN/MuWlvg5ZmYesNBWV93mFgqb/vrY7mBhrQPPG1qIJW43iOzqGKqkuDdGKhha+8SJ0iXhj/hrsxNEu2TbzO1tSfWmgVLR/SPJLXxbLbOKlmDMp6QA+HD0Zx4M8759PdEVQ+TQF3nnjYLzhlQW1ZhVIN22jQOzPE/n6tD81kszhjiFdVBC0o7Qxe2WlcnLlzizC5/AcbJg1+Xtk851FVbwFlSaXUQOQIEiM2r1YwaqlcRSu 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: roaUkf2m3pmWVQD1uhEAO9QW9nskEFMyNZjEzObRKeTG4tm1XpJaSa9mSq12beUTfMoIIGHSErFzO0iOWEMlz+NXMGZM089QVme/aE2gN7GEdrP4yNoi24A2XkZH86P+ur3YaVLCCrqYR6PVshywvASV7lQOL3xbmKzCog+9JScmbCXcyc7QHwdl8Tz8TZjiatW8nqntb630JVT3m9KUtqTmk60Lo5VWvItl3ZCCEb3AKKTK+DoeGqYnfRoU6A0t5IOFadFfy00HlFLeGRxxOsCyBC7+MkR6JJ6t3q2eXlEFtR9kC4GBDzgd3s9YSFvDLJDly8VNBntFAjinJW+AhtIjukY6snJFySGSIQhoWB9PZnwcTEeM5hUYzb+37K1rdlSMD2SnKNj/t78lqZ+qB01gSzZHebyfDDjW8VG4O8mXXrI7LrhI8HcM9KkmWpe8ZDIXO7SEkiIGlCFyrRnlXoK+90WN2H4M8uo9wBUW1XhajSuWUUAukUOKNTqounsiCcFZyxN+KU/eCOlrH/ksr3FBLrHdkuYghd0oqSUxHDiBfg4UsU2jyQlvpJsoXj8fBlUJ9kQxA086uWbqoIfEaALiKOlQmPWITuA/yAhgK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6gSq15/9uSUzKzNcUJM2xoibIVCn4hwJm7uyj8ikR/PK68SWcExGeqJE3JwT+5k/tZG6B9RArakmJXoesjhVsjPSq7eua5fU7b+fN46BXHoslubr7Gx6gaNWlDCW3/1Px9n+gPHKoD1G7z/8SMZlg0RyZnol948hAyRPJyobRtWM6AnTx5O/Enq/S52/9YejtKjm3TzFvZvoP/f2x5fVZzOUJLko8K66cHRZDSUuBt/Fl94HZXjwbCQkQjGvpYMZnW3MYMnHcT9NtRna6azuyPbHhTT8xwqhUkdtgJw1lKgT8bdGmHFiV1JmWaM+Lis5mEhDKL54tJ0tcFwr+mEb/jfkrlansNwONK8Pdvbyo8YOjxlRU2wvd5gUZ8TSMDKJUu4Dtxkx4bdfQ6kvL29hPgu19U/nF4azRaKf1gABJsw7q9fCQ2aD9nvU6Zcw4ixFBD8pBKIjEMnaDeVNtclfifzMt/aXjdNsE9Mk+bFi5JmgvQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c09bc759-dae1-4d26-4eb9-08dbdfdcd929 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:43.3736 (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: +Z0uWXWVsnEgWk/5dwKtwF/8FTnjONOvtLioY+LuteWR4rFbgq+X7oBNNCPCuCoEqSxplGjE+KMPBIscNv/VF5u3TCPitdIQcSXblhpRhZ8= 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 bulkscore=0 mlxlogscore=878 mlxscore=0 adultscore=0 phishscore=0 suspectscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311070182 X-Proofpoint-GUID: sp2nYV2JAZuCrmu3aqRNJ9yTKinzfDI- X-Proofpoint-ORIG-GUID: sp2nYV2JAZuCrmu3aqRNJ9yTKinzfDI- X-Rspamd-Queue-Id: 46C87C0023 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ea5ahr43nq89omhsp696csweryeceo59 X-HE-Tag: 1699394409-692662 X-HE-Meta: U2FsdGVkX18Tsvaqp3gt7gQGLYHdm+b2PamkltahqkggDu5Q7aWd9z6MlU/HjXKeTOJ7dfyTFUIUSdNdS1iTNrFEDbjINMHfn60xN2DMyWq6B+GCNaaZZMb07XAHMVvz2LsOLcFNB33A40XgWcqPt8IahPqbyHPb2oHO+KepfHJedny4h3ATHQ08TsuHuNJTXcE85Uasp776XzijOfdsyR0kgeyPs8kw+fZENwv/1g03LDa0pnMDOzAwE+wZHmnYWwavNnlyimO88faWaKy/OP906oDl3UzB64IkibPDpt/fv/5kBgUkuECYEesDf/j3iGYSc/18YHCajX/v3Btl7NIw79wMBGRMwhCTdoCZCtZDw6NYOJS26f7Ek7HMO3f/oKbBuNMyUhKlgWFRawkR/4vnHb9n2LJQI+dQ4LzrDdkuPPe1uHTZgMt4OjMNlORYvmwcMuh9PzCfZHMz0G9XEzjSkZsMBnejKDbMmvrWX0edoqldc9kWRBVOE2QBJ0YWFvv3TbMMdQ5XqlKueU+oTQGMs6ZjsvrdoTFz/FnCLS2/qGE1l7J/EJUOc/Ce5dz0cpfSObq5ldcp50nbI0cTaWuwUOxbbVLK+VOt1MJv083u1orzmoQ8UuCVy6IgTwUzTy4EW0UOv0n9A3Dvo+lM6j1ROa9bpPRnNTDP+Sc+xMw7GpWu6uUhZ6Mp8OumndgyFERwl6kOCyX85exBfz0fpxTATkxOS8CUINWk1U3zMdpXMy326zCpKKGcz7CGqVFnL7bX8WODkEl6wmR6vAcEXsSYndrAbt2fHNyJoludKDk+gkfuUjn+liY6JdekwFHtoAgEB7qxWRMAbUOXZo+xjoO8JVvpjN0HmjC9+Z6wVEmdCUmNTudcIfmJwEjvupA5cfH2wpq9Bs+EwNtlfbjIHXy+/pf7rvovLkDYth1rsNCcl4l6GcN4hz4WlD/lkEqoi6Gnpko3eXVbssXBdm+ J70H5iCG GFyXUMLgQvCsB7ucaAL3+aGZ34hWFLVIuDA2vVCHXWLmkyF2zYfYxu7g+4tITgIQ/M6l9oLQWRRGnnJreQJSRIe6RXSugLMHMZr91YzgkgYHT4V7qmCgHX1mkPvwDiBXDvoNyED31eY8Ec41MKhhSWC2FdDvjTUnXe5slFUBUiivf7bllGFnUdMxJml6HoH9oDkExZndlExDjx6MjxYkSjlVsOTvl4fS19blMwVjBo53BbC0ztb0lwttd1WZIAB4E2mIlX3afCAznN0nJtD7b+QXoQiY+tlw/HG+OJvbT57t2XXXgImCDMTfvBNKhSXyj2tXpNxIXsBAXDONH05k4njWk96gW+1orEs+2/DTy4wRgV5/e5uPgiQs+p8fTWuesdFvvFZ1NnVpvQBbfWR3ekWGeI5z6n8NoA3yMcK7bQNaYzTFr30anD027VA== 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: To trigger a reschedule on a target runqueue a few things need to happen first: 1. set_tsk_need_resched(target_rq->curr, RESCHED_eager) 2. ensure that the target CPU sees the need-resched bit 3. preempt_fold_need_resched() Most of this is done via some combination of: resched_curr(), set_nr_if_polling(), and set_nr_and_not_polling(). Update the last two to also handle TIF_NEED_RESCHED_LAZY. One thing to note is that TIF_NEED_RESCHED_LAZY has run to completion semantics, so unlike TIF_NEED_RESCHED, we don't need to ensure that the caller sees it, and of course there is no preempt folding. Originally-by: Thomas Gleixner Signed-off-by: Ankur Arora --- kernel/sched/core.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index e2215c417323..01df5ac2982c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -892,14 +892,15 @@ static inline void hrtick_rq_init(struct rq *rq) #if defined(CONFIG_SMP) && defined(TIF_POLLING_NRFLAG) /* - * Atomically set TIF_NEED_RESCHED and test for TIF_POLLING_NRFLAG, + * Atomically set TIF_NEED_RESCHED[_LAZY] and test for TIF_POLLING_NRFLAG, * this avoids any races wrt polling state changes and thereby avoids * spurious IPIs. */ -static inline bool set_nr_and_not_polling(struct task_struct *p) +static inline bool set_nr_and_not_polling(struct task_struct *p, resched_t rs) { struct thread_info *ti = task_thread_info(p); - return !(fetch_or(&ti->flags, _TIF_NEED_RESCHED) & _TIF_POLLING_NRFLAG); + + return !(fetch_or(&ti->flags, _tif_resched(rs)) & _TIF_POLLING_NRFLAG); } /* @@ -916,7 +917,7 @@ static bool set_nr_if_polling(struct task_struct *p) for (;;) { if (!(val & _TIF_POLLING_NRFLAG)) return false; - if (val & _TIF_NEED_RESCHED) + if (val & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)) return true; if (try_cmpxchg(&ti->flags, &val, val | _TIF_NEED_RESCHED)) break; @@ -925,9 +926,9 @@ static bool set_nr_if_polling(struct task_struct *p) } #else -static inline bool set_nr_and_not_polling(struct task_struct *p) +static inline bool set_nr_and_not_polling(struct task_struct *p, resched_t rs) { - set_tsk_need_resched(p, RESCHED_eager); + set_tsk_need_resched(p, rs); return true; } @@ -1050,7 +1051,7 @@ void resched_curr(struct rq *rq) return; } - if (set_nr_and_not_polling(curr)) + if (set_nr_and_not_polling(curr, RESCHED_eager)) smp_send_reschedule(cpu); else trace_sched_wake_idle_without_ipi(cpu); @@ -1126,7 +1127,7 @@ static void wake_up_idle_cpu(int cpu) if (cpu == smp_processor_id()) return; - if (set_nr_and_not_polling(rq->idle)) + if (set_nr_and_not_polling(rq->idle, RESCHED_eager)) smp_send_reschedule(cpu); else trace_sched_wake_idle_without_ipi(cpu);