Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3843927pxb; Tue, 17 Nov 2020 05:12:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIOkMBoE5/pUfXiFpCMIIFep19nc9Dck1dR8MV1FmYaQsH5F4VBwBC/vHhDWZKNU04NCPB X-Received: by 2002:a05:6402:559:: with SMTP id i25mr22603240edx.128.1605618775089; Tue, 17 Nov 2020 05:12:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605618775; cv=none; d=google.com; s=arc-20160816; b=drKC1YWO2pn7N7rFDKIWwoWxq8BxApKYlihStm4DhyGUJtVaA6jodiXNwCrF5rEnhA qx0rYGmRL5zEzNM3W4wXUme8GZ7HSSs+reyD7Pd3dp9v7pvoH2fqM/bnJx03XLdtUsV7 mRfEna0w/H+j1fSJcfVXjShsXVg4rpCDlmuXUM2cIOFxq+ZQHCY+1+lTU17IJClSdH0g sAU4tzOsf0395pXkoW6Qc6sF17kpfDXvoETIM6yB1rIoERK2GwzzL5CyaPKJIMwMEZNC 9ulp8JnW1M7CWwfjvK5Q7kOBOpEYAwCyNfzmOgVcdvVivP0GnZO4FUXMF1pcCe7wBzOv oOpA== 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=jcBmHMiBVwE2xMsHc6iw+OLCN/lh62FczU8YMubCv7g=; b=m/IDuYk+PCFfTyTZqlGFB9QIPKu+S82uReD47HwanbssGsgx97N6GysWgIwFcgqNe2 tLFbbgEYniQ4oLsqiAsIp6ZZDMyqrKyrZWyxThK987ItdYtuNCeOc77uZrBxQfqm8Cav xbJceZnDMqT8pqPbfx4/ArBOGoQOUPFX0M24b1f/Aa7nulBvwqSVqAmBZQlO8O2ObmS7 T7amavXiIfVFO7tR8P6EiG0BSe+vltv3QJRACrUlY//FyfUszVT3sAVqk3svZ46c2Da7 2u9PO1t/zGHdD4gns8HsYeFNcdq0fatH4SydbZ1aHi7yN4y/1ytS4nRVQ3yUfWzdtEpg n0jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YzTFgDft; 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 pv12si13084308ejb.613.2020.11.17.05.12.31; Tue, 17 Nov 2020 05:12:55 -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=YzTFgDft; 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 S1729340AbgKQNIz (ORCPT + 99 others); Tue, 17 Nov 2020 08:08:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:37414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729305AbgKQNIn (ORCPT ); Tue, 17 Nov 2020 08:08:43 -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 F0EEC221EB; Tue, 17 Nov 2020 13:08:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618522; bh=sS86SemRb2alR+pEmD/6C1wS23+DvAvD3z8EL+3HJFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YzTFgDftsWg/QQfFe54Icn/Z4hFDW2xDDQPnDt6LAQ+NQ3Y0b2ytpdcKIRhuJv/1u Nqnshy1nNRav7F8xSYXQN+/dg8vIumWV7CzBhH6Fo3hcdl+kT6aGO2iHGgudpZq23o xK15iNYJoLQgODQK4z1pQg/uV6nEByNJApLUuorw= 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.4 31/64] perf: Fix get_recursion_context() Date: Tue, 17 Nov 2020 14:04:54 +0100 Message-Id: <20201117122107.684899636@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122106.144800239@linuxfoundation.org> References: <20201117122106.144800239@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 2bbad9c1274c3..8baa3121e7a6b 100644 --- a/kernel/events/internal.h +++ b/kernel/events/internal.h @@ -193,7 +193,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