Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2216450pxu; Fri, 18 Dec 2020 08:06:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0HlVfwEmFXSui8Fk8wd8zQq5Pv041Oyh1QmOeZy6BuJS3jxlep8VepJ1JL6jUzFPGrTWS X-Received: by 2002:a05:6402:1d3b:: with SMTP id dh27mr5174959edb.238.1608307572240; Fri, 18 Dec 2020 08:06:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608307572; cv=none; d=google.com; s=arc-20160816; b=AvnE40PIRrTi2Onn8aIU2zLUGX0GxrGITEF8Q7VRivovxqxU5WVkD1NMjx6EhpxLBN GpUSpuJ+M1IYLeDe0F6C+CNKW4gR/LQVKgZ3Ewfwcurx8eixyQmBoijkWwekJobZS2rH RzCbfVG/J/0wCuFm/QhYCv7Otgo/HGLYYWFhUcd3PW81BwU1GARPW5z2If0gIiVUou3z BZql14vZIo6n8hVfv0wE7jx2C8MIHltBif8y1ARoi0zVM3LavitAHuZ24glDvTJP7E7E bvDJiDRmdALdyL0jB32h26uqG2/KeIJJROmiuHYBO2xPZuqrSkAHArFA6xupMXXdtHqs ikWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=QMA1NUzrroNV7wtgygwVjEnPBuryv0pd4k2lZpO2Ol4=; b=xEIcxGiWnxkfdbaCh8iLA+ZmvGQwH3M3R5Xtm49H2VK2UE21lCKcw/9wyRggCbZVry E8MQ0BE0SFqs+NtUyqG+zXwEOe1S+q/Qre5tG3kDlSzJ53K181RpgxXOICEp9zjYaLC+ D3+6ZyqPAGq/d++V8OuHsOQ8kV3jlkGC7TMJkHmb2/SN5Si7ZBvJy+wUNQYPENVeqz0o qg0EhoTxtFSw699Uh/L2UK36USKGtbGghKBUbs/cHG58cIYhQ+6sMPkex4JIp61d7EdV gwQCJjyZkq4RuXpmfh8Uc7VPXxCxVWiV7xWEKwC3dnQ66CTsGmAP+Ij72b/bvjNNFavT lqoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="D7/27Uy/"; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si6377778edy.318.2020.12.18.08.05.48; Fri, 18 Dec 2020 08:06:12 -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=@linutronix.de header.s=2020 header.b="D7/27Uy/"; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728981AbgLRQDQ (ORCPT + 99 others); Fri, 18 Dec 2020 11:03:16 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:53254 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728558AbgLRQDP (ORCPT ); Fri, 18 Dec 2020 11:03:15 -0500 Date: Fri, 18 Dec 2020 16:02:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1608307353; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QMA1NUzrroNV7wtgygwVjEnPBuryv0pd4k2lZpO2Ol4=; b=D7/27Uy/t0uz4hoOOmX6b/1GvDuBIIe1YvuuNq+xcOye7+cSsGNaDqqJJalCbxddKc3Vi2 yPa4KezZUT58sb23Lsq5QwxmeLR35ljgSCpyVD9KuxfhJvebjRFWX8klpJw70SqbZfZz/o LDG3liK3Br5MvwtAlfOp2rIk4ilANtU2znmHq2zA7ouWWPmST4Mdaj47aToGdHFdVJ+hxv UB+YX4cyzppISzJM8C9Vk5QgTIdUTz2i1e4D6xWHQ76Zqub4vYOHV2xy75D+5R7rEz82iI VhrkPjvL1E+IbJCXN8Y4anfAdgs72CZsHk0/dklJdk8Bj4lzRjTdbBSpHARgMw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1608307353; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QMA1NUzrroNV7wtgygwVjEnPBuryv0pd4k2lZpO2Ol4=; b=tLD5MfopoD0pwqv/fjz78dF7Pega/lD9G8S/0JYwUxrOsJG1dyMFjfP+FDCvx7pLD65RRa 0tWqOFegRNqXAPBQ== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/urgent] softirq: Avoid bad tracing / lockdep interaction Cc: Heiko Carstens , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20201218154519.GW3092@hirez.programming.kicks-ass.net> References: <20201218154519.GW3092@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Message-ID: <160830735281.22759.13387853459689261658.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/urgent branch of tip: Commit-ID: 91ea62d58bd661827c328a2c6c02a87fa4aae88b Gitweb: https://git.kernel.org/tip/91ea62d58bd661827c328a2c6c02a87fa4aae88b Author: Peter Zijlstra AuthorDate: Fri, 18 Dec 2020 16:39:14 +01:00 Committer: Peter Zijlstra CommitterDate: Fri, 18 Dec 2020 16:53:13 +01:00 softirq: Avoid bad tracing / lockdep interaction Similar to commit: 1a63dcd8765b ("softirq: Reorder trace_softirqs_on to prevent lockdep splat") __local_bh_enable_ip() can also call into tracing with inconsistent state. Unlike that commit we don't need to bother about the tracepoint because 'cnt-1' never matches preempt_count() (by construction). Reported-by: Heiko Carstens Signed-off-by: Peter Zijlstra (Intel) Tested-by: Heiko Carstens Link: https://lkml.kernel.org/r/20201218154519.GW3092@hirez.programming.kicks-ass.net --- kernel/softirq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index 09229ad..0f1d3a3 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -185,7 +185,7 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) * Keep preemption disabled until we are done with * softirq processing: */ - preempt_count_sub(cnt - 1); + __preempt_count_sub(cnt - 1); if (unlikely(!in_interrupt() && local_softirq_pending())) { /*