Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2202802pxu; Fri, 18 Dec 2020 07:49:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdseHrEHPN8B8Ce2CnLWkATtfp8EVqJ9DkC9BFBeJ3ChWzOBUIxwslNE5QCsNb/BgZ8vMc X-Received: by 2002:a17:906:179a:: with SMTP id t26mr4748455eje.49.1608306544557; Fri, 18 Dec 2020 07:49:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608306544; cv=none; d=google.com; s=arc-20160816; b=cvekNOF1XgDRG5ZcjregPw8vOBqazTg5ImkBj76GVBRCsCTqMRr/9fNGxR9ovXSDp3 qGKUDkVe5YZ/1i9af3HIvnn7GDIg/w6ilLqusqbDWw5IEQK7VrMW4Rijx06phahRl2aE rBngDVZFXcqw4VolFnE3DJG1Hp9QdFuL2SxEZwOE2zE/y4qQNPNcM+zyTy58fzblI5tb YARK9weE8SPFGWW+YU6MYPUxaMUTWtp3/l4TBQIHG6qqG7ql2/p02Ru01JzLosWeL/Ei hWuE/7ECuLJf1WXekPZHyFmzadTJCQS4pMCqdasTFXz7iNzGpfzQ0+G8NiLn92aczoyG 6CKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3fY7rhu2byKIO7aNp+C95hSj1ur1oOgkG2xd3B6qarA=; b=srSOp8hUShOmBt/zqzl3C6ut42cb68q11EpQHaeHGonoEmroC2l/GGQ8i12UyFt8yC r2M6gpl48qH09M7aTR7MGJcnWKViCWLcjNxAO06R/0GJWaWGfI7vb+mfQOiNjCEAzDE5 zZ3jUW9x5EabVmhzFCmHu3YqfwC7wgoxXbeKzNHUcZR+q8T9gq3HFbq6WDbmLkMEY2CZ VrQ31C4Ot8dhSrD/M03mi2XUBTfdXLwsvG6vNUXpigYdPBR0QRa/hS0wuuWx7RoIPtvH 04cQ5H9TQo9x9fKMjWxfq6TZrgxRHJ4dqcaYSjmc7uDspU+K/12L5u9zjwZ+8XAUN0FM Yhog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tmi60Kir; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gq1si3202419ejb.675.2020.12.18.07.48.42; Fri, 18 Dec 2020 07:49:04 -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=@infradead.org header.s=casper.20170209 header.b=tmi60Kir; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727425AbgLRPqG (ORCPT + 99 others); Fri, 18 Dec 2020 10:46:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbgLRPqF (ORCPT ); Fri, 18 Dec 2020 10:46:05 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 810EDC0617A7 for ; Fri, 18 Dec 2020 07:45:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3fY7rhu2byKIO7aNp+C95hSj1ur1oOgkG2xd3B6qarA=; b=tmi60KirVLb5y5nDcudkoAhfcW Mzm1qJsWe+9h7+11TU8ik31EWpT1hW0/asEZaqAYBWt90gLF0YW9kjmla8Lm0NJAQOBIYo9o6FJgr //n9Z666tOPakask96dEyQTAKH0Vjk4i2/wju3Rse+VFFnG7lIYlzXM32BKlXNQhpS3TgYNmVuDjb nCzUQuyZck9SlzySEJ91TcAhtBQcBeJSw603E3asu0hl2XB8jE7KAOsdJOuq3i0XqNXIPacjxGtNH iqDnQ+bfSG/bvhbrW/WnkwMZtccu4iTabui7nzeoz4JsJKj4ChtfuR/ozVrZwBRfm9HoukiAxaqyL YTOsLYxg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kqHwW-0002Bq-EP; Fri, 18 Dec 2020 15:45:20 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D28BC30018A; Fri, 18 Dec 2020 16:45:19 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8AB0220122356; Fri, 18 Dec 2020 16:45:19 +0100 (CET) Date: Fri, 18 Dec 2020 16:45:19 +0100 From: Peter Zijlstra To: Heiko Carstens Cc: Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Sven Schnelle Subject: Re: __local_bh_enable_ip() vs lockdep Message-ID: <20201218154519.GW3092@hirez.programming.kicks-ass.net> References: <20201215190152.GA22285@osiris> <20201215144724.40ab7612@gandalf.local.home> <20201216175259.GP3040@hirez.programming.kicks-ass.net> <20201218153356.GA7932@osiris> <20201218153716.GI3021@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201218153716.GI3021@hirez.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 18, 2020 at 04:37:16PM +0100, Peter Zijlstra wrote: > On Fri, Dec 18, 2020 at 04:33:56PM +0100, Heiko Carstens wrote: > > > Peter, will you make proper patch out of this? > > Yes, let me go do that now, and stick it in the quilt series before I go > off and don't think for 2 weeks. As below, I'll try and push it out to tip/locking/urgent before I really dissapear. --- Subject: softirq: Avoid bad tracing / lockdep interaction From: Peter Zijlstra Date: Fri Dec 18 16:39:14 CET 2020 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 --- kernel/softirq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -186,7 +186,7 @@ void __local_bh_enable_ip(unsigned long * 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())) { /*