Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp491880pxb; Wed, 3 Mar 2021 08:10:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOuXaLB4iarDN1XLDJOHiNu2sRGHz9WVx3UswziqCAnwY+MLe2wVVXPlS101Y8Pi2QsLfD X-Received: by 2002:aa7:c907:: with SMTP id b7mr24336324edt.37.1614787826247; Wed, 03 Mar 2021 08:10:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614787826; cv=none; d=google.com; s=arc-20160816; b=I3Vfu/FXQt7YfKF5dYLX4yvTSMEavdohxGTxgA2Y14NNktzD6Ny/ZBpdpT5fetrdHr cG+mevT+ez05duxA3O/owoOgu2ybrzBAfghit63gApn8cqA1ABVf8KSy01T0yFDrbEPE qoSaGjnis1soN6SCTzQmEIXBAdl26Gkk5kUCkuHTz4LWX1w1CoRN3vDghqVcMjEphil+ zost1JjntvQ/JcSpAQJTt34BUm4IbgZDbV20BF8scUbDx/TfBdOu/stgEWGIcUdzDReR pYzDJ7n1dkq0+7hAtFEgYedIw2/gGuTo0ZAALEd3/+ROwbowKfp1R6PVw21moOTPyKXI iFBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jS1x0aOMuSQtUkdAoxyplzAd5lXkTnhVPz2GOTTuS6A=; b=0AG9fyHITz4Lit1T1Nrd8skmJwvyR0iKJfcbXyMrl+xd82lsCRzzL6iaPuwagMHeD2 qHnysC5bj1wYhn/dwVXS6p9NdvaIevC2Xp/negWSIACmXrNFEndYPXqhJO2NAolQyzZV tvK4+7kc27s5kY9+2IZ3ACji86Gbzi40JE3FSI9qcP8mNKObkzOCSBFWz6nuuzo4aYV7 zuzd0yUGxaeC/r2fskhrNGO1R3q7kM4y2lJjJlzmz+RZREYo6Rk1E9FuRHjmAUsecFJv sYes9WwPxMNCYs6OBxvYfoyZgM2RBAXo7R3XUZIAye8bAdATg5dGg2PnEktcbVpJI1Xr HTaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TtRO3zo6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr14si11536955ejc.470.2021.03.03.08.09.52; Wed, 03 Mar 2021 08:10:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TtRO3zo6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346193AbhCAXij (ORCPT + 99 others); Mon, 1 Mar 2021 18:38:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:58730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239293AbhCASIU (ORCPT ); Mon, 1 Mar 2021 13:08:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 105A065103; Mon, 1 Mar 2021 17:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618891; bh=RQY+9gZbr/bRsI/eznwtH0hBGu31BLnYjYT3lhylAJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TtRO3zo6SeMyugaKxtOw5DMEdXtOapHFGYpxau/paBSnmQ6UR/aXAQrrk1Paz2PyJ EhNkctq3ZhBlK4O3q9CSYWaNk/Ey9VJtks3kHNn4qA3JippBpMzmOZlHEDt7K25nPI a/N28P3X47LEiCJfL6t70NX5J/lUmx6otdRH+KTE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jens Axboe , Sebastian Andrzej Siewior , "Peter Zijlstra (Intel)" , Sasha Levin Subject: [PATCH 5.10 255/663] smp: Process pending softirqs in flush_smp_call_function_from_idle() Date: Mon, 1 Mar 2021 17:08:23 +0100 Message-Id: <20210301161154.447737241@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Andrzej Siewior [ Upstream commit 66040b2d5d41f85cb1a752a75260595344c5ec3b ] send_call_function_single_ipi() may wake an idle CPU without sending an IPI. The woken up CPU will process the SMP-functions in flush_smp_call_function_from_idle(). Any raised softirq from within the SMP-function call will not be processed. Should the CPU have no tasks assigned, then it will go back to idle with pending softirqs and the NOHZ will rightfully complain. Process pending softirqs on return from flush_smp_call_function_queue(). Fixes: b2a02fc43a1f4 ("smp: Optimize send_call_function_single_ipi()") Reported-by: Jens Axboe Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210123201027.3262800-2-bigeasy@linutronix.de Signed-off-by: Sasha Levin --- kernel/smp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/smp.c b/kernel/smp.c index 4d17501433be7..25240fb2df949 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -449,6 +450,9 @@ void flush_smp_call_function_from_idle(void) local_irq_save(flags); flush_smp_call_function_queue(true); + if (local_softirq_pending()) + do_softirq(); + local_irq_restore(flags); } -- 2.27.0