Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3908161imm; Mon, 30 Jul 2018 05:42:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeHLpmymEv1m8jGtQiQ0qsQ/I6r93dBx34HosPfJk0Fzchacb2IjcELcy2NC9Mpb7pPTOmx X-Received: by 2002:a17:902:7e43:: with SMTP id a3-v6mr16269939pln.151.1532954533485; Mon, 30 Jul 2018 05:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532954533; cv=none; d=google.com; s=arc-20160816; b=XG1TcBGhRSKf5NbE90U7VfCHM6CqAonH0pdaUSF9bf80XfryMIsf6QdlchasIl01uE yG2yTd1Gn97ZIsIVtEVlec23vrhqwmTrPTXQhareyhuk7UDNwCS0TBsL8+by1Lt7wq92 8ittK6ZoHKyn2zJgeIzBKtaqUNgVBE/qmKrgcW3BFTlez9vZta2NDNZLULbyQ951mnMX y2aBm7+hNk49poplPMBkrhPQM0nwzay7+08pATcEYwS2AIiPF2nMptcI+AtTjqdDSeuH 2i+OtlkG+dPTOn79nDN04Bof+wOUJzsYXZKQyPI5eBBPjD7u6vEaFLkZY2DWQvD5lz8Y sSMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=lYYuiVEsY2M0ayeTjVOKB4FItmtnyR2t6Lvca6lS7H8=; b=zn0RHocOhM6iaMbdj4+v96BXIE/G2vYQTYzCDd+siA5Yid0T0QPk+sG0hE3Na+xYOO tfros5djAZx+IQXKlKtnQCFg67kgGFoJE8Ndhs/9ifx+JMa4bJxiHPTYiSUlftZP1wF0 U6WglNDmcIXdHn/qEfA8R0+lo/XiIqbFGYBmOOQbuFogKoM0R2bgTxvTzhoAo2lWycKi AeWixarxCpjXiRpCfN5oQVtS/lHYms+yVbbP/bKmG6a5pFNQqmDdJSHU6TFNI8n0Sdmg f+HScjMgcyGxqM2kRxq6zqYsmmDVeLvXl8butCBHSBxUfXxn3pHCsqs8dwEN3kXQfN5Y gWlg== 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 8-v6si12238364pfw.89.2018.07.30.05.41.58; Mon, 30 Jul 2018 05:42:13 -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 S1729224AbeG3OPz (ORCPT + 99 others); Mon, 30 Jul 2018 10:15:55 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:56152 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728865AbeG3OPz (ORCPT ); Mon, 30 Jul 2018 10:15:55 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fk7Tx-0002v3-ED; Mon, 30 Jul 2018 14:41:01 +0200 Date: Mon, 30 Jul 2018 14:41:01 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Sebastian Andrzej Siewior , isaacm@codeaurora.org, matt@codeblueprint.co.uk, mingo@kernel.org, linux-kernel@vger.kernel.org, psodagud@codeaurora.org, gregkh@linuxfoundation.org, pkondeti@codeaurora.org, stable@vger.kernel.org Subject: Re: [PATCH] stop_machine: Disable preemption after queueing stopper threads In-Reply-To: <20180730112140.GH2494@hirez.programming.kicks-ass.net> Message-ID: References: <1531856129-9871-1-git-send-email-isaacm@codeaurora.org> <20180724062350.nlem2suuy5wlxpts@linutronix.de> <20180730112140.GH2494@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Jul 2018, Peter Zijlstra wrote: > On Mon, Jul 30, 2018 at 12:20:57PM +0200, Thomas Gleixner wrote: > > On Tue, 24 Jul 2018, Sebastian Andrzej Siewior wrote: > > > On 2018-07-23 18:13:48 [-0700], isaacm@codeaurora.org wrote: > > > > Hi all, > > > Hi, > > > > > > > Are there any comments about this patch? > > > > > > I haven't look in detail at this but your new preempt_disable() makes > > > things unbalanced for the err != 0 case. > > > > It doesn't but that code is really an unreadable pile of ... > > --- > Subject: stop_machine: Reflow cpu_stop_queue_two_works() > > The code flow in cpu_stop_queue_two_works() is a little arcane; fix > this by lifting the preempt_disable() to the top to create more natural > nesting wrt the spinlocks and make the wake_up_q() and preempt_enable() > unconditional at the end. > > Furthermore, enable preemption in the -EDEADLK case, such that we > spin-wait with preemption enabled. > > Suggested-by: Thomas Gleixner > Signed-off-by: Peter Zijlstra (Intel) Thanks for cleaning that up! Reviewed-by: Thomas Gleixner