From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 071DEC636CB for ; Mon, 19 Jul 2021 02:24:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B1AC60FE9 for ; Mon, 19 Jul 2021 02:24:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B1AC60FE9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1EB726B0137; Sun, 18 Jul 2021 22:24:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 174918D00FA; Sun, 18 Jul 2021 22:24:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F08216B013B; Sun, 18 Jul 2021 22:24:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id C56ED6B0137 for ; Sun, 18 Jul 2021 22:24:32 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5D01F181A871C for ; Mon, 19 Jul 2021 02:24:31 +0000 (UTC) X-FDA: 78377743542.19.10A7E1C Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf01.hostedemail.com (Postfix) with ESMTP id 259435011A9C for ; Mon, 19 Jul 2021 02:24:31 +0000 (UTC) Received: by mail-ej1-f54.google.com with SMTP id ga14so25929792ejc.6 for ; Sun, 18 Jul 2021 19:24:30 -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=9wzES5Rx2ZgzRi8sMt53q34HdjM7XoePxBK57UeE8d8=; b=J36+gfPPPmqsSoJjuFTqWEUpJXgmWG9bOuUDpbiS0u/OpAKPBeP1KG6Typ1hMF9tgw pTdpoZjE74JO3lopBR+7xX3lsERF2FyYaGeXW6TfJJ0TocBjxXiaUbQDtwrl/gouk3dp zL6nqKSkEhyV7SxuiHEteDiBG0wQwvehklTofwqGJYvk2vsIm6R0A3OJWpvPouVUzT/h xWRdBzoorFDGLq/ho08L3ZNz6OrY8pP7hGVPSjAupMLk+DybN231TrCB0wqbITnZYXlQ 2VRcOAP0iC7TxMwzUABdQWnxAZSD3tYiDIS2h77HKyIx3Pl9tB5oupUA1i3DQUrnxCm3 92Xw== 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=9wzES5Rx2ZgzRi8sMt53q34HdjM7XoePxBK57UeE8d8=; b=FUqfVNpdOfPgOq3CAs+SMW55whpRSQjfplhtBT7bt6bCS42OSdpLoUs+NJdo6gasKd CmvUX+kJl/YNuEJij4sNgA1xvlQJ7EB4WI6+VxqQQXjzUBPIjsvWcT6LjYNM5kRnrds/ sIUeFJ6/kKlGaMD8xDlejTaMt+JrWok00jXSiMrKjQF77/G7JHaCU4SUiX2O66+kVMPc wbym/e7byQpGli0I2R/RFfDYrHpY5hZQWWIORtOKEwZz4azH/DlEmAdbH2n0pLcaETrR 48L4NQvata7WMPzQKCzAw1cTKNAkK1KGb6H6nD2KgrMD6895/lXWYWKinjNGcW1t7e0n ++uA== X-Gm-Message-State: AOAM530LI0mfcp8ZsSt9De3NAA8ATvrK96gLTt2XTaEdJt2tn9L6wgvZ K0EEV6DexN3GC6oQMxdmGjmkvkm6G0Zq9AKW+R4= X-Google-Smtp-Source: ABdhPJzE5sszq/Y+IWCCXRX9c9YvB8skD0LzV6nAalA52e/wOO6vfaqzuxRWdK5sXIrcR1ePFBGLIr0Lhi9JsBYWMBQ= X-Received: by 2002:a17:906:1997:: with SMTP id g23mr24608539ejd.304.1626661469850; Sun, 18 Jul 2021 19:24:29 -0700 (PDT) MIME-Version: 1.0 References: <2245518.LNIG0phfVR@natalenko.name> <6698965.kvI7vG0SvZ@natalenko.name> <20210718215914.GQ4397@paulmck-ThinkPad-P17-Gen-1> <20210719015313.GS4397@paulmck-ThinkPad-P17-Gen-1> In-Reply-To: <20210719015313.GS4397@paulmck-ThinkPad-P17-Gen-1> From: Zhouyi Zhou Date: Mon, 19 Jul 2021 10:24:18 +0800 Message-ID: Subject: Re: linux-5.13.2: warning from kernel/rcu/tree_plugin.h:359 To: paulmck@kernel.org Cc: Matthew Wilcox , Oleksandr Natalenko , linux-kernel , stable@vger.kernel.org, Chris Clayton , Chris Rankin , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , rcu , Andrew Morton , Linux-MM Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=J36+gfPP; spf=pass (imf01.hostedemail.com: domain of zhouzhouyi@gmail.com designates 209.85.218.54 as permitted sender) smtp.mailfrom=zhouzhouyi@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-Stat-Signature: iuqc9rdpqyjwz1bysznriw4xriofdiwj X-Rspamd-Queue-Id: 259435011A9C X-HE-Tag: 1626661471-305838 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jul 19, 2021 at 9:53 AM Paul E. McKenney wrote: > > On Sun, Jul 18, 2021 at 11:51:36PM +0100, Matthew Wilcox wrote: > > On Sun, Jul 18, 2021 at 02:59:14PM -0700, Paul E. McKenney wrote: > > > > > https://lore.kernel.org/lkml/CAK2bqVK0Q9YcpakE7_Rc6nr-E4e2GnMOgi5jJj=_Eh_1k > > > > > EHLHA@mail.gmail.com/ > > > > > > But this one does show this warning in v5.12.17: > > > > > > WARN_ON_ONCE(!preempt && rcu_preempt_depth() > 0); > > > > > > This is in rcu_note_context_switch(), and could be caused by something > > > like a schedule() within an RCU read-side critical section. This would > > > of course be RCU-usage bugs, given that you are not permitted to block > > > within an RCU read-side critical section. > > > > > > I suggest checking the functions in the stack trace to see where the > > > rcu_read_lock() is hiding. CONFIG_PROVE_LOCKING might also be helpful. > > > > I'm not sure I see it in this stack trace. > > > > Is it possible that there's something taking the rcu read lock in an > > interrupt handler, then returning from the interrupt handler without > > releasing the rcu lock? Do we have debugging that would fire if > > somebody did this? > > Lockdep should complain, but in the absence of lockdep I don't know > that anything would gripe in this situation. I think Lockdep should complain. Meanwhile, I examined the 5.12.17 by naked eye, and found a suspicious place that could possibly trigger that problem: struct swap_info_struct *get_swap_device(swp_entry_t entry) { struct swap_info_struct *si; unsigned long offset; if (!entry.val) goto out; si = swp_swap_info(entry); if (!si) goto bad_nofile; rcu_read_lock(); if (data_race(!(si->flags & SWP_VALID))) goto unlock_out; offset = swp_offset(entry); if (offset >= si->max) goto unlock_out; return si; bad_nofile: pr_err("%s: %s%08lx\n", __func__, Bad_file, entry.val); out: return NULL; unlock_out: rcu_read_unlock(); return NULL; } I guess the function "return si" without a rcu_read_unlock. However the get_swap_device has changed in the mainline tree, there is no rcu_read_lock anymore. > > Also, this is a preemptible kernel, so it is possible to trace > __rcu_read_lock(), if that helps. > > Thanx, Paul Thanx Zhouyi