Received: by 10.213.65.68 with SMTP id h4csp1511317imn; Mon, 26 Mar 2018 08:56:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+QjxXhMZPOoePXQBheODaUWzQKkgdytP6jjCOASXmpySUoS1FU/HCN13M1hNUeqegYKVyR X-Received: by 10.98.13.71 with SMTP id v68mr4833995pfi.69.1522079801833; Mon, 26 Mar 2018 08:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522079801; cv=none; d=google.com; s=arc-20160816; b=jivSDbBYwekzamZ5AJvvn0axAXAmbCWf8nCb4Fy0ehptv+lJNPdViaz/K7oZPrAtlv 7JcNT6PSSv/ToKX2UXmM1H6m4avoV0VfFxjo8aXK+tAl5OGNhn8A/WwuSHnkESZzLYIU +/0tc4iOFVB2jqWvQ6YMfa2EG8juTl6N7L9+Kn0vByyQodl5VQjqLojA2U4qpGcAK9iX a1QX+MRbkO5QfM7LR+AGBsfZaUG7WdPe3T6jYTWOZ8E9S4v0qaYZWBSnjXv/nx8+qCw4 kEhdSRYQRd7nvhxSjagJa9dJCQ6qcAWsThCVBaMI7H985I/g0SQxA0J/sq+rJXlNt8Y1 FplQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=DzVbMvWDFqniB9u39s6/BbvGfJLxUED7s3MB4iEeMmo=; b=NlHv5LhguNeRloBHPvLNlctPlLKaavkyQGqM7LcqYJBl1IG8v4lGgPKLyP1WYv08fz EQmgEcvTFvq5wByXLmrYZ9oquNCltR/2Z9XMAvYoRcfAWds5obHrSlxh48aJYUXyiThw 4osCpj17bPwly8mOC08Me5VUWxrFDLdWivckLpgVTArmg4jG5v26f6CZIJXlSiHGE4H5 q8XZQpu2SiUfseG7QCJd/aCYx/sqrS18+qQiRzzdGCNh5B8euEoUZYdAGeCFAFMsXK3U gJfrFBMERfeUmk/0OLecFpWyx1Mt/ZbKioNUvnHqHAv5HqVyFLyzLB95fgtwgyEOqCFh xUSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@concurrentrt.onmicrosoft.com header.s=selector1-concurrentrt-com02e header.b=YG8I6QQO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si15054080plu.465.2018.03.26.08.56.25; Mon, 26 Mar 2018 08:56:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@concurrentrt.onmicrosoft.com header.s=selector1-concurrentrt-com02e header.b=YG8I6QQO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752273AbeCZPzD (ORCPT + 99 others); Mon, 26 Mar 2018 11:55:03 -0400 Received: from mail-bn3nam01on0127.outbound.protection.outlook.com ([104.47.33.127]:23963 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751109AbeCZPzB (ORCPT ); Mon, 26 Mar 2018 11:55:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=concurrentrt.onmicrosoft.com; s=selector1-concurrentrt-com02e; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DzVbMvWDFqniB9u39s6/BbvGfJLxUED7s3MB4iEeMmo=; b=YG8I6QQOfzGYkNKH7+NBZsQLbhb75R/5tIKG9iRSFi95dXx+QAzUripJu8KVFrHIpRKM2VTPzpjVEZVVKvF0eFyyTx9MQ5fbATctvuJu+oejKEVpj2A3md6kYmt/wujvtEvwkglRjKTNz1ejaG5zCNsGVV5mBpNyIqvzbwpW/b8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Joe.Korty@concurrent-rt.com; Received: from zipoli.concurrent-rt.com (12.220.59.2) by DM6PR11MB2570.namprd11.prod.outlook.com (2603:10b6:5:c6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Mon, 26 Mar 2018 15:54:57 +0000 Date: Mon, 26 Mar 2018 11:54:51 -0400 From: joe.korty@concurrent-rt.com To: Steven Rostedt Cc: Julia Cartwright , , , , , Subject: Re: [PATCH RT] Defer migrate_enable migration while task state != TASK_RUNNING Message-ID: <20180326155451.GA16545@zipoli.concurrent-rt.com> Reply-To: "Joe Korty" References: <20180323150959.GA16131@zipoli.concurrent-rt.com> <20180323165921.GG10942@jcartwri.amer.corp.natinst.com> <20180323172131.GA2670@zipoli.concurrent-rt.com> <20180326113515.720e7fb3@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180326113515.720e7fb3@gandalf.local.home> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [12.220.59.2] X-ClientProxiedBy: CY4PR1701CA0006.namprd17.prod.outlook.com (2603:10b6:910:5e::16) To DM6PR11MB2570.namprd11.prod.outlook.com (2603:10b6:5:c6::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 64424a96-615e-4e38-5f0a-08d59331ed65 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DM6PR11MB2570; X-Microsoft-Exchange-Diagnostics: 1;DM6PR11MB2570;3:iKHAvRQCuSHvP6/as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TrvcqVtembYkYHFapldAe69fq3SoqTkfIa58OC2pSdxpPNadRjaW5hNO9KKUpVqkXVY1kpXcIB7Hzlox4fC0QKBx8gxxXQmz/oHM4QDQD3EvabCDE2A18s0AacJ7JZ8NbbzBb0dH5rF2XXQ==;4:6IyZM7HmOlaIYN0EYxf1N1poIfXZTA34cTTfZn0Dg6jpHNtKnGk9N2ol388G8e6FrPdyteyUWvgIiUy8Igoe17rh3hWXQrHmCotDDym6BDZ5pBRz01+xvVswY+EupoI+vyxaP2PRkXonxuxWvK2eDQPrZVJSyQsnQm7Fs00PyicyFCCm90+2bDE0vFYV2QYxBCVhlU36dXYj0jAYmlmLFE5q9t5Oxlz9R31VuDKR7IJ9WnoY1Dy9QCxrYkMNe3DwHB73ZupLfZSrTHTWQT4gAw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231221)(944501327)(52105095)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011);SRVR:DM6PR11MB2570;BCL:0;PCL:0;RULEID:;SRVR:DM6PR11MB2570; X-Forefront-PRVS: 06237E4555 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39830400003)(376002)(346002)(366004)(39380400002)(396003)(51914003)(199004)(189003)(16526019)(186003)(305945005)(7736002)(6246003)(5660300001)(53936002)(93886005)(23726003)(6116002)(3846002)(1076002)(478600001)(316002)(43066004)(55016002)(54906003)(476003)(486005)(486005)(16586007)(58126008)(6916009)(8936002)(47776003)(66066001)(81156014)(6666003)(81166006)(8676002)(68736007)(33656002)(26005)(72206003)(105586002)(59450400001)(4326008)(386003)(85782001)(106356001)(446003)(11346002)(956004)(53416004)(97736004)(76176011)(7696005)(52116002)(69596002)(2906002)(50466002)(229853002)(9686003)(25786009)(86362001)(18370500001)(85772001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR11MB2570;H:zipoli.concurrent-rt.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: concurrent-rt.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM6PR11MB2570;23:NzFyozTKxH7eLqjJGnv7wmiPhZEGjlVrGZBCaj9C4?= =?us-ascii?Q?f/EordeSEDQ0zVwnNFnx+q7oVIzeW2W7ZahUE2F1ukKUeNGEmktnAmQfdg5P?= =?us-ascii?Q?06cDVtsTRLJU0PSZqhf8jfbpbEQlZpUtwiF4G/ASpvEaqklgZhvF0MItjGZe?= =?us-ascii?Q?5AVOzaEelgQjfjr3sqvar6MgC1+VDV8vxJ7qOAe3dnHaANV0Q16SfQJMfmHV?= =?us-ascii?Q?bZmz3I1ERh18K4QhvxYXis/4Y2dgVp+qLPVRCNG5l+oBulNelCX9iGjMTP7U?= =?us-ascii?Q?R3UUntaiBwKhGu6dT/3y8j/jGoay9LxdB61v2vm/MRO2OoChOrZmEpRTebBy?= =?us-ascii?Q?4oCUaKuF7LlmG0w2CJs6ySmvbLh3qK5GrYfU0GXKoz0NBHosCNVOYTlQfTsB?= =?us-ascii?Q?4/SzpFaNco6Jwsle8Yz42CuaP/9XnoDarjF/Yb97vmde0SA15oasPx9yyINf?= =?us-ascii?Q?4FMCmdwkwLCNB9uGg4QwwJbsC8LZtzIuHfK3c2v/0jiZbk76BbOanxHvlFuP?= =?us-ascii?Q?wL/nymBXLASeXysiYzDRX16Gj2YntsOONhauzbQJ+p+hqdFkXaF3GdKhBs+T?= =?us-ascii?Q?Avvtaug9+kDUeO7t6WgLCgTga6bbbxiHJG0iSPncV6hq5ilb3l+m6KqZa1x9?= =?us-ascii?Q?eudUfPXj0Ai9W88Vj3LOMEw+Uk2XRt3a99xa54UhLK8bmHrat9MTOs5Hkgwt?= =?us-ascii?Q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3OAnmZtSjSTicivECqtuMpzJjSB6Geap9sbJS0KC6soL3FgH1FIcb3jekvcT9OBN82DVusRJ X-Microsoft-Exchange-Diagnostics: 1;DM6PR11MB2570;6:hPthEAUaNbEtcewHNa1pBwG7HZUs4NpRnXB+oaQS6uhVds0qSTlWHX2oiKyyHouyW7i+w0cdjTh0ugOE5HLEWmTsYG+fgJUGlW3RtH5f+pFoeAHbB0AS3C6P1/sXw/RHGgcYcYNeiUxYYNp/ivhf36fSVjIXMUZ97KH1iVmqOFnOIXcpXLaaoDKxqlL6jfZTvzd9tR6C8l1RRzL5ivDnVlsudmr1IcRZRuflYQBMZ76n8rm0dsrDh7eK/riapJwsuPTqid8XdFcAcTGSDstGA8yRnZ9I0oPaLCeQ1NCO/Po81gPBZgG7HQvvDAVBGcj0qNO9G7IXMOZcZRmQTXUix1hMIirMzMfrGSwDsLNpjPgZfoynvBM8sz+wqXB9kSSMLRPt3oxrh4ieM3suueyrxPX86fZdRaqiX3mspkkll98UC9keWsOZ8iA6JbY7r0QH5rs5XcwJPMk1VfU+ZcDQLw==;5:WLhLfqpvQ5fYRCIahfGWlncbqRPkYOQs9A35ZGGmuAqXzbfqkENzuRL0J43qbGcOHcsQAkvK+wWrZBURigef+Xo9++3H77T+BcxRJNap5bodXX09uXRzu4zHzquWYzhdqETBDcRmGYpwVRGmzu15kWMYEF55p7xs4d35vg/hTWg=;24:bXjdjapsNL+gku7VUDC3OGZ0h2Bj6TOnotkRGRP8RhCoU23qjD9VG8563KNL8Dlc5qi1r3sN/8eryybawIdb+WTUPbuyvuQiBe8D5qhJY3Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM6PR11MB2570;7:fOPWE+eZ8qWq8qi7y3mNZsXPEeRR9miMVBGF/EbIIPqeaZ4kBTqcsJrfmTM+9fr7rgYGiuO3LWUM1sWBNJMgqgUfwWtIjMKsHCJdtwcPil6TR++bX98rUu2BzTzFJdRoi6BSbG8r/Zy7OKoapNV6p9fdb9OA0LLiqMBytaQrYpkzT/dgF0R7LCJvk656t8LNEgdro0aNaL/llNDZM+ZoQyqsr+MykK/cp2lD1HBpxmijWnfT3xhhNhSElUeguPiz X-OriginatorOrg: concurrent-rt.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2018 15:54:57.9098 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 64424a96-615e-4e38-5f0a-08d59331ed65 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38747689-e6b0-4933-86c0-1116ee3ef93e X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2570 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oh well. Makes me wonder why might_sleep is testing for !TASK_RUNNABLE though. Thanks for the correction, Joe On Mon, Mar 26, 2018 at 11:35:15AM -0400, Steven Rostedt wrote: > On Fri, 23 Mar 2018 13:21:31 -0400 > joe.korty@concurrent-rt.com wrote: > > > My understanding is, in standard Linux and in rt, setting > > task state to anything other than TASK_RUNNING in of itself > > blocks preemption. > > That is clearly false. The only thing that blocks preemption with a > CONFIG_PREEMPT kernel is preempt_disable() and local_irq*() disabling. > > (Note spin_locks call preempt_disable in non RT). > > Otherwise, nothing will stop preemption. > > > A preemption is not really needed here > > as it is expected that there is a schedule() written in that > > will shortly be executed. And if a 'involuntary schedule' > > (ie, preemption) were allowed to occur between the task > > state set and the schedule(), that would change the task > > state back to TASK_RUNNING, which would cause the schedule > > to NOP. Thus we risk not having paused long enough here > > for the condition we were waiting for to become true. > > That is also incorrect. As Julia mentioned, a preemption keeps the > state of the task.