Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp967342ybl; Fri, 24 Jan 2020 12:53:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzmda+4Gpk7VFYBrVaEZu7IrtK7tjLQtzlS9bi86lT6wuFIgBqvP55wktEM8XvSNZRGjtW5 X-Received: by 2002:aca:c692:: with SMTP id w140mr506364oif.139.1579899203203; Fri, 24 Jan 2020 12:53:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579899203; cv=none; d=google.com; s=arc-20160816; b=KJ8yPYkHrGsUL+NLxF9e8PBHAIIeq5lRv/soQg5iWwjk3Y/LD3nUx7e2y770tqCAPL u/0AeMgjj0i8cy4Ss6N8j73jO542ZQyItJjBO+ltOgJSYg2yjjXiGP6ALL5+XGofaUN/ YOO0toNdMbAbZGNV+EZqVLD+OMQ/p2biCsmU4C68GKYUgEgiVAjTxRabn0NAd3x9WsCf CcAZdDxqMqXdPNxnASeRswgHPjqeHWq+mbX03BMfj7IcXE5MFXlvlt2V9IfZ85hNDufo yYOVDPFRCgyR+hwfxk+Ypxikn4ebD8ZpgdnYXuAJKDO0xNuAujpzq1VTwfDtWKxe73Pb wKFA== 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; bh=D5hKDKk/dEP2v2CtQwgGTS4TeeGIHj4yJXn0fTdHFcI=; b=jIgv7dUpql3uhzSqxqwFq9p0lv2n27vcp9rxXKEUvwtCmqoNZ4r2zVjmNYWbpzkubg 4kqGNgwa65pXTLJsIfXBl/dpVc6f3AQ6qJzI666QVZWyP4tbuWaRYj1GtQLGTFKugQVa fLuLPc2Hmfnqrosg34cQn36R48K/t165oXTGnGeGo2x8jwXn/r0k1D9Wj+4DLXEc4zjb loe7TMkVQWqX1gKCdVK7+3iWipgSITGDJE31O1l+9Q2T2uXwdfq74UTapy9j9WrPbeMq QuJ3lu7PfH3egHWNKCcH+FeX+khlII8GtxLmzX8HhjWy9HwNnQBYeGu1cWt+tjOXo2CP nO9Q== 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 h9si337199oie.74.2020.01.24.12.53.11; Fri, 24 Jan 2020 12:53:23 -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 S2388696AbgAXPiY (ORCPT + 99 others); Fri, 24 Jan 2020 10:38:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:43464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388566AbgAXPiY (ORCPT ); Fri, 24 Jan 2020 10:38:24 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 707432071E; Fri, 24 Jan 2020 15:38:23 +0000 (UTC) Date: Fri, 24 Jan 2020 10:38:22 -0500 From: Steven Rostedt To: Scott Wood Cc: Sebastian Andrzej Siewior , linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH RT 1/2] sched: migrate_enable: Use per-cpu cpu_stop_work Message-ID: <20200124103822.76ab320f@gandalf.local.home> In-Reply-To: <1579864307-13093-1-git-send-email-swood@redhat.com> References: <1579864307-13093-1-git-send-email-swood@redhat.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; 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, 24 Jan 2020 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. > Makes sense to me. Reviewed-by: Steven Rostedt (VMware) -- Steve