Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3003205yba; Tue, 16 Apr 2019 02:33:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqQiH9BIYGtA5FKkSrBXJ3sGuQNrRe4g0MbdaOGrF3fkJyRuLQNThwjaLeBtVvZb7xUBAW X-Received: by 2002:a63:720c:: with SMTP id n12mr75654711pgc.348.1555407190390; Tue, 16 Apr 2019 02:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555407190; cv=none; d=google.com; s=arc-20160816; b=eTnjh80ok670/co1hCarffAYt3N/lCnaIYG6Uo03V0nO/Pxs0VnYmnmkO7FErFsgn7 N6k0INZLeRlmwNp77CjFSOdiinT1Xw0Erj6zs1FKXzRTBSIDP57L4IQ3dOMmjBN3RqnK XDdB1dgFhBFef1E0rgRNjPRGlQP5DeXQ476SkZQcdQGQPap3bn6SxsYcpp99zqLf46rf bHUMRqlaI1NzJCTkOBNGTyzqeSpo/W1yT8IjFXOsTNDdRWdHFbMwseOCvkCLSBBAH1YW e3S6gSKa2MgLCVSLSJ+lAm+jkxAK7cW1zrt/Eqwyc8ZSCjAKDArezGvzYGkS7iTF1Ymp PfTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Q7Xr99zF4r6jYA93XnsTaf9Eg1/qnFu84nzVS5th2p8=; b=Vc0w5Ue9CWi9fnvXlGSnQnyq0jXv3AG5dKltTtnphT9JBzkt5zR7ac76x/Uf4Neyqs lx9ECvQDmh84Q5DcVWDcGSsyOphREWMsp9q6mHMZm6e30au1ex70lUPYcIAMwVrTAEFW TyDb3d8KGVm10mm8YfY/vnOHPHhEMY3ifIZAFk1TtJWoT76NAJSmVbtY+Z05TVUljIPA U0s575gN4DA4fXzGHcCxelHj31RFP04Vl5RVYeCcwxHThBW9geAgmhUNw0o+HglR9Kgx g8DOBzWhmnEtE99JrKWM1wrVGZ+lOCAW6khWeZdbgV9qMJnf+azGMcXRmyLzXWAuOlE1 sw7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=vCuSZ21e; 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 w23si46299659plk.109.2019.04.16.02.32.54; Tue, 16 Apr 2019 02:33:10 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=vCuSZ21e; 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 S1728147AbfDPJbi (ORCPT + 99 others); Tue, 16 Apr 2019 05:31:38 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60586 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729026AbfDPJbe (ORCPT ); Tue, 16 Apr 2019 05:31:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q7Xr99zF4r6jYA93XnsTaf9Eg1/qnFu84nzVS5th2p8=; b=vCuSZ21eWSxfOySyD+iPsw857 AMvJ+qUqBxnOm1QhnUfyHP0U74NqJasTl26fe3D0nqAk0CRrWHJUPHnYhSxFJNxXCGJ30b3YlICuP Kcn2Nwoksj5QF+MscgUGkoNAwUOX1TRjFrKmOXkGnMtEH5kKg3P6N01LMukal/4egTMti4O86pDj7 Qvm+10NfXHLdFUuGenZ3p2dWKhsoH9iLWveL+U1iwnxtf0oqfMJ2AuCI7MaWs4dVqohuHoUztomoN kqsnkX1yLIdkbeZMAmLLi/lvHEs3mN8tr46xV6AwYVwZLwMg89aqV9wK+ArJvvMkevSqV54SToJ7l Sz9ZrrVoA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGKR3-0005vz-MZ; Tue, 16 Apr 2019 09:31:25 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5B58629B49941; Tue, 16 Apr 2019 11:31:23 +0200 (CEST) Date: Tue, 16 Apr 2019 11:31:23 +0200 From: Peter Zijlstra To: Dexuan Cui Cc: "tglx@linutronix.de" , "riel@surriel.com" , "jpoimboe@redhat.com" , "luto@kernel.org" , Stephen Hemminger , Sasha Levin , Haiyang Zhang , KY Srinivasan , "linux-kernel@vger.kernel.org" , Michael Kelley , "marcelo.cerri@canonical.com" , "apw@canonical.com" , "olaf@aepfle.de" , vkuznets , "jasowang@redhat.com" Subject: Re: [PATCH] smp: Do not warn if smp_call_function_single() is doing a self call. Message-ID: <20190416093123.GR11158@hirez.programming.kicks-ass.net> References: <20190412235341.29379-1-decui@microsoft.com> <20190415122128.GO11158@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 15, 2019 at 11:39:57PM +0000, Dexuan Cui wrote: > > From: Peter Zijlstra > > Sent: Monday, April 15, 2019 5:21 AM > > To: Dexuan Cui > > > > On Fri, Apr 12, 2019 at 11:53:57PM +0000, Dexuan Cui wrote: > > > If smp_call_function_single() is calling the function for itself, it's safe > > > to run with irqs_disabled() == true. > > > > > > I hit the warning because I'm in the below path in the .suspend callback of > > > a "syscore_ops" to support hibernation for a VM running on Hyper-V: > > > > > > hv_synic_cleanup() -> > > > clockevents_unbind_device() -> > > > clockevents_unbind() -> > > > smp_call_function_single(). > > > > > > When the .suspend callback runs, only CPU0 is online and irqs_disabled() is > > > true. > > > > Pray tell, how well do you think mutex_lock() works with interrupts > > disabled? > > Good point. I realized generally speaking this patch makes no sense, so let me > try the solution proposed by Vitaly, i.e. fix clockevents_unbind() instead. That's still not the problem. You're calling clockevents_unbind_device() with IRQs disabled, that's not correct. It doesn't matter what clockevents_unbind() does thereafter. You simply cannot do any of this with IRQs disabled, end of story.