Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3850792pxb; Tue, 17 Nov 2020 05:22:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxy+QqKQ+Lobo8bOi6ZRiFf5zdzm4xXpo022CMaujHnEVctdRYnTXXb/MWey4XS4c58dRIX X-Received: by 2002:a05:6402:3d9:: with SMTP id t25mr20894901edw.338.1605619361035; Tue, 17 Nov 2020 05:22:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619361; cv=none; d=google.com; s=arc-20160816; b=MaRKnTLU1q0R+ewS631CaVeguS54G8AJLs0ge8w7QCMt2fcLOV6SEMYdoTzra5Vse9 CCgHmk1PC4nnnGq0BqThfVUdKb2Knwrf8c/w6YjCYeeTRXQC7AmtnrlxG3GjavP0Er/e qVhbj+dASQUYAAx0P+TQySg7dxGNAUe30ATy54OL/l3J0/oba4KGiY5ASZP+yy7BRYsT 53O0MATJfmQViRM7CFdZ42yN9mIZCgC1BCgoBg8fiQOFANIni5DfDOI4lxpJriU4Imz+ ZLuQeN+hWzwtD22yPkdI5E6foHaVyITt0JYjI3HZxFVCgLiBcmmvSA44ffx9BQUAVpUg 5prA== 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=Nb52nH65xGP4Sc6E73hIXbPsXPcYD7l3cPWMQv4d/Aw=; b=KAfZIy4ep0IdPDeXV81BtNAgWVw4E6b3VkzmbaUe8IxvQFp0/vzaVZw7QA9OlersWT YhlaLZnjqzoKIYWQtPbGiaz3DcD9czybQVkwssUT5V/ZxBfV8gOSzSRmKP8PSCqLwyg+ 9X8dCzZ/JVHfx3aBuldCYCup0VqKzOVokHi7Cxu/eUv1PSM1xxrmEZSwi8sqUk8EBiyc eL5CQCw44QkK/cFtbGmAOtfWJYi9tdK0/sFmouQ6ZgXy/+4rUUvsyIgGjf/tIo6etsCu 6OnW3v/zQe/kxt0M0tR04yV2emXYqoOt6hzC2vA5N3E9aB6hcMslBI7bbnKoByKZjpw3 nIaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=thfF+5U8; 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=fail (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 z20si13249087eji.649.2020.11.17.05.22.18; Tue, 17 Nov 2020 05:22:41 -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=@kernel.org header.s=default header.b=thfF+5U8; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730487AbgKQNUL (ORCPT + 99 others); Tue, 17 Nov 2020 08:20:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:53416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730205AbgKQNUF (ORCPT ); Tue, 17 Nov 2020 08:20:05 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 66E4324248; Tue, 17 Nov 2020 13:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619205; bh=I4fGaygGXpgMT+2hDiExCw9fdtCEQuPCcuzh4zLWyvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=thfF+5U8vHv/QmV78atKTEEq3+XFQi93GKi+PjQ0UEV92gHRvHi1hknVkweiwZnf0 lXsLCjZomI4YKyiIZcD0fiMV+pOiJBL2IyNcydI3vPj2aUIdO8EApuX6+r49D2P4TZ EO0VmYbogyB5RcGdjGIhX2fpmh5TCzDg4I93ZcOU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Sasha Levin Subject: [PATCH 4.19 062/101] perf: Fix get_recursion_context() Date: Tue, 17 Nov 2020 14:05:29 +0100 Message-Id: <20201117122116.130125240@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@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: Peter Zijlstra [ Upstream commit ce0f17fc93f63ee91428af10b7b2ddef38cd19e5 ] One should use in_serving_softirq() to detect SoftIRQ context. Fixes: 96f6d4444302 ("perf_counter: avoid recursion") Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20201030151955.120572175@infradead.org Signed-off-by: Sasha Levin --- kernel/events/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/events/internal.h b/kernel/events/internal.h index 6dc725a7e7bc9..8fc0ddc38cb69 100644 --- a/kernel/events/internal.h +++ b/kernel/events/internal.h @@ -209,7 +209,7 @@ static inline int get_recursion_context(int *recursion) rctx = 3; else if (in_irq()) rctx = 2; - else if (in_softirq()) + else if (in_serving_softirq()) rctx = 1; else rctx = 0; -- 2.27.0