From patchwork Wed Aug 30 18:49:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13370633 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 D2A02C83F01 for ; Wed, 30 Aug 2023 18:50:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D14CD440179; Wed, 30 Aug 2023 14:50:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C9D31440178; Wed, 30 Aug 2023 14:50:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 990A3440179; Wed, 30 Aug 2023 14:50:40 -0400 (EDT) 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 844D4440178 for ; Wed, 30 Aug 2023 14:50:40 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 4B874A039A for ; Wed, 30 Aug 2023 18:50:40 +0000 (UTC) X-FDA: 81181662240.30.3E36C7B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf30.hostedemail.com (Postfix) with ESMTP id D0ADF80018 for ; Wed, 30 Aug 2023 18:50:36 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=H2ddvZEB; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=md5Q25oB; spf=pass (imf30.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=1693421437; 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=0CFuIMSxAiAQM8abfHcbcFv68C8S+dyPEtQxUd/f0nY=; b=0LnbEgTUHQmhG6aSP5gWghuuEMtEBAEYQDb7iRjumYpGmvFLb55lMYMRgn9QGgPNCFKNcH n/ctxMORvI9W83UTCrVWI0KhS5H5YdEyMLLZbLcHNYiIYAThvQmTWa2i2wiL/fH6haANZx zZKJu11PEQCshhA3tG79z1Sggz9Ca2c= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1693421437; a=rsa-sha256; cv=pass; b=sbZbPiWuwxr5L+7SR5vmalchRXwAk3fMWBUjfPtu/FPLbdR6PXDqZ7HB5Co34eQ6vU3yKt NMv5oirDQZKe+z1Pq+lSL76tXVnD85Q0P1ljoVEXvocHsWL0dgchVTcZRtqUV5fe60xxIY iPB+SCeh/2ryopM76flo77/67OvsxfM= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=H2ddvZEB; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=md5Q25oB; spf=pass (imf30.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 (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37UInwQp013269; Wed, 30 Aug 2023 18:50:27 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=0CFuIMSxAiAQM8abfHcbcFv68C8S+dyPEtQxUd/f0nY=; b=H2ddvZEBlPaaRycR2QzhBh3qDFaS0XV/Veq8js5sITuJtXFJMv+tLR1Q4X1b0F1JxR0k XQi6T/Xz6daqY3Ypk7CGPrtx2byRBOPShj+6F/gXQX0jVHVB4tbirlMdFBWxyhB1ded9 4iSLNBKOBJf07szxbD3cqIbqtB25relhYXSfNNgVePpG+uQFP2/fOOjmrUrQoyLxBmON JsZPhSXHga0GohX1OnVT+SnFRMlmzYks6tL9/styKKb8JKlNpYFIhu6Bgu5FcpBRqkAg A5/9ghV+ZNZaGGq1rWB3fwB1OSXfFq6kSJtay35Nud6a0ZKDBDyduNkfMzdv+3yoi1xr rA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3sq9mcr5a3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Aug 2023 18:50:26 +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 37UInd6m014527; Wed, 30 Aug 2023 18:50:25 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2042.outbound.protection.outlook.com [104.47.66.42]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3sr6hpx511-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Aug 2023 18:50:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KmyRVgTje48hquCSTrT9yJY3SQkDIayafsStvK/cn70EY89gcQpoQ3Qextl2EzLGC3bzdXvY95yBKRrGmgFKZiRIYaYBAG4evVnEGX1plSx+joGl5d73mrQHOcZURkj0Xh2Guyt5gW4ZLo7dGfin8Dgl0KUyG1vL4Ki3BGEBF3+dZO1pGH7CGfeT+wsp27qnyM7+I05I0KvxlL3h9BCcgdg/QZwhzlejK8twrMZgaIgRLLISPNyenn1dBYJfJ7VrdHuq+5tStWgmOaQ/xZoX/YQQ5Qfa/z+J2zt0yZfKojOcsaQ0/m/OD6KpoFx9EfBJhFLj/BDHc8rYPkg5kqCD7Q== 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=0CFuIMSxAiAQM8abfHcbcFv68C8S+dyPEtQxUd/f0nY=; b=b6KKsV/ITFpnMG4lwCd4Ie2+4FwtaX6Qf+Du/0Zea9qxHtvFIrHgV4abON7w11PBJiUPT+NdgsLeQGOKmXhMH/IccpArqS2gmWcWIRPQ3rt3smXYkJiuKuXPKRrzWKwMAXQCXL8SmmLpGWKUkhOxpGNhhmdcQXZvQN6vqfOxhUdShieZaiOIHMaj/xVsLO03dqRogsdlNJEZFPdCZecDvR89Ly/WWQ2DXl6jj8il4P0QoKUtcHgj81OtYLuQn+sFeSHv1QeQ7D1zwaw1a2+7LlKBfhH4GVnNJa1me1AkKwCKVF48o+rr2mSm1El9RjLe/JiVBesFOGYnBD+GvFS+Yw== 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=0CFuIMSxAiAQM8abfHcbcFv68C8S+dyPEtQxUd/f0nY=; b=md5Q25oBZoE75he6N18CNHPj01scRLe9cOwxe/nE/Itipe54yN0TY91U+sDn/X+TjFKSX4iqS6xgeIK3zfXMffU8/klbHv2l+1bkx/waEYAmpmZ6TnSTXXXpGGcDjwtp8JFpxbZ3BNub+zSn/dYpLjT1IbK4ZAdn8H8QCYEKTbA= 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:23 +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:23 +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 , Linus Torvalds Subject: [PATCH v2 7/9] sched: define TIF_ALLOW_RESCHED Date: Wed, 30 Aug 2023 11:49:56 -0700 Message-Id: <20230830184958.2333078-8-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: MW4PR04CA0373.namprd04.prod.outlook.com (2603:10b6:303:81::18) 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: 40b8e4c2-af52-44f7-7b46-08dba989f745 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lRl70Qk1TFTOZnxYSHzq7yJ+IdJYBeBcEtMPBK6AssB5D53UsG2GFV1MSKuCyAal6BC8F1YUxMP4VBgnno/Do5tozGABGw49zqK67ApigMH7VOUc5QY+xpfLC/2TLMsDNbQPMfh2hBoVf34xSH1CBjY5GPPV0ahO8RvtRbwNyJcEmrxO1E4OmrrYo1bmc/K1I9Zj2T0rcRfm7j+2OiYt2/QQUZHFNMppIu+4FqXWZJ9633eYXFC4LZxxaTnBpasIZoWiW01PWFndtk1hO5dIMQy6886xC9zIAnkMyRCC8/W4yYmBDS7T20RIT5ryPRu9KtVdf21qxNKhOe1r+CRyjFckD+Vai9DcVeMW38VWgmAAQudJK4pg5JIli0vSyvMUI9rukI4p1y3zr6LUx/5eyvMV85js1x44/70dV072hVp2C5MiAt1hFBi48c9+4BOQCdBTs6BWVHhBXgDdgQuqUTB2x5vYnzZiU0PTeOZZB5Upk/G0B9YHbtlHXutNyNh339MHFJPzSsVPCtbJpV/3omFdUq8zpfzcLkVHSZmblTCNb1vBevLe63s1futzZwj7 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)(54906003)(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: nmdBHd6KbfrGvPQSPYgi6HsVB3YEwN84lduLRI9ClA/+PkzFzsGcsGjtucJAAqg13I1xCg5VR5t9hpd2LoD1eOJm5qykKAuB2kdpIv/yWINT+8e/PkrPMhc91C3zR0vQHg4zwy01VjG2DDAAIil8QFrxRhX4CtTfQiPCWOzZ681W5cIF3E9HTJEPO8heb/D65T+Xvyag0LNni7sc8nU5UkFDZReL4lL29ykz7LHEqXgjvKPfkUrUjadm5J9yt7fF7ZThpWy4nwol+m6JaXpepLVZORGIdcnUEdFUkSma9t7SFlsWxdA7zWV96wPPmNBjak0JtyR+zy5DzZEPbe4LKll+sYaumqbQ0idXlBpfS7l0o/Il4KiLk8b9Jy4DHEiftxz0/8BPXpg9e4hHiRekCixCb987ygGdnmdfbm3mZHq2tpRBGO+geZitjTD5HfnLA1rmJjeC9cmfbnSja4pH47bpKQQaldtu0UFNkrmPHl+ibGBIRdT4dqW1s/XK0rmH9aZtHqL+oTDN/SgHecxno2g3ieFCw6Sv6YAYazIxYIEQVbBMTWTHYa45/YTWfUthscHGQnnujD83n1uK3I0uv8TDf1gYCGWSyQ6vSVj44jbLAFtVW/kUKcsk8qz10dL6APokMPPtAOFznNR9rZSjJzu0AfXsHXXOj8VdMz+Cho8lzM/JDARS7fDR425rMRbNPqdZUtO3b9HeR63265FpZn9uGZ8Rjguu4x3Z6fJdyK9H3BN1zdCp1NGAfaLH/Yf5NwmvaUdHyvJ6oKFZBPx1JROTfn8J2LIoAfi1DuefrWee6q4hLYQOHjU+8t0Oxs1HCYjGVqCaCf1/aGfGVNv+DP6CsAMwP+Vmku+4LSo6a74IQy4slYKRJhRlKyGjKFPcLMK7I3EkqbYyFXac0MXw7bWvXjLoqC7h1vbYWuOU+smzEgyWG0rAldQZQwL2xFQp539OIVeIG3DlMBX4CPYtg+VuA7cPJi1SjdQgYVfbzzPcbNwtrOSIiN9Gl9Kf62QM+HNmB9R0N5WOg2lcmqHrgQIdH1R3NpFKI2pp7g+3lQosuHacxr9zBcLt0tNgwtTO9FL2Qpns8FTCNYg/QSLSj5sMp7khTFkb7eYKN5eYNb6K45KBda773jNeLASlh2DiR13G4jiTiqQEJGFbE9hHLPb4eu+8idLC1M1grJ6A4r4SqThztmLYlc0y29+643yTHkBICMrxGRvulkHM4pfapMWrWBqUoEEqPveAXjNnHvesRekaGq4mZZfjuMNkvbt/lY1mklMZ39WaVogBsBtQTJY5qT1081YOOerIMqDxsqeq9VyP5SMSA3dFrGdBIvhVgFAaoJDGmtu/njv6BL0Z9UpTDSAkb5nbOk/R2JOqHDxH7wPx9t/pVcFV0SH+U+0BPVtlEoNEkPpNNQ9y4msPjbJbNFyOPdy3pd5yLRIs9uajx+UzCkxun6owTBWYzj98I5nC9dxrCyI4Jte/1s0+OQFqIblKJx0FyaBSuW0c7+APIMh84L8LPSUVoT+3n0XPEm3Fo4TbYbkzEGz00Cvv1kv/PfhI1Ne1g6ktSeATCztN3i95NUA/jQoLapLopkfbagiziSjWtbTCkiDJXFpBMw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: kg6rMERIKfjGlwQm52+bAhJ6uapRFWZ8SL3ULoO1xyHhMtj3WFldD7kBxGHlrh7f3d0C/oqPQv8EF46A73CY15xvXNjZRlq+amSGWCQ+srIy6kimGLNQpEMHfIUxaDm3cnRbbqK7CseR5XvVBECOi0ijVsd6PtDlmRt1vuxXnzdcxeLtE842B9sBMPgiQW63aTiIsfdQSX3/YTDJavkYwLgcKusxFjloTlCv7WDxbbi+yHla9x1LI8BYLoAcYxbcDKaSZLCwFh/oqEK9rikAU6ERHNaN8l5B44ZJeP4B3bfuI2XC5li0PNmFcJJSF+glmKfwFcbIig9JbFlQIRAkGF/8qZsQH43/el7CD29+J6vsHTfRILob4Ze6d7Yq6J7CCe4uY+4NZFtVamWxUxpmLTF0mKRrcaJVAGEtP5goSvKQiYB4RwGtgGPA6gBYl6wXplMGTYHVLIWkoptlgP2p1H1Bo72oXxneP6eIs+BqkgOm/ANede1LB7OGNUhsSEzOZ5+z+/rD+1De8KCKPshTI+1C3E8DJ3rQnkEVYgnztEccKi7yLtJs/giD4f7n56bXzt4SB4zlHy0dwBTYsfpM22tAMjMIHbwlnoA8TGgnTFq3T7RXWUoeIqP0mH3hKO+hfpr80KXAXRxTJPcREGf1H7KYVpTXuJ+3kmUc2fYYs4g/f3iVC+5xfqzzpzxRstPKdrHDdphUW4uU1s0eZaNLhCypE/QV4GYz+NcoVeWP030TJQj8UAE1R6+pLC0tU+pUV9BAxpXejaUzHyd1xo1XzccWyqBnCbU0ukraQVChZiwbQnfEHRw6CmO2tHHmsybjXSrdQzeHNf/36vEvOsKHkjEpMUjltoQ+QsDomSutUD3gwYbr7y+CXbWIavDzYqZsoXXXo0OGd9OeG24X8iT4jwgB3X2QqrpwARKxuWujmBdyvhWof2SNpc4/XVpyPLlTnHx7qulbHH+xZaxRxq4hSqOMw9qKJh246Gr+xxcc67I1YC5PvfjoEb4hp9ft4yrcvGoRt+cU8XANFW5cvpsVBqKqi2QUFHWrJMQDx5JzgO488RwOREi6qhASDJJkGi/O+4Ssv1CuOm5Pm18MkMZDm7kip8tAAIxnMxGu8qEIJLY7mENv3POGJAkhh1WHShmqXzAWJWAca0Ykczvj5a7twqt+dLS2BbAJZhXw26WCbZQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40b8e4c2-af52-44f7-7b46-08dba989f745 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:23.0004 (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: UiA87hyir+IIf3x+gRxj3JGnMFruFf/KE7nHJNJZqoHhYusqt/gmozUg9wtnurEkc5CnjNXBYnCuU5mkrwC5VASwSoX+slkEb5Ei1u5uxtM= 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 spamscore=0 adultscore=0 malwarescore=0 bulkscore=0 mlxlogscore=997 mlxscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2308300170 X-Proofpoint-ORIG-GUID: J0hZYB6_6RDZYMCLXaArRS4EvQSaBzX9 X-Proofpoint-GUID: J0hZYB6_6RDZYMCLXaArRS4EvQSaBzX9 X-Rspamd-Queue-Id: D0ADF80018 X-Rspam-User: X-Stat-Signature: tbacm57d4yxtu6kn9xh6zggh45ghegnr X-Rspamd-Server: rspam03 X-HE-Tag: 1693421436-509262 X-HE-Meta: U2FsdGVkX1/qY7+UykHxhRQpfBtk5SnzFKV/4HMltnCyaaFkgvwomEPMIkqXTn6gwvHzPnCw3g8hTb84ircwqpN/JII3yBvVakPT2UXVqy+aSYpJXjigMN4sh5yr/1B1qYhBkjnuYe4M8zwqOgoaeR91Mynqdf8sgJvTYoT7HuM5vtUbN7ObwDl/NQFuOxuFDzM0AxiUFGGPdRr25Uu12r5usYrEBEJe4rijzCKPNQs/Am3QN1mSGzMjjrYhp38h4jkRBSUKENMKG9C0A3H9qY7cWXL1eKiDrNSYM7QtaWPuO8F7SK3Ez74Tm4rfUtmuYrRhwWzULWMaU6bCZhLeN8F7TRsS7hQ+ffnzt6/zv+qLBSLt0/gHI1aEwk8vlATdr84XsSJDeGG51HHQDWdyQt5MBlIR/LHYR7bQeWtnKc6HmrBlvY58vDiqk3kUZEWo4J+1SnSKSigvnCM6XnP3J/0cHf7ibd0jFoIjwbGIESZkoaT9DoPhcPAb3KEq8tRLa2w9N2DU+SCnQg7HV4RtzdW5CPMJ61lyYwJDoIu6aVVjbL2UBuhQpsRBcXVpsaG1swgm8G4qWveq8kFJ2JG01xoZObeuKKlJQNSnQkMFngduzup0VJHbtrm7PgjrujQwZqascFms0sBd8oyAvAJqsdCgJzpgCxVZNrsHcQ170gv+GDjb4xBVxiMT7q9r2iXyj3+nMV9KQvYedvUC4X6WswhnCIvmCLW/WdlbBhRMkD4tXUz6QRNIDw0fV7CFGuzuvGm/z0Xi8cjGVNUFZJgILSiA0gFbD+4k7cnt1J6e6Dw90RaJ6HuVIkWFFMsy3Jy7ZJX5sUhWatob/T7l4YGzHOZJKk83XQbZxLJUgf9CEoCjKx8QLJw/tu2Xw7qGjGxCmsM6ABDlEGFUY1pt+YuJqzh4jYK3ZFynGUhJW7JyFykjQDStYDyN3AQMz6/K11y6mM34vp0AoyUXoqpZK5T gRYWg3GP yq80xQYNzPVm+GNuXLNIY1WmKPwI6OrQRNrkc/LzhYrV9vrtNJStjgt2QFHmRR9Na5q+Jfn+gA+2LayiKHvnSuUnzWl6enjuzoB2UtBE8CYciu3V2R/JaLeGPd155YYZQg03OgsZySStWw87f8ptwiZINa+T6n3b1q/32vxiMfGEkXJmLDtnKOPhxdiyhIYGV8idOArYTTD+pWiW0gAZLfN7+TrxvWwY53VJtxvOxMw0M8WvN9FkTQ+1+/YFCujH6pPqN2YvGgdYhDdoGAEIHPcZyHq9AoDfTDianVPxFKanI6QYnknvHEt1FjwE1Jd3XCfN1Hu1NfGMqCMOLG783YTgOa/Q6J7sg5BELth/U8HQ5TAAHbF9vBE/QUYlXSVdLRXTDtwdAq3MMVqHtpobyjoyja8tTYyeduGf+RzhqS66MXr4YWt8mRDyN6P3q99OoCHaX3Lp93GSJPklw8Nb272ijng0Tc2g06zgvvl2AP0SP+/SKzHAsczI3GAIxv6NmHtUDQZbqV6o/D5/7KlbWZQWPe0Uqr2Pea7vGc55iyoJk+5Gqf5nq75uaLpsKMVMToGvi8SmeBlouTF8OGwRpbLFjslErsZSc5FTbuGksmPcg+XE= 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: On preempt_model_none() or preempt_model_voluntary() configurations rescheduling of kernel threads happens only when they allow it, and only at explicit preemption points, via calls to cond_resched() or similar. That leaves out contexts where it is not convenient to periodically call cond_resched() -- for instance when executing a potentially long running primitive (such as REP; STOSB.) This means that we either suffer high scheduling latency or avoid certain constructs. Define TIF_ALLOW_RESCHED to demarcate such sections. Suggested-by: Linus Torvalds Signed-off-by: Ankur Arora --- arch/x86/include/asm/thread_info.h | 2 ++ include/linux/sched.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index d63b02940747..fc6f4121b412 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -100,6 +100,7 @@ struct thread_info { #define TIF_BLOCKSTEP 25 /* set when we want DEBUGCTLMSR_BTF */ #define TIF_LAZY_MMU_UPDATES 27 /* task is updating the mmu lazily */ #define TIF_ADDR32 29 /* 32-bit address space on 64 bits */ +#define TIF_RESCHED_ALLOW 30 /* reschedule if needed */ #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) @@ -122,6 +123,7 @@ struct thread_info { #define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP) #define _TIF_LAZY_MMU_UPDATES (1 << TIF_LAZY_MMU_UPDATES) #define _TIF_ADDR32 (1 << TIF_ADDR32) +#define _TIF_RESCHED_ALLOW (1 << TIF_RESCHED_ALLOW) /* flags to check in __switch_to() */ #define _TIF_WORK_CTXSW_BASE \ diff --git a/include/linux/sched.h b/include/linux/sched.h index 177b3f3676ef..4dd3d91d990f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2245,6 +2245,36 @@ static __always_inline bool need_resched(void) return unlikely(tif_need_resched()); } +#ifdef TIF_RESCHED_ALLOW +/* + * allow_resched() .. disallow_resched() demarcate a preemptible section. + * + * Used around primitives where it might not be convenient to periodically + * call cond_resched(). + */ +static inline void allow_resched(void) +{ + might_sleep(); + set_tsk_thread_flag(current, TIF_RESCHED_ALLOW); +} + +static inline void disallow_resched(void) +{ + clear_tsk_thread_flag(current, TIF_RESCHED_ALLOW); +} + +static __always_inline bool resched_allowed(void) +{ + return unlikely(test_tsk_thread_flag(current, TIF_RESCHED_ALLOW)); +} + +#else +static __always_inline bool resched_allowed(void) +{ + return false; +} +#endif /* TIF_RESCHED_ALLOW */ + /* * Wrappers for p->thread_info->cpu access. No-op on UP. */