Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4030045ybl; Mon, 3 Feb 2020 11:10:14 -0800 (PST) X-Google-Smtp-Source: APXvYqy93MZt/3Q7amqOpwPaF1TO6NbOwkyac6wX8DHSQN5jhOkgOw4aaHCPRHb85XZZbR72s/Dk X-Received: by 2002:a9d:7ccd:: with SMTP id r13mr18125682otn.56.1580757014082; Mon, 03 Feb 2020 11:10:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580757014; cv=none; d=google.com; s=arc-20160816; b=nOfZTuxfuWWe8ruFkEkH/XFk3yY23M2yzCfB0tLdqdCdcj1I8tD6pPb1Tg+V2aRVn3 WGT8cuKEZQ3asOEOtEoGA7DQ6fBf/tp7Ao0VAcxcJbrL67EsT7KbdkagELbCEDrhDftx wFX0dijdcrZWsiSWXlTHZnDrIX/AXZxIGZQzs6PYFrkUAWGkYnK72959DtCXhYfNCO8L y4EATb94669Y8/F++QcXGKAuQXK0Kl7Ofs9jEMMNF5/zbX8oqizy66xpV7+R4BWc/jlY k3fww1f1iU3NIMCUAmmJzYx2e77fSPpdDA1buOfIvK0YBZ3/ydzORtNO6TTeQiDoVv7g OqXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=U24sx+wAPZtYdr8zGNjqWrqAEhXaCnmoFYv0nQSiHHM=; b=vcTKGaB2clouSAo/jsWUlPdLIVaN7DCD25fj/RwmpubKLnPqTvx4hX10jIRMiusJEQ NVRiicS0XCy8bCdD4HOlsl7kXcGZj4h8McPwPd2V+f/qefX6caB7XgTc9RQKQ+WkxAtg 9qWDUBO36zM3xXWLQUDtQ3G0QZSKnSg/jEZfgUq0INMyYcgHaXS8xNM9B1nxjqmGv28n Qyx4hiTcMa7bI3BinY7lzbd3S1whHciCqYLYAE42/kr0aLpHf8tcmTV3vl/9bZFjIlE+ 8XaM5EsTyQafU4bb4ZoYKnCj7DAGOU4M8hV90gTQnPuwBCDt3eB7JUdJ4rjso4zaHK9y hyZw== 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 n11si9367730otk.290.2020.02.03.11.10.02; Mon, 03 Feb 2020 11:10:14 -0800 (PST) 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 S1728881AbgBCRhg (ORCPT + 98 others); Mon, 3 Feb 2020 12:37:36 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:60258 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728212AbgBCRhf (ORCPT ); Mon, 3 Feb 2020 12:37:35 -0500 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1iyffA-0005En-7p; Mon, 03 Feb 2020 18:37:32 +0100 Date: Mon, 3 Feb 2020 18:37:32 +0100 From: Sebastian Andrzej Siewior To: Scott Wood Cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Thomas Gleixner Subject: Re: [PATCH RT 1/2] sched: migrate_enable: Use per-cpu cpu_stop_work Message-ID: <20200203173732.ldbgbpwao7xm23mm@linutronix.de> References: <1579864307-13093-1-git-send-email-swood@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1579864307-13093-1-git-send-email-swood@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-01-24 06:11:46 [-0500], Scott Wood wrote: > Commit e6c287b1512d ("sched: migrate_enable: Use stop_one_cpu_nowait()") > adds a busy wait to deal with an edge case where the migrated thread > can resume running on another CPU before the stopper has consumed > cpu_stop_work. However, this is done with preemption disabled and can > potentially lead to deadlock. > > While it is not guaranteed that the cpu_stop_work will be consumed before > the migrating thread resumes and exits the stack frame, it is guaranteed > that nothing other than the stopper can run on the old cpu between the > migrating thread scheduling out and the cpu_stop_work being consumed. > Thus, we can store cpu_stop_work in per-cpu data without it being > reused too early. > > Fixes: e6c287b1512d ("sched: migrate_enable: Use stop_one_cpu_nowait()") > Suggested-by: Sebastian Andrzej Siewior > Signed-off-by: Scott Wood Yes, perfect, thank you. Sebastian