Received: by 10.213.65.68 with SMTP id h4csp1495431imn; Mon, 26 Mar 2018 08:36:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELvIZlnCiqDtvJzJLhFP7HgI5OAA4OeLrP8wZcspx40gasp9FfTv0RorZ0K06RDjR04LTVcX X-Received: by 10.99.3.144 with SMTP id 138mr29036793pgd.364.1522078616697; Mon, 26 Mar 2018 08:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522078616; cv=none; d=google.com; s=arc-20160816; b=rR/xRq4J24dtu4omH0LPSSXjqx4m7FTFIJZrL3s1W77/RROCKwK1M06Hi3FjaQkNkl tKenQaTCVaZMTviIGuBU6x155cA1ri+26i3XmmSLb9HklZXL8MfuEG142Oi1yICBLtbd 2DM7uLR1/XZaLkRUwH9MGTk17QWx65Lv9SnStyFpWyvRyC/sAjYUgBIHD9ZS/vOU8hfO PVrCXF6UFCSHlVw1vrUtXiv2+6T/l8rPOUyNe1HHOQYPSxfWLF1hsd8g5iL8alEWYdme ZjvkkIttmK+z94OKbvi+/PhdUSYSjJ8mIsp9p9AV1g9q0YZZN9WuX6dI7wftuvzBRexT w2qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=u6ALU1EJQtvx6OV943tjB67nuXwzjKmZEAeP6IBLpHA=; b=DOGuFeolOVWMrYxXGHQcps+RT4G3FRo89G+ZhHQYdtTTDtIolsQ9Pla4VrQWrXuuD7 I+5wR8BqTM9/p9DSDHPlIINz6LDeYDfgIwMZZRzMWh2a+m9siEKgBxmEPrrfdVR6B5wq eIpQ8yEyiT0RmfZqJSqNOG2WS94KWU+fRvm/pKwjF6IStOORK9fSdoQ5T+MRs7EtijvV mdeSWYAZZktJAifXBisI4pi4lLfW1xrTx7/y9kObg7Q5T3O0EvGdKkCXFfnlpG2ivNqc XhuM+OcuDpSDhjnu0Vs8CCDtbn2I7U0MK31b6fc8CawJ7NBEAKeFJugJRW9/O03u0lYd 8t4A== ARC-Authentication-Results: i=1; mx.google.com; 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 n9-v6si2886524plk.245.2018.03.26.08.36.39; Mon, 26 Mar 2018 08:36:56 -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; 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 S1752431AbeCZPfT (ORCPT + 99 others); Mon, 26 Mar 2018 11:35:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:39376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbeCZPfS (ORCPT ); Mon, 26 Mar 2018 11:35:18 -0400 Received: from gandalf.local.home (cpe-172-100-180-131.stny.res.rr.com [172.100.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ACC9E21773; Mon, 26 Mar 2018 15:35:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACC9E21773 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Mon, 26 Mar 2018 11:35:15 -0400 From: Steven Rostedt To: joe.korty@concurrent-rt.com Cc: Julia Cartwright , , , , , Subject: Re: [PATCH RT] Defer migrate_enable migration while task state != TASK_RUNNING Message-ID: <20180326113515.720e7fb3@gandalf.local.home> In-Reply-To: <20180323172131.GA2670@zipoli.concurrent-rt.com> References: <20180323150959.GA16131@zipoli.concurrent-rt.com> <20180323165921.GG10942@jcartwri.amer.corp.natinst.com> <20180323172131.GA2670@zipoli.concurrent-rt.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Steve