Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2194746pxu; Fri, 18 Dec 2020 07:37:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6OzlzLn+OPx2P4/TVVJC9EP8fE5nNIsRMPhuG1zQ5ElXS4zy+97AzjX1DQ0kReOBy6sA2 X-Received: by 2002:aa7:c98d:: with SMTP id c13mr5119356edt.188.1608305864258; Fri, 18 Dec 2020 07:37:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608305864; cv=none; d=google.com; s=arc-20160816; b=W5LNf0srhIrf37iUaNPBxx7b8TFGIP3Ax+JF1FLn1xbiw6aPBUMoCuHNdz11rYEYtr nw4ET4EjkkW+YFVKP61Nm9S4m4cNJd6Jo7lpWld4eROW84FqeXJ0EuFHYDAhwGpbYzSr LFWzp1jLZEUaGfGdqtctB5OP2UQUwGop547eSy6DIfZJ9yDK6drV8ti1BcPmcM4NJ32R ZxpE+6+Nz86ULZrBVzB9JrGSZSXIuSuVUt4BNaCLJ7j41dsTAhorcUMB3i8omZidZDD2 XYvIkz70XgRt4Q6MopQ0oANlb61k3ORxzPu8tHZArKtb9TrwzYagkkpYh5PLx7eIttfB 5U+Q== 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=Srtr7qwQQHkels5ZLJ6Y+5ScWqzwJp6Xx2JhGqHqj+Y=; b=W9NFAkuR3U1IQoVFl+jQFCeBTZMvHRRZx/LltGDq0kIhtuy4hnjbh04ri6RNtpzCrq 7LT9UYuLfWb4mDGjQo28UMJjMpixMS1RfOePK+t3PlDd7FUJr/VfF8eIhTSichFiSUDM 1ez+7J9YzC3AbbImM1WWhchqOlhMDxsG43aNZKy8tzHfhT72sFxazMCdQKQZiEqQLxuA 54MkzaBV3XGWU7e36zRIdJ5MkGY6Bnf+N3r68JZmJ9SnhBabNpW1DMGMhRYwYqQCY5Zh 71JOlR42XnXiEYtfmXe8R1hDyy1gy0DL07biSUTDZ61CRxOf3mvD6mGJ8+SlVGpnB5sP aTtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QmJQwBiG; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si4739054ejy.167.2020.12.18.07.37.19; Fri, 18 Dec 2020 07:37:44 -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=@ibm.com header.s=pp1 header.b=QmJQwBiG; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728630AbgLRPfe (ORCPT + 99 others); Fri, 18 Dec 2020 10:35:34 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:16496 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726581AbgLRPfe (ORCPT ); Fri, 18 Dec 2020 10:35:34 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BIFWrbq154446; Fri, 18 Dec 2020 10:34:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=Srtr7qwQQHkels5ZLJ6Y+5ScWqzwJp6Xx2JhGqHqj+Y=; b=QmJQwBiGIRpRN6FzdP/7Hb5VMbVCi7s2gKyYuYeq2ZEKaAqxC/s2vaZWzyhXgFbJImW4 SfYl0PlpX+J4tefQdBG9cLQh9j3gIl9FEIr4gntYbc0TN1qnnaitrYkyZxWm2cknWLP5 n8I1/m1T7X1k0wWL62DE8ENXrEKb0K3EDU+VPFkrsP0kCUbp4OheLaMm3XD7Em5F58cW SblMw2I4ULgQ46XuZ80/JfOdgskfnihujLkZJDvXJr7SS7Acoq8FcWuVPZlldUdRIv3t eyRikR47yAZfeiJG2PG4iDG3mIccUAKMWVKsBwJhjMsq3wtblDA6fuEIWVPh7JAEniZE jQ== Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 35gxv98nu7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Dec 2020 10:34:02 -0500 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BIFWmQD018037; Fri, 18 Dec 2020 15:34:00 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma05fra.de.ibm.com with ESMTP id 35fmywh2km-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Dec 2020 15:34:00 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BIFXwfB45220238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Dec 2020 15:33:58 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 64927A405B; Fri, 18 Dec 2020 15:33:58 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1CA58A4054; Fri, 18 Dec 2020 15:33:58 +0000 (GMT) Received: from osiris (unknown [9.171.24.198]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 18 Dec 2020 15:33:58 +0000 (GMT) Date: Fri, 18 Dec 2020 16:33:56 +0100 From: Heiko Carstens To: Peter Zijlstra Cc: Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Sven Schnelle Subject: Re: __local_bh_enable_ip() vs lockdep Message-ID: <20201218153356.GA7932@osiris> References: <20201215190152.GA22285@osiris> <20201215144724.40ab7612@gandalf.local.home> <20201216175259.GP3040@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201216175259.GP3040@hirez.programming.kicks-ass.net> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343,18.0.737 definitions=2020-12-18_10:2020-12-18,2020-12-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=665 adultscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012180107 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 16, 2020 at 06:52:59PM +0100, Peter Zijlstra wrote: > On Tue, Dec 15, 2020 at 02:47:24PM -0500, Steven Rostedt wrote: > > On Tue, 15 Dec 2020 20:01:52 +0100 > > Heiko Carstens wrote: > > > > > Hello, > > > > > > the ftrace stack tracer kernel selftest is able to trigger the warning > > > below from time to time. This looks like there is an ordering problem > > > in __local_bh_enable_ip(): > > > first there is a call to lockdep_softirqs_on() and afterwards > > > preempt_count_sub() is ftraced before it was able to modify > > > preempt_count: > > > > Don't run ftrace stack tracer when debugging lockdep. ;-) > > > > /me runs! > > Ha!, seriously though; that seems like something we've encountered > before, but my google-fu is failing me. > > Do you remember what, if anything, was the problem with this? > > --- > diff --git a/kernel/softirq.c b/kernel/softirq.c > index d5bfd5e661fc..9d71046ea247 100644 > --- a/kernel/softirq.c > +++ b/kernel/softirq.c > @@ -186,7 +186,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())) { > /* FWIW, Tested-by: Heiko Carstens Peter, will you make proper patch out of this?