Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp115992pxx; Tue, 27 Oct 2020 23:23:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQCX8mr2/dIqaAkfkIJmv2qL5CjqXISCC3vnl7cd4MHl8ukaFb/nxN0kYsegfYgUAKKsIC X-Received: by 2002:aa7:cd85:: with SMTP id x5mr6448291edv.0.1603866211058; Tue, 27 Oct 2020 23:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603866211; cv=none; d=google.com; s=arc-20160816; b=Cs2lzkATAsWZwjuFNwaOsa8jEgu39yHnwoe4aDrV7iW2uDdhO6MebByDS0s5f1lx0m X0x0+bx4+8iUHCMGYqhRqTORwOS/GG9rFB6Kz3P+t6MzQGLrww5RdtxKvVznR2jlwFZZ 55GsRDTzk2jcqWlPVbRjjsTufKKGJCbQ1x7g4A+jFLBBpt2sU4teJ/pybEodYP7uWGDC AmBrCXNqP1xzwQ3uWKIkKzZduHVIX/0QKADk35eL04djIJHkkLW3+2pLarRsvbQByFep DcxdSeXpt/VQUh566Ml+Ew6x2mqZH+5zFnzrP7+vhgtr9v5DBTD3ilXgDbgJM+VicxGE T9xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=EoN33UgcFziWWiQ4PnBVNhZP5pXbQCgzUb9zsOxzaek=; b=pUad9IYg+Lc5OC3Mg/8lt6/Cw4lKLKFWaq3GUF6ppkouZs+oSMwQuQhj4rFqk5ftHd sp4V0eaawFgNySVq2ukIYpN0KPv2x/KJHQPFAxKFJWu67bZbN39hKuEb3S9Iq4zQ7gkX XwI0OzfCX3tIjbNrzy4+/J6PoKaRFHQYgLDuliM0X82eSvTjZrFTOb9Kh6nOPAjDGEie FAu73gvDGoVmDrbyP6LoCUju4wuq8khx6ml4DQz9epTD++wv8LXMU06UZdil8Sma611R eOiNm3KROk2l0Yf8rwysNYsKUB6580UHc3qm5IOpehMxrm2glWUtW8rQ88kDRmRH1OnR Scyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=m3oiTCTd; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs11si1976443edb.24.2020.10.27.23.23.08; Tue, 27 Oct 2020 23:23:31 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=m3oiTCTd; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2895974AbgJ0JtV (ORCPT + 99 others); Tue, 27 Oct 2020 05:49:21 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:43600 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2895968AbgJ0JtV (ORCPT ); Tue, 27 Oct 2020 05:49:21 -0400 Received: by mail-yb1-f194.google.com with SMTP id d15so692605ybl.10 for ; Tue, 27 Oct 2020 02:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EoN33UgcFziWWiQ4PnBVNhZP5pXbQCgzUb9zsOxzaek=; b=m3oiTCTdji6IvQxnLYvCHd8m57mQNKKf1qrsXcP2EKUZis+8+nzcNkX1bzdpt9/pnn EsDh2YrPJ4+53nJ6bjkecTfDxu/7jcHJVGwMHjsSUBql7MasdHoFGjOJqRfya3MalFNT Se2zF1NimiKx8R1NPMFAmsgLiDp1d/0rsm9H+YyDoTlgvk6LUcqCcUmTir5lAcgUrxAt ylbtlPW0s6DyDiUYvIntKsQUtUAA6GswRsb0XPwwQw1QnM+SzFNkT1n+E4NIOrUVq3Ip M6G2jE3WabJs078e/c5lGJJoJF24KLMQHxnzCkBNvMVP+TFfzW7Z4mKeEE5IrxoDn5Bq nhPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EoN33UgcFziWWiQ4PnBVNhZP5pXbQCgzUb9zsOxzaek=; b=jen5A+HkxkJ4zEdy6SqRHh0gUT1uqyRtdJb/tP+eHa92wQvfSOOw2hB/0pGpaNBF3H mg1pedSpGHvRz19eXkHxYOHQzbjNdHbHBQIEdROft48V4lJY0Wf8n+6TtDpDKOPaR/Kc UOQRSgktq9KXZx+uicdQmiLuDY/namr6o50YT+ZdRydcxDYHd7DR4qz3rBU14Zrx0x2p yFNNVedTHT0XtfFg7nVQ7w1o7z9NhvDaLIpKwBO1qzQAWHOfKrQLHzUcfxsFgbR5tSi3 4mAfpPytzlVMAgSFmsiGwoQcrwrMamLrjUAxQC9ul7xaycwtehMQPoC405YyEkEp5kST 338A== X-Gm-Message-State: AOAM531aDHrP9cOzcqvNkhsvY+n4ZLD7y70FYgdDW2BzwIhOFML1nBYn CSAgZJSw6F3zedLq8tV++AMgqRRSvU9oXPTUbe0= X-Received: by 2002:a25:2389:: with SMTP id j131mr1833294ybj.25.1603792159885; Tue, 27 Oct 2020 02:49:19 -0700 (PDT) MIME-Version: 1.0 References: <20201026114009.GN2594@hirez.programming.kicks-ass.net> <0c0d815c-bd5a-ff2d-1417-28a41173f2b4@suse.com> <20201026125524.GP2594@hirez.programming.kicks-ass.net> <20201026152256.GB2651@hirez.programming.kicks-ass.net> In-Reply-To: <20201026152256.GB2651@hirez.programming.kicks-ass.net> From: Anatoly Pugachev Date: Tue, 27 Oct 2020 12:49:10 +0300 Message-ID: Subject: Re: possible lockdep regression introduced by 4d004099a668 ("lockdep: Fix lockdep recursion") To: Peter Zijlstra Cc: Filipe Manana , LKML , Jan Kara , David Sterba , Ingo Molnar Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2020 at 6:23 PM Peter Zijlstra wrote: > On Mon, Oct 26, 2020 at 01:55:24PM +0100, Peter Zijlstra wrote: > > On Mon, Oct 26, 2020 at 11:56:03AM +0000, Filipe Manana wrote: > > > > That smells like the same issue reported here: > > > > > > > > https://lkml.kernel.org/r/20201022111700.GZ2651@hirez.programming.kicks-ass.net > > > > > > > > Make sure you have commit: > > > > > > > > f8e48a3dca06 ("lockdep: Fix preemption WARN for spurious IRQ-enable") > > > > > > > > (in Linus' tree by now) and do you have CONFIG_DEBUG_PREEMPT enabled? > > > > > > Yes, CONFIG_DEBUG_PREEMPT is enabled. > > > > Bummer :/ > > > > > I'll try with that commit and let you know, however it's gonna take a > > > few hours to build a kernel and run all fstests (on that test box it > > > takes over 3 hours) to confirm that fixes the issue. > > > > *ouch*, 3 hours is painful. How long to make it sick with the current > > kernel? quicker I would hope? > > > > > Thanks for the quick reply! > > > > Anyway, I don't think that commit can actually explain the issue :/ > > > > The false positive on lockdep_assert_held() happens when the recursion > > count is !0, however we _should_ be having IRQs disabled when > > lockdep_recursion > 0, so that should never be observable. > > > > My hope was that DEBUG_PREEMPT would trigger on one of the > > __this_cpu_{inc,dec}(lockdep_recursion) instance, because that would > > then be a clear violation. > > > > And you're seeing this on x86, right? > > > > Let me puzzle moar.. > > So I might have an explanation for the Sparc64 fail, but that can't > explain x86 :/ > > I initially thought raw_cpu_read() was OK, since if it is !0 we have > IRQs disabled and can't get migrated, so if we get migrated both CPUs > must have 0 and it doesn't matter which 0 we read. > > And while that is true; it isn't the whole store, on pretty much all > architectures (except x86) this can result in computing the address for > one CPU, getting migrated, the old CPU continuing execution with another > task (possibly setting recursion) and then the new CPU reading the value > of the old CPU, which is no longer 0. > > I already fixed a bunch of that in: > > baffd723e44d ("lockdep: Revert "lockdep: Use raw_cpu_*() for per-cpu variables"") > > but clearly this one got crossed. > > Still, that leaves me puzzled over you seeing this on x86 :/ > > Anatoly, could you try linus+tip/locking/urgent and the below on your > Sparc, please? Peter, let me test first. Thanks. PS: sorry for the delay, a weekend and got ill a bit ...