Received: by 10.192.165.148 with SMTP id m20csp5033164imm; Tue, 1 May 2018 08:01:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqdznNpIJmZ2x9ZDLmOjGpiypm/rlYWLRrT9CnG51AoL3rLGQtMMzVxlbXU9XeuMmsJiJC/ X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr16719126plb.198.1525186896597; Tue, 01 May 2018 08:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525186896; cv=none; d=google.com; s=arc-20160816; b=1KLw98BtiXgeMyfzQDqZtHqD7Wvh9MXEJJFa+Jh5yRaZODGJUjCgsAUfmXxnQ7ta6V QXzVGBqOG8vCJWa/7WrnjKhWv0PMvg3gPdbTWAMkW6S+B4w0yVFerXqO5e8pPWMtx4xY IbLWUNIFmfDPAb4/jagCmakqq5SyhickSXNo6k3eljArdcJGVSTbW4FEeH8MSyKmUBaf fyj8r5fKLOos9AXTNMUdwUJP/zmJP0HwXMBe1DLVPTDmpbjot6oKlVdhiZPbxwEcGZGR erDep+258s5o3nsGhY5pcbVR9l88Bc8F/rMu7hAAhHdvgpGXBKB6JEiLLtSijfz06cju ANNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=ChBosbTcQpzhOa/x3i4qFqpglZH1tGw7W+mlqv5nTH4=; b=pNiuAMh3+lC2OH9DlzeNZRZ4ENcpw0z0hsw+WnuioqeHOYLpPbmOTT61krbxIi4JXP P1B6f36HdtpvskVua01dwk0QnNgCKXLMooncblbHZ4rkwZ2ccDm7dJZQEv8lHMGYx2bb jPPJP2zlDpRSiUV2KjyekOlzMIIJ/9bLaXO5osfc+16rt3Fi5BQVA/xO7ppUIKnwWaYh ixC/MGmlcB5vfaJrFAPzm0scrx/NG6o9Y25JVm9lPjlqKPzB0MDjxjr1n1qe7NA+/dK3 U6SHiFTdbAM6FgVKqiuX2aVXx7N1HqS27ndmvTeK12gmOLlTAxSOzaCnuAbi7mmQNyTz mb4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bLXAskiD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9-v6si7744021pgf.259.2018.05.01.08.01.22; Tue, 01 May 2018 08:01:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bLXAskiD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755443AbeEAPBK (ORCPT + 99 others); Tue, 1 May 2018 11:01:10 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:36831 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754749AbeEAPBI (ORCPT ); Tue, 1 May 2018 11:01:08 -0400 Received: by mail-it0-f65.google.com with SMTP id e20-v6so13402104itc.1 for ; Tue, 01 May 2018 08:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ChBosbTcQpzhOa/x3i4qFqpglZH1tGw7W+mlqv5nTH4=; b=bLXAskiDMKjWji66dQDSSi1bxiy5J0GEDM4sh4PQlqRehL6REMCALYSKzKh8G6ALG6 GuQorpUTHlLa/IIj632MbEtFGBhsFCIKywT9w+DTWxjjxWJlX/55NrlbWhMo4V6w76fJ hDny1j3yrkRgzgmC1qE2ylJ8Q2VZv1sEtAzzlNMNGkOFRvYO2xIaj8llVjaAqapPGgZz Ff1riptI/ei/eLL7vKThDFaK/23W86KEb+d+BYmwvILkx5El63EfpLU3UF97EwwBpxF5 wNcKBbtFZtRiGcR8+I2jy3czCvs9miIye6RnwOeCYnp4EKFqh/jHhlKChG2snSEOkmx2 5+jQ== 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=ChBosbTcQpzhOa/x3i4qFqpglZH1tGw7W+mlqv5nTH4=; b=cen2jJjY2ICg41XzHLeAEaNNrUdl7XtVEFj7d1vd9AY910afgGcPMKTFqS66/WAnF1 Wncy2ngt9NJn06U0Ka0ffxViYJo8eQGN/WICBAIwN1wJitTz5Ggo6HfYZ7zHwSy3Wit5 t04M5l03znTE3grg6tCe1Tf9H+ZVK+/ASRsVbLRAh8f7HVVpHoEIwdUyO4p+I8RM26qD RS2cXBvRHHtos70sRiHgQ9Elp/Jlv5tKqV5zXSCiiaJfi+TBA7PePLNpbGiFG3HfeETz /IKVLyWqXO1dU/hpVZ+bVUnAVg807kn86RffEQM9XayR63CXk2GJ15ZFtqYRklysGhjB Dc/A== X-Gm-Message-State: ALQs6tAF8s25Iu7x+XxC8iGWhekqDs01TcyEf8YneBG6wiFqLH/0UhGU Gr/R5AqfEqK6gKJp1PtcVWmTLngzCcyxHGk7dF40cMlp X-Received: by 2002:a24:7ac7:: with SMTP id a190-v6mr17259510itc.151.1525186863886; Tue, 01 May 2018 08:01:03 -0700 (PDT) MIME-Version: 1.0 References: <20180501014204.67548-1-joelaf@google.com> <20180501014204.67548-2-joelaf@google.com> <20180501100210.32181f48@gandalf.local.home> In-Reply-To: <20180501100210.32181f48@gandalf.local.home> From: Joel Fernandes Date: Tue, 01 May 2018 15:00:52 +0000 Message-ID: Subject: Re: [PATCH RFC v5 1/6] softirq: reorder trace_softirqs_on to prevent lockdep splat To: Steven Rostedt Cc: LKML , Peter Zijlstra , Ingo Molnar , Mathieu Desnoyers , Tom Zanussi , Namhyung Kim , Thomas Gleixner , Boqun Feng , Paul McKenney , "Cc: Frederic Weisbecker" , Randy Dunlap , Masami Hiramatsu , Fenguang Wu , Baohong Liu , Vedang Patel , "Cc: Android Kernel" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 1, 2018 at 7:02 AM Steven Rostedt wrote: > On Mon, 30 Apr 2018 18:41:59 -0700 > Joel Fernandes wrote: > > I'm able to reproduce a lockdep splat when CONFIG_PROVE_LOCKING=y and > > CONFIG_PREEMPTIRQ_EVENTS=y. > Needs more info in the change log. It also requires that > CONFIG_DEBUG_LOCKED=y is set. > Add this to the change log: > The issue was this: > Start with: preempt_count = 1 << SOFTIRQ_SHIFT > __local_bh_enable(cnt = 1 << SOFTIRQ_SHIFT) { > if (softirq_count() == (cnt && SOFTIRQ_MASK)) { > trace_softirqs_on() { > current->softirqs_enabled = 1; > } > } > preempt_count_sub(cnt) { > trace_preempt_on() { > tracepoint() { > rcu_read_lock_sched() { > // jumps into lockdep > Where preempt_count still has softirqs disabled, but > current->softirqs_enabled is true, and we get a splat. > This patch should be separate (as you had it before), and needs to be > submitted now because it already causes issues. We can add: > Cc: stable@vger.kernel.org > Fixes: d59158162e032 ("tracing: Add support for preempt and irq enable/disable events") Ok, I'll split and resubmit with your reasoning in the changelog. Just to clarify, my changelog was based on older patches, that's why the reason appears different but the root cause is the same. In an earlier series, I was doing lockdep_{off,on} around the rcu_read_lock_sched call so that stage wasn't splatting, but then after the read_lock is held, the tracepoint probe such as those registered by preemptoff tracer was acquiring locks and causing the same splat. Anyway, this just for some justification of why changelog appears to present a different scenario with the same fix. But I'll change it to yours and resubmit with the tags, thanks a lot for looking into it, thanks, - Joel