Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3078243yba; Tue, 16 Apr 2019 04:21:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOr9vT94OpOS57KZZHgU42Hk7MMCiUcfyBHQjOdZ95qFzMdX1KjrQqPTzJqVrbPpHH0azU X-Received: by 2002:aa7:938b:: with SMTP id t11mr43389973pfe.67.1555413709291; Tue, 16 Apr 2019 04:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555413709; cv=none; d=google.com; s=arc-20160816; b=I3lybpyigYoBRSDjkx661sYW56y1tMTmO4+QFxCQfvt+atwlj8su1l9FUox+eAs1PV 6Yium3JUg7LSpXtQq0Cw2j1kulIAPlmwByQrS7Ke1DM7e0jV4qc/8YK6l0sYll8qHH4D hYysQWholv/HrZx08p1663zqDFMovFXRIgCR9gtPO/4MAcu8PdRw6Yc7n9L7+7gvqRcs qjRTe5WNK52bfy/w700ykLnArXo9NZacuRGRWe67WlC0+loQhxLzK+ONRVkTnNxQDL3G mnGWnwxcIrKQKDSZzLHA5cXBGXmHQjOPkjEuIuXCUeeIyGD3sw8bfPRuYVEerwD3S/Rq EdQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=vX22ZljpvyzGqaDUGaMXFf3h/6G9La+s7NU9oDZqnu8=; b=lC7WOGrljnjOc5dmNFqmc3qy07FwpV7ozCF4bgDL1dVJSV4pqYmAAqaGpCXCHWFSTU PQF58OkHkXOMjL11AJhXZ6J/8D0S6DuoTJQwxONV+XiQVsEVKWoadl4FXvE4CiNAcEBG E9Tux+Eu2+FCV9KEkPyXTha6DzeHqx8rHOZbO0zPdJrSFaYUIhuj4cAK2TM9cQWXCoQ7 yJSzAXwPH+Dq3ubgNZkmb425YMS9uuOpOe3mg4oi/FJJOohpVvpglz0ZIW0ZzE0NqLk5 +A01UAWyHd3DWAA4V6rZ8eFr+/STi3JzA+Bl3QMykeqKF2F9kRxlLzlaYGq4/mBpK74w FObg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si47752571pls.411.2019.04.16.04.21.33; Tue, 16 Apr 2019 04:21:49 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728927AbfDPLUX (ORCPT + 99 others); Tue, 16 Apr 2019 07:20:23 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46253 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726313AbfDPLUX (ORCPT ); Tue, 16 Apr 2019 07:20:23 -0400 Received: by mail-wr1-f65.google.com with SMTP id t17so26440075wrw.13 for ; Tue, 16 Apr 2019 04:20:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=vX22ZljpvyzGqaDUGaMXFf3h/6G9La+s7NU9oDZqnu8=; b=PB/2ffXRBzdBsn5XVLD+HHNXK+LzYee9Is513bm7MEqHmutCt8meoWVkhpl7nAEMlK ORxH0tUbYVNlkG4NTSSOI5tmwN+PKLaKBDaEXMYzW9KvLBwW65Qdu27LdP1vQi+gU7hB K0JGi7Gs+5RV4hVIiKVXPbvfjATGdPehCpcZQIEUdKOLl1uACs3hfwf0/D3RxHsva16x PmcCgT71KCeqgTGiKDmWH4HYIZM6cK7hFDhsMaQ+kLcjOBY0dMOYNJzrfISomHyYI69j eAYvI0VGrXKfY2sgQaqNNiVK5eTo/8hr39Ph2KNHz2NhSkTHPYhxqhQhaMQthvrLhMAz KPCw== X-Gm-Message-State: APjAAAVt9PlLP1dlu/fDXoWQt/5N7hbgSp/NOfjbTUQ7pKRw99rZJHkO +8TyBIQQE14eh1vpGRis0z0wrA== X-Received: by 2002:adf:cd83:: with SMTP id q3mr49244642wrj.228.1555413621350; Tue, 16 Apr 2019 04:20:21 -0700 (PDT) Received: from vitty.brq.redhat.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id z10sm17162151wmi.15.2019.04.16.04.20.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2019 04:20:20 -0700 (PDT) From: Vitaly Kuznetsov 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" , "jasowang\@redhat.com" , Peter Zijlstra Subject: Re: [PATCH] smp: Do not warn if smp_call_function_single() is doing a self call. In-Reply-To: <20190416093123.GR11158@hirez.programming.kicks-ass.net> References: <20190412235341.29379-1-decui@microsoft.com> <20190415122128.GO11158@hirez.programming.kicks-ass.net> <20190416093123.GR11158@hirez.programming.kicks-ass.net> Date: Tue, 16 Apr 2019 13:20:19 +0200 Message-ID: <87o9562o3w.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra writes: > 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. > True. And before we start digging deeper into this, let's step back: why do we need to do clockevents_unbind_device() on hybernation? Can we just disable the device and re-enable it back on resume? Actually, all usages of clockevents_unbind_device() in kernel are limited to Hyper-V and with Michael's patches moving this out of VMBus driver I think it can go away completely. -- Vitaly