Message ID | 20230403052233.1880567-9-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:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2084220vqo; Sun, 2 Apr 2023 22:55:09 -0700 (PDT) X-Google-Smtp-Source: AKy350bV5Xuf/gE3n9cwI8XVpEgGKOrnpTAd3t0tvDBya4Ha1C7MxXtFmlXMm8NGMuDxjMg+l/XK X-Received: by 2002:aa7:c989:0:b0:502:243b:26f8 with SMTP id c9-20020aa7c989000000b00502243b26f8mr32038127edt.8.1680501309183; Sun, 02 Apr 2023 22:55:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680501309; cv=pass; d=google.com; s=arc-20160816; b=xk7LHoYmPHXgzGpKV+QBCfmEWoeY6tqBXugyMCmq+ZFStvhMixHkVKBt6UL6UiN9Cz MMUw9NJCymoe6B8Of9eBEla+eHI+pHMps2sNH3FfvZHLJjsA8Al4tPR/V+HDKbXenEFd r+xXu3cvaUfLvYBLVE4JUQapp3hmRFB3yZisdFU6Bj2d6V7MdzP6odD+rJ4KrHq/dQTo MgzmS9T7SByG6YZ968831mikCRMF/TH4ZG7PvqGXVaEw1m1j2ngaLBssBC9VPFjF65wI oQFd5loWpqu0iFruCowI9d2aMVnREPFW43kb7zWyNZIKaVF8KcyXkBruRRGuZ6+AdiA/ AKTg== 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=ZJIcErO6gCpLr53xeyAlFo9Dh6PeuItoHvFCmPpopeE=; b=Ui22pv6FygHnad51SH2HezEdsY5UCbofa7a30V/Bgais+m5iC3AHWhnVmtIfNd0zVe aO3mPvQxND+i+1tDkROWwTqHVX8DOk82Gj1zH/xNiQmgXQtpyafsg14b3Gb8xcN6k+90 wTVGW2y+2hoxMreTQZrqoSPR17F/rnI87rgiQVB4PL8YfjO2qnFKEnmWMPgeUQleT4P+ p5c++TxfwILyPkUWSUXWrPMewmpzvzGMZ+QoAKMI3Ps1I4TC19U8vkkbYhLAWYtMnFfD hOBYF1+TeC4AD2iDiVa+DUYLuND1KoXeyprC5yK84FuHE6axdoBCWva666LuMRgbNu9v CZgw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=yq99iavo; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=oeU9coHO; 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::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca21-20020aa7cd75000000b004aad91c6589si3770926edb.193.2023.04.02.22.54.44; Sun, 02 Apr 2023 22:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=yq99iavo; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=oeU9coHO; 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::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231364AbjDCFYB (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Mon, 3 Apr 2023 01:24:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231530AbjDCFXf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 3 Apr 2023 01:23:35 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43B3E19A9 for <linux-kernel@vger.kernel.org>; Sun, 2 Apr 2023 22:23:15 -0700 (PDT) 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 332MwUaj024750; Mon, 3 Apr 2023 05:22:56 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-2022-7-12; bh=ZJIcErO6gCpLr53xeyAlFo9Dh6PeuItoHvFCmPpopeE=; b=yq99iavokHx7dDj/ZMnuuCRoekfZAZl5KaNeqSlK04pxvsWqQEpkSwpc1RyYEgxtWazh Gsk6VAIjRbXsQsJvEZsBrs3oX3QqLbZ2SPxiisC8ksJVzMZVLdj58OiuSPV0AcyG/xJ8 rqB3jyVZg6gclK9PgSQCa9LOGwiC8Y8LUsYRcuzBZaKlpJKb1VOnJlK8b0hDRZLJaIGA OitEEg/3grDjfXy7YcCVOoIjOdJUjdgIm9O/Je7YwyqIi2UUoDjfmpxtgXPhcAIAGamf HbVqFcet6GodoGhyvmgvGTSjVmrrXUX6hKAdLlMKnafPhuwmDjRmCsZYNvtoHZNimaae 7w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ppc7tt446-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Apr 2023 05:22:56 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3332iZTr038319; Mon, 3 Apr 2023 05:22:55 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2105.outbound.protection.outlook.com [104.47.55.105]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3pptjptnpk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Apr 2023 05:22:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E3Fk8fHQFXbxUx4L75SPpKVNndtsTtMxpzFepb+u/SyfuZRHRuwZXA7348ZJc2ayXY4grV+WTTynN0Sj4XYwi3sUPK9ZD4pzVCX6s2T6AU7UdRJ5g70rX76EzB3deevgEXX1Y+dxPXHXv8mkF4KhzIC3cguMUrE2CeBI6WLIuOo7iBqWHTkVJxQaEGiayAkvL2z+/xhQnGcqzZf5fjUYl0m1a4CJQ2gvrZeZd1rdhSIZmqN/w0MUdZWAWFvXBKlQPXpE6PCkpt9mks9cgkcOoExZUpvmImin60rFapctfnfZ5hjZjoHggN7OYEv3JA7cEtPnZ8kBuzx+R8TtgfsAOQ== 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=ZJIcErO6gCpLr53xeyAlFo9Dh6PeuItoHvFCmPpopeE=; b=GYFfn4lWX/o6HACFvYBHIa6oyUp7J85S9A3QB5ybIBWriZiTwRivris9+CAD5QpEVXkXs+nF2CUhCalO0RdtUC7kdsy2lOCUFVB0goFe2CLjSGeaX5uDHAhTmc/8DpXHx8JOols44WpXEbouSu/1dSQsfmuyITMRhEWmA/jJ62qF82c18YpjkYeC2zt8FzkyMJTXdr3zT2uuy3PbOpd+7nCmbemZm62CJ5SXvEbCCDWiGjo0ZwaK1YIDkG6iJnZ/dipOsm/obuQTIqDjdXZQO77/8TMUJlcfI/ZD3EllKQPvM8AzLulCrmD9g2Rfh4eAaqWEIHBYkr79Okk1e0tPbg== 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=ZJIcErO6gCpLr53xeyAlFo9Dh6PeuItoHvFCmPpopeE=; b=oeU9coHOBgncybcyMmLuFEfDVxbWPi66XZWaOd/VM2sTKXVYT0B4NEQWTwpLvhaMMzT8CXY/COf8sInHJ24ll0CH5yYH/COMqcLNBBWT4r+Zrbw397BI1VHK3r3qrS4dFF/BcM8IQKy3xB8MD75L0wCT0j9uM6zAVVTfH6hIcHI= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SA1PR10MB6365.namprd10.prod.outlook.com (2603:10b6:806:255::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Mon, 3 Apr 2023 05:22:48 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::986d:1a90:f60a:53b6]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::986d:1a90:f60a:53b6%8]) with mapi id 15.20.6254.029; Mon, 3 Apr 2023 05:22:47 +0000 From: Ankur Arora <ankur.a.arora@oracle.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Cc: torvalds@linux-foundation.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, willy@infradead.org, mgorman@suse.de, peterz@infradead.org, rostedt@goodmis.org, tglx@linutronix.de, vincent.guittot@linaro.org, jon.grimm@amd.com, bharata@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, ankur.a.arora@oracle.com Subject: [PATCH 8/9] irqentry: define irqentry_exit_allow_resched() Date: Sun, 2 Apr 2023 22:22:32 -0700 Message-Id: <20230403052233.1880567-9-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230403052233.1880567-1-ankur.a.arora@oracle.com> References: <20230403052233.1880567-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR03CA0078.namprd03.prod.outlook.com (2603:10b6:303:b6::23) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|SA1PR10MB6365:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bae760d-8984-4fbf-13ef-08db34037643 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /JMEgRLdVtjfsAbqIduYdVtaKETVJDnsWFbwxXSnLwTHw4Yb9b8Y5huwV6UPRr8sSAwGlLLN2IdBDFqxJ7tZkqTna5OlDEkJHe0vl7anwNP2EV1gxtPGt9ywVb30esqGvOAt/Nj/AMpIWY2FTtrRUhyFTBpaAIXqtbRnH+ErC0dajgKPDAK6ED6J8LSWdAwEaYOiSNpj+FFxVNo2XMuxfBEIO7OLFhJAmXxaBCUc5THRjQHI6BNRKHRnsE3PuXLk8ZO1+0Jr/HMzPhO9FcRyn5fnDKJ/Q6o1WDFVBCusNGfY8EmY/gI27codm129pJV0jzx88rSgCCgQhe99CwI13yW3Nvi3LZOB58PIhXHYL+9NMKoTCa+IX6ShBMc12pPjI12xflIMSvl93fA9+N+sGyAe2Srkh0alfuCH3clTBtqJkQ6kvnQkcFmMYEZpaS7D6f0NQjkzUIaBCuFVOnAjm18Bb5HjKDPdm2KU44XHrchWlIRWK63hQW0b6XexPUlUYo1d7mbx/ii4AsWfoDR4eGrzg0h29rarn3Wf918MLz4uETNmLgas8eVuMxmOG6VI 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:(13230028)(366004)(346002)(136003)(396003)(376002)(39860400002)(451199021)(86362001)(36756003)(103116003)(2906002)(2616005)(83380400001)(186003)(6512007)(6506007)(1076003)(26005)(6486002)(107886003)(6666004)(4326008)(8676002)(66946007)(66556008)(66476007)(41300700001)(5660300002)(7416002)(38100700002)(316002)(478600001)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Aq/HuEd+N7dXNtUvPz7JE4EYv/PgBz8EgC+c9JG9OA57ctbp12SGWCp9Lu2dXGfhRPb0G57ZWij0+Qrb1dIoWUT4/q7MuD8bsbPCzsBQhiJhrTaF79fvvFT5zeBUgTvKDvCYQuxMyx4l7yw2jxullhaHVYJqhV8xZs8GgVjXUxNU+ItWlJXf8eHW7yA9tT3T+8wVqvLNcdFtjcTYbmnmfI3tXo+K/0UqKIM+wA2ZtlDNwqirpbB/yR/RDlSGg367GenXLCo7rD5Vr4+G5NLz3iDMitJYMGndeuG+af8XzMViIC2mC8pEFZ0ojColm2FxHG4gR2lrgdl0n6o5XckhLQ2SEvHhmqgCWbOeb7bLmoR4XOASez4Lp66G9OKuHu60kbEUm2bazWHXaIPuZ5RIoKHD8TFNc2LTkPvXi3fnWIXQ8Nu+D+P8FsVPzJwedOVi/kHsJHuRQvD6es7+jq/4dBcPewO01PJ8RIHD3czOP4D42UHDIvkM6oSj6bGKcYwdo8BdP+7qHM0V1iZLNUilYdGn4vHitf0szzK07yUojt0UifoAd4yFKUwUEU/dm9jyr0oWH09a4M6LPeQL6cEoOtO5JU7V7egCWX243h2AT8qJWnkSlqYR2RMs5b5bx7nDiJYzpmW4kSMKKSBIC3iSUhJKRJGw3yCeJtHidZHBT8Rq5KTH/5N3dfH98R3EW94tgpVdiPMnrYqABR3zkDUZSVkt8sbUwuCqe6e5TIOgDSXO/I/J7epPO4HAP1xOhKRbIpfGjSNvEgL8uTO4L4Eqt4beHw2LkdpunSQc2F2sLuffIgDD3T7WF3OHqjudSB50oFW/HDzZhbpR33lOOq4BAxAgpZTFSMhBHIRLR2H6FecQhbCFctFfvb6nWvB17O+oy5MtPTJ7W5zffMkZ2LTS6R9p+E+CLkF3t/xtUl4KtYrqNaW0QxGwicZH0yvIJWpy2PBWpCdomOzqns8qd1De975GM8TFsb4u1AktJNOQnLoyKKmHZ/npviHAuPVoOxxZcIDR7vTa9nU+LjbaAXiebwZbVYnc1tzg8OqGjptmmngOcHK0pVU3e8uatkEuBejWMc+FvCDARdqyHEuCKTfcGGrZoJxjE0MG6V3RIY7139eOX67xXru145aHIvOwk1P5FD4iYjbjPuKwaPljGnrwChNO0fUL8sA+gvDkHZSyrvNO2Y4tDiKwWny9wpOsoSFhlogZi0yn0XjiZfsrANt6CLrq6sAX18V7dRY+C21tQU75fPNsLMokIgbhRCickICel1TKsxVdEdx3WjrUk1CPPnR/CgtSHUn6BQiWZIzUIRpVAzbcbw0/fD4oJQN73iwCkDCsFYm1sPkjrInKP+C/WjI4jq7ZVO4QZm79lWvgDeaMXRd43Olz6gNkGi4mOFbNFQZpKrIeY5DYLLWtWyCIJYY2tHvOJcUttgg4hCByoMKKD7CSxwQ5Xent+9EwJdobL6L/iU9QI1HXkjXnv0okKV22DLe1hrt+p8QlXc6ziSO0LQutYGsUXImbwkEpVDO22cQl9aDhj+b6AtUBh6coJXFBZUV0Ub20Hbuy4qhmkneP0sVy5/0qra4pfKwEkgOL X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Cbnia/eFO/wgtFWUA7cTl+DzNH4JwlXTsRuR2KXvyvnnt0dQE++1XfH6ZEV/uN8kNb7CLsKFmptrmLcG8pTYgvQFnmfJdrzarrtCvBVymrrLbHMVXyoN2Y0KAXpd6+SCJubhawJcqg9jyI8z2WGrazBLD2D0jahyIwF2xVrsa5N+ZgG5XjNTdHPY5wpUmjvR3my4u/UgK3nSp/k13wIhvpTPSxWbkUqSouirxIahMY1/sYrvcWL9BmGXkrrlTkuelwr5hXiKGB4rcF16LY8ZRxkvaWZJSstQK9fRb2e79HlkBZ5O0MycnqA9bMt6tGzpcQra0lV5kpKav4/ypKgDLmK1ieQ4+pKEhIPfMSzbL1OXbQtoAYjJgAW97bDcbhCho0U4nclIjN9uwbo/Cju3LpFm5zZxDDsVWhIqwn2Ur4NIF/qk3uiQ1JYfU449EZkzUPQKdfPX3Q/L69NQ8jZ8pxxsDpheEUsdzlARblva8p/rSXYr9e2oSwwZFwwR3HrmecsOJTDwzSMhMbPHRQsPwX92Tbeq25wKh4v/SXxs44SowvUHRDLTBDVV6lTJs6dV5fkWcZf6WEPKnL1P/JTc6/62ArsIR3ypQXrvQZMy1hMPS04o6zHqgRNlZ1Nwb0ZHTA0h+sUEAVh2BeEiUS9NZUx0hdwtjMEYl501cL6NafwLZTivngAMBtQvIfm8hBx2HdjbrXLhxMHYYRjmfjswWhg9IgSdnVLbM8YBH+P242AwbOQdOOoAtaud/iI9wnqkfJkIuOEfVivmqVnMKz1bRPwS6SldOTkY0+lnzLOWPLpssQtOEZzUDPIMb5wkBiH+weR8b1w+Cr5eRElKpCK5CYIC4xzMxvs2s8bfezvsxQd2MACCa37ciHqOdIdJ4vyxTDWJ4zy5toJsKc6wi1i8mR96DKWX8UUdWOD+ZWUvKE4ieR0QPq1mym6fQhGHwIaZd05KGAS6DSd8GgtyruE7HLufinVjrDFyD9qNnJiPnqfX4fnOyPX5hzy1Z03sh7VJnJ8SSVxwfDHggkuoBmM+iOrTMTqk2Fx0ro17oxi5MyU7ZQrK+TYjvSqOASCL/eeW67R8w+CMKgot1hGzZaqr0onuvxOAYeBJEOXUj7umwLTts6xWWJWjdBFmT+q+DiCyW04ejvSJrjzOQmEl4pPRcy55KBS5LhT0rmQgmDicDdg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bae760d-8984-4fbf-13ef-08db34037643 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 05:22:47.8596 (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: tDyBYPmBhG9E/ZhXTWDy8nevhTrDYQ2xwFEfFIflBN0TDmISNcR80y883HbWBEqB1/K9lCEqqji9S+qnPrpEqO6lNqvE6ujFguDmRECddm4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB6365 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-03_02,2023-03-31_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 phishscore=0 bulkscore=0 mlxscore=0 suspectscore=0 spamscore=0 mlxlogscore=879 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304030039 X-Proofpoint-ORIG-GUID: f-a-V6JSgdGnspaNV5qnhzyl8asrVf1g X-Proofpoint-GUID: f-a-V6JSgdGnspaNV5qnhzyl8asrVf1g X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762133340774572507?= X-GMAIL-MSGID: =?utf-8?q?1762133340774572507?= |
Series |
x86/clear_huge_page: multi-page clearing
|
|
Commit Message
Ankur Arora
April 3, 2023, 5:22 a.m. UTC
Allow threads marked TIF_ALLOW_RESCHED to be rescheduled in irqexit.
This is only necessary under !preempt_model_preemptible() for which
we reuse the same logic as irqentry_exit_code_resched().
Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
---
kernel/entry/common.c | 8 ++++++++
kernel/sched/core.c | 36 +++++++++++++++++++++---------------
2 files changed, 29 insertions(+), 15 deletions(-)
Comments
On Sun, Apr 02 2023 at 22:22, Ankur Arora wrote: > Allow threads marked TIF_ALLOW_RESCHED to be rescheduled in irqexit. > > This is only necessary under !preempt_model_preemptible() for which > we reuse the same logic as irqentry_exit_code_resched(). This tells what this patch is doing but completely fails to explain why this is necessary and useful. Thanks, tglx
Thomas Gleixner <tglx@linutronix.de> writes: > On Sun, Apr 02 2023 at 22:22, Ankur Arora wrote: >> Allow threads marked TIF_ALLOW_RESCHED to be rescheduled in irqexit. >> >> This is only necessary under !preempt_model_preemptible() for which >> we reuse the same logic as irqentry_exit_code_resched(). > > This tells what this patch is doing but completely fails to explain why > this is necessary and useful. Thanks. Yeah, it does seem to miss that completely. Needs some massaging, but does something like this clarify it's purpose? On kernels with PREEMPTION_NONE/_VOLUNTARY, rescheduling of kernel tasks happens when they allow it -- for instance by synchronously calling cond_resched() in a long running task. There are cases where it is not convenient to periodically call cond_resched() -- for instance when executing a potentially long running instruction (such as REP STOSB on x86). To handle kernel code sections which can be safely preempted, but cannot explicitly call cond_resched(), allow them to mark themselves TIF_ALLOW_RESCHED. Contexts marked such (via allow_resched()) can be rescheduled in the irqexit path. This is, of course only needed with !preempt_model_preemptible() and the rescheduling logic is functionally same as irqentry_exit_code_resched(). -- ankur
On Sun, Apr 02, 2023 at 10:22:32PM -0700, Ankur Arora wrote: > Allow threads marked TIF_ALLOW_RESCHED to be rescheduled in irqexit. > > This is only necessary under !preempt_model_preemptible() for which > we reuse the same logic as irqentry_exit_code_resched(). > > Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com> > --- > kernel/entry/common.c | 8 ++++++++ > kernel/sched/core.c | 36 +++++++++++++++++++++--------------- > 2 files changed, 29 insertions(+), 15 deletions(-) > > diff --git a/kernel/entry/common.c b/kernel/entry/common.c > index be61332c66b5..f1005595ebe7 100644 > --- a/kernel/entry/common.c > +++ b/kernel/entry/common.c > @@ -390,6 +390,9 @@ void raw_irqentry_exit_cond_resched(void) > preempt_schedule_irq(); > } > } > + > +void irqentry_exit_allow_resched(void) __alias(raw_irqentry_exit_cond_resched); Because typing raw_irqentry_exit_cond_resched() was too much effort? > + > #ifdef CONFIG_PREEMPT_DYNAMIC > #if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) > DEFINE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched); > @@ -431,6 +434,11 @@ noinstr void irqentry_exit(struct pt_regs *regs, irqentry_state_t state) > instrumentation_begin(); > if (IS_ENABLED(CONFIG_PREEMPTION)) > irqentry_exit_cond_resched(); > + /* > + * We care about this clause only in the dynamic !preemptible case. > + */ > + if (unlikely(!preempt_model_preemptible() && resched_allowed())) > + irqentry_exit_allow_resched(); This is wrong, if we have dynamic preemption then we have CONFIG_PREEMPTION and we'll have that irqentry_exit_cond_resched() call. Basically what you've written above is something like: static_call(foo); // raw_foo() when A, NOP if !A if (!A) raw_foo(); And yeah, you've got the extra resched_allowed() thing in there, but that doesn't make it any better -- this is all quite horrible. What you really care about is the CONFIG_PREEMPTION=n case, but that you don't actually handle. > /* Covers both tracing and lockdep */ > trace_hardirqs_on(); > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 0d18c3969f90..11845a91b691 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -8597,28 +8599,32 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); > * SC:preempt_schedule > * SC:preempt_schedule_notrace > * SC:irqentry_exit_cond_resched > + * SC:irqentry_exit_allow_resched > * > * > * 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 <- NOP > + * irqentry_exit_allow_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 <- NOP > + * irqentry_exit_allow_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 > + * irqentry_exit_allow_resched <- NOP > */ This ^ is all complete nonsense.. irqentry_exit_allow_resched() is not a static call. It's an alias of raw_irqentry_exit_cond_resched which circumvents the static call entirely.
Peter Zijlstra <peterz@infradead.org> writes: > On Sun, Apr 02, 2023 at 10:22:32PM -0700, Ankur Arora wrote: >> Allow threads marked TIF_ALLOW_RESCHED to be rescheduled in irqexit. >> >> This is only necessary under !preempt_model_preemptible() for which >> we reuse the same logic as irqentry_exit_code_resched(). >> >> Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com> >> --- >> kernel/entry/common.c | 8 ++++++++ >> kernel/sched/core.c | 36 +++++++++++++++++++++--------------- >> 2 files changed, 29 insertions(+), 15 deletions(-) >> >> diff --git a/kernel/entry/common.c b/kernel/entry/common.c >> index be61332c66b5..f1005595ebe7 100644 >> --- a/kernel/entry/common.c >> +++ b/kernel/entry/common.c >> @@ -390,6 +390,9 @@ void raw_irqentry_exit_cond_resched(void) >> preempt_schedule_irq(); >> } >> } >> + >> +void irqentry_exit_allow_resched(void) __alias(raw_irqentry_exit_cond_resched); > > Because typing raw_irqentry_exit_cond_resched() was too much effort? Probably unnecessary but wanted to underscore that irqentry_exit_allow_resched() handled a separate user path. >> + >> #ifdef CONFIG_PREEMPT_DYNAMIC >> #if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) >> DEFINE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched); >> @@ -431,6 +434,11 @@ noinstr void irqentry_exit(struct pt_regs *regs, irqentry_state_t state) >> instrumentation_begin(); >> if (IS_ENABLED(CONFIG_PREEMPTION)) >> irqentry_exit_cond_resched(); >> + /* >> + * We care about this clause only in the dynamic !preemptible case. >> + */ >> + if (unlikely(!preempt_model_preemptible() && resched_allowed())) >> + irqentry_exit_allow_resched(); > > This is wrong, if we have dynamic preemption then we have > CONFIG_PREEMPTION and we'll have that irqentry_exit_cond_resched() call. > > Basically what you've written above is something like: > > static_call(foo); // raw_foo() when A, NOP if !A Right, so: CONFIG_PREEMPTION: raw_foo() CONFIG_PREEMPTION && (preempt_dynamic_mode == preempt_dynamic_full): raw_foo() This is NOP if CONFIG_PREEMPTION && preempt_dynamic_mode != preempt_dynamic_full. > if (!A) > raw_foo(); So I would call raw_foo() for the CONFIG_PREEMPTION=n case. > What you really care about is the CONFIG_PREEMPTION=n case, but that you > don't actually handle. I don't see that. The CONFIG_PREEMPTION=n (or its dynamic version) is being handled here. Ignoring the RT case, preempt_model_preemptible() is either: IS_ENABLED(CONFIG_PREEMPT) or: preempt_dynamic_mode == preempt_dynamic_full So, I'm handling both the static and the dynamic case here. if (!IS_ENABLED(CONFIG_PREEMPTION)) raw_foo() or if (preempt_dynamic_mode != preempt_dynamic_full) raw_foo() > And yeah, you've got the extra resched_allowed() thing in there, but > that doesn't make it any better -- this is all quite horrible. I don't disagree. There's a quite a lot of static/dynamic config options here and adding this clause didn't improve things. I think just going with a static call here for the allow-resched case might have been cleaner. Alternately I'll see if it can be cleanly folded in with the irqentry_exit_cond_resched() logic. >> /* Covers both tracing and lockdep */ >> trace_hardirqs_on(); >> diff --git a/kernel/sched/core.c b/kernel/sched/core.c >> index 0d18c3969f90..11845a91b691 100644 >> --- a/kernel/sched/core.c >> +++ b/kernel/sched/core.c > >> @@ -8597,28 +8599,32 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); >> * SC:preempt_schedule >> * SC:preempt_schedule_notrace >> * SC:irqentry_exit_cond_resched >> + * SC:irqentry_exit_allow_resched >> * >> * >> * 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 <- NOP >> + * irqentry_exit_allow_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 <- NOP >> + * irqentry_exit_allow_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 >> + * irqentry_exit_allow_resched <- NOP >> */ > > This ^ is all complete nonsense.. irqentry_exit_allow_resched() is not > a static call. It's an alias of raw_irqentry_exit_cond_resched which > circumvents the static call entirely. Yeah you are right. I added the SC:irqentry_exit_allow_resched prematurely. Will fix. Thanks for the detailed comments. -- ankur
On Thu, Apr 06, 2023 at 09:56:07AM -0700, Ankur Arora wrote: > > Right, so: > > CONFIG_PREEMPTION: raw_foo() > CONFIG_PREEMPTION && (preempt_dynamic_mode == preempt_dynamic_full): raw_foo() > > This is NOP if CONFIG_PREEMPTION && preempt_dynamic_mode != preempt_dynamic_full. > > > if (!A) > > raw_foo(); > > So I would call raw_foo() for the CONFIG_PREEMPTION=n case. > > > What you really care about is the CONFIG_PREEMPTION=n case, but that you > > don't actually handle. > > I don't see that. The CONFIG_PREEMPTION=n (or its dynamic version) > is being handled here. Bah, I overlooked we have multiple definitions of the preempt_model_foo() things. For some reason I thought all that was only for DYNAMIC_PREEMPT. > > And yeah, you've got the extra resched_allowed() thing in there, but > > that doesn't make it any better -- this is all quite horrible. > > I don't disagree. There's a quite a lot of static/dynamic config options > here and adding this clause didn't improve things. > > I think just going with a static call here for the allow-resched case > might have been cleaner. Alternately I'll see if it can be cleanly > folded in with the irqentry_exit_cond_resched() logic. Something like the below perhaps? --- include/linux/entry-common.h | 6 ++++++ kernel/entry/common.c | 23 +++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h index d95ab85f96ba..0c365dc1f1c2 100644 --- a/include/linux/entry-common.h +++ b/include/linux/entry-common.h @@ -415,10 +415,16 @@ irqentry_state_t noinstr irqentry_enter(struct pt_regs *regs); * Conditional reschedule with additional sanity checks. */ void raw_irqentry_exit_cond_resched(void); +void irqentry_exit_cond_resched_tif(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_cond_resched_tif +#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 be61332c66b5..211d118aa672 100644 --- a/kernel/entry/common.c +++ b/kernel/entry/common.c @@ -390,6 +390,21 @@ void raw_irqentry_exit_cond_resched(void) preempt_schedule_irq(); } } + +void irqentry_exit_cond_resched_tif(void) +{ +#ifdef TIF_RESCHED_ALLOW + if (resched_allowed()) { + /* Sanity check RCU and thread stack */ + rcu_irq_exit_check_preempt(); + if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) + WARN_ON_ONCE(!on_thread_stack()); + if (need_resched()) + preempt_schedule_irq(); + } +#endif +} + #ifdef CONFIG_PREEMPT_DYNAMIC #if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) DEFINE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched); @@ -397,8 +412,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)) - return; + if (!static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched)) { + irqentry_exit_cond_resched_tif(); + return + } raw_irqentry_exit_cond_resched(); } #endif @@ -431,6 +448,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_cond_resched_tif(); /* Covers both tracing and lockdep */ trace_hardirqs_on();
On Thu, Apr 06, 2023 at 10:13:59PM +0200, Peter Zijlstra wrote: > +void irqentry_exit_cond_resched_tif(void) > +{ > +#ifdef TIF_RESCHED_ALLOW > + if (resched_allowed()) { > + /* Sanity check RCU and thread stack */ > + rcu_irq_exit_check_preempt(); > + if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) > + WARN_ON_ONCE(!on_thread_stack()); > + if (need_resched()) > + preempt_schedule_irq(); arguably this can simply call raw_irqentry_exit_cond_resched_tif().. probably better than duplicating all that again. > + } > +#endif > +}
Peter Zijlstra <peterz@infradead.org> writes: > On Thu, Apr 06, 2023 at 09:56:07AM -0700, Ankur Arora wrote: > >> >> Right, so: >> >> CONFIG_PREEMPTION: raw_foo() >> CONFIG_PREEMPTION && (preempt_dynamic_mode == preempt_dynamic_full): raw_foo() >> >> This is NOP if CONFIG_PREEMPTION && preempt_dynamic_mode != preempt_dynamic_full. >> >> > if (!A) >> > raw_foo(); >> >> So I would call raw_foo() for the CONFIG_PREEMPTION=n case. >> >> > What you really care about is the CONFIG_PREEMPTION=n case, but that you >> > don't actually handle. >> >> I don't see that. The CONFIG_PREEMPTION=n (or its dynamic version) >> is being handled here. > > Bah, I overlooked we have multiple definitions of the > preempt_model_foo() things. For some reason I thought all that was only > for DYNAMIC_PREEMPT. > >> > And yeah, you've got the extra resched_allowed() thing in there, but >> > that doesn't make it any better -- this is all quite horrible. >> >> I don't disagree. There's a quite a lot of static/dynamic config options >> here and adding this clause didn't improve things. >> >> I think just going with a static call here for the allow-resched case >> might have been cleaner. Alternately I'll see if it can be cleanly >> folded in with the irqentry_exit_cond_resched() logic. > > Something like the below perhaps? > > --- > include/linux/entry-common.h | 6 ++++++ > kernel/entry/common.c | 23 +++++++++++++++++++++-- > 2 files changed, 27 insertions(+), 2 deletions(-) > > diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h > index d95ab85f96ba..0c365dc1f1c2 100644 > --- a/include/linux/entry-common.h > +++ b/include/linux/entry-common.h > @@ -415,10 +415,16 @@ irqentry_state_t noinstr irqentry_enter(struct pt_regs *regs); > * Conditional reschedule with additional sanity checks. > */ > void raw_irqentry_exit_cond_resched(void); > +void irqentry_exit_cond_resched_tif(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_cond_resched_tif > +#else > #define irqentry_exit_cond_resched_dynamic_disabled NULL > +#endif So this is clever. Essentially this would toggle between the two kinds for the preempt_model_preemptible()/!preempt_model_preemptible() dynamic case. Do I have that right? > 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 be61332c66b5..211d118aa672 100644 > --- a/kernel/entry/common.c > +++ b/kernel/entry/common.c > @@ -390,6 +390,21 @@ void raw_irqentry_exit_cond_resched(void) > preempt_schedule_irq(); > } > } > + > +void irqentry_exit_cond_resched_tif(void) > +{ > +#ifdef TIF_RESCHED_ALLOW > + if (resched_allowed()) { > + /* Sanity check RCU and thread stack */ > + rcu_irq_exit_check_preempt(); > + if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) > + WARN_ON_ONCE(!on_thread_stack()); > + if (need_resched()) > + preempt_schedule_irq(); > + } > +#endif > +} > + > #ifdef CONFIG_PREEMPT_DYNAMIC > #if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) > DEFINE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched); > @@ -397,8 +412,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)) > - return; > + if (!static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched)) { > + irqentry_exit_cond_resched_tif(); > + return > + } > raw_irqentry_exit_cond_resched(); > } > #endif > @@ -431,6 +448,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_cond_resched_tif(); And, if we choose between the two resched modes at compile time then this would work. Might massage the names a little but this should work as is. Okay if I use your Codeveloped-by/Suggested-by on this patch? -- ankur
On Thu, Apr 06, 2023 at 07:29:59PM -0700, Ankur Arora wrote: > Peter Zijlstra <peterz@infradead.org> writes: > > Something like the below perhaps? > > > > --- > > include/linux/entry-common.h | 6 ++++++ > > kernel/entry/common.c | 23 +++++++++++++++++++++-- > > 2 files changed, 27 insertions(+), 2 deletions(-) > > > > diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h > > index d95ab85f96ba..0c365dc1f1c2 100644 > > --- a/include/linux/entry-common.h > > +++ b/include/linux/entry-common.h > > @@ -415,10 +415,16 @@ irqentry_state_t noinstr irqentry_enter(struct pt_regs *regs); > > * Conditional reschedule with additional sanity checks. > > */ > > void raw_irqentry_exit_cond_resched(void); > > +void irqentry_exit_cond_resched_tif(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_cond_resched_tif > > +#else > > #define irqentry_exit_cond_resched_dynamic_disabled NULL > > +#endif > > So this is clever. Essentially this would toggle between the two kinds > for the preempt_model_preemptible()/!preempt_model_preemptible() dynamic > case. Do I have that right? Exactly! > > 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 be61332c66b5..211d118aa672 100644 > > --- a/kernel/entry/common.c > > +++ b/kernel/entry/common.c > > @@ -390,6 +390,21 @@ void raw_irqentry_exit_cond_resched(void) > > preempt_schedule_irq(); > > } > > } > > + > > +void irqentry_exit_cond_resched_tif(void) > > +{ > > +#ifdef TIF_RESCHED_ALLOW > > + if (resched_allowed()) { > > + /* Sanity check RCU and thread stack */ > > + rcu_irq_exit_check_preempt(); > > + if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) > > + WARN_ON_ONCE(!on_thread_stack()); > > + if (need_resched()) > > + preempt_schedule_irq(); > > + } > > +#endif > > +} > > + > > #ifdef CONFIG_PREEMPT_DYNAMIC > > #if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) > > DEFINE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched); > > @@ -397,8 +412,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)) > > - return; > > + if (!static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched)) { > > + irqentry_exit_cond_resched_tif(); > > + return > > + } > > raw_irqentry_exit_cond_resched(); > > } > > #endif > > @@ -431,6 +448,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_cond_resched_tif(); > > And, if we choose between the two resched modes at compile time then this > would work. Just so. > Might massage the names a little but this should work as is. Yeah, I'm not liking the naming either, perhaps your irqentry_exit_allow_resched() would've been better, dunno, see what works. > Okay if I use your Codeveloped-by/Suggested-by on this patch? Yep.
diff --git a/kernel/entry/common.c b/kernel/entry/common.c index be61332c66b5..f1005595ebe7 100644 --- a/kernel/entry/common.c +++ b/kernel/entry/common.c @@ -390,6 +390,9 @@ void raw_irqentry_exit_cond_resched(void) preempt_schedule_irq(); } } + +void irqentry_exit_allow_resched(void) __alias(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); @@ -431,6 +434,11 @@ noinstr void irqentry_exit(struct pt_regs *regs, irqentry_state_t state) instrumentation_begin(); if (IS_ENABLED(CONFIG_PREEMPTION)) irqentry_exit_cond_resched(); + /* + * We care about this clause only in the dynamic !preemptible case. + */ + if (unlikely(!preempt_model_preemptible() && resched_allowed())) + 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 0d18c3969f90..11845a91b691 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6500,6 +6500,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 with the task having set + * TIF_RESCHED_ALLOW * * WARNING: must be called with preemption disabled! */ @@ -8597,28 +8599,32 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); * SC:preempt_schedule * SC:preempt_schedule_notrace * SC:irqentry_exit_cond_resched + * SC:irqentry_exit_allow_resched * * * 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 <- NOP + * irqentry_exit_allow_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 <- NOP + * irqentry_exit_allow_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 + * irqentry_exit_allow_resched <- NOP */ enum {