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 87C55C636C8 for ; Mon, 19 Jul 2021 02:59:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2A2EB60C3F for ; Mon, 19 Jul 2021 02:59:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A2EB60C3F 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 984EB8D0101; Sun, 18 Jul 2021 22:59:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 935248D00FA; Sun, 18 Jul 2021 22:59:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D5CA8D0101; Sun, 18 Jul 2021 22:59:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id 5A2748D00FA for ; Sun, 18 Jul 2021 22:59:16 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 02A7523E41 for ; Mon, 19 Jul 2021 02:59:15 +0000 (UTC) X-FDA: 78377831070.14.E4A61BA Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by imf17.hostedemail.com (Postfix) with ESMTP id BB7BAF00038C for ; Mon, 19 Jul 2021 02:59:14 +0000 (UTC) Received: by mail-ed1-f49.google.com with SMTP id dj21so21921840edb.0 for ; Sun, 18 Jul 2021 19:59:14 -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=nYVwyV2u8gzZBQODuuL7mZYv5EOHG+se5X56gjvhVXE=; b=SsYjEoFuizERfhFl5Tci5jvZbYST2y97nSOPA/5WBm074B3608+v1ejOxkTL3B33b/ mWpODtNYXyVnOLRYUKbe11Wwy4pJE3YMEBjlVlJHeKnpTHl58dP7V9EunCUCxV7xHlx2 nQijqxGcBr6SHPlXIEOMsjI0QVZhoBxLxc4JtpJjRU+Cxe9YZE1QfUTx4yAfPmTnW4Ep VJJO+K9pUPzJBtavUZ0wu+yBQ970JJbPpt7dLfQ/KvY30OT0vE2L32vHVfwTAi4PcpPN gkKuFvhCqzBUdkd9HumC+yl/PCcydP5xjv9qIn79XgRJ8jjPHrmT/XuNtzAZ/wFwLopH a8CQ== 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=nYVwyV2u8gzZBQODuuL7mZYv5EOHG+se5X56gjvhVXE=; b=D9qNgznpoDfHScOYyENVvt+b+GO8vM9sOjhP5NSSDeFj56TfT8JmLQNz6DSO50jPT5 ikuGWqNppqca43S9NkV5f+RYJA4xED6M3eKf4YaV3oKi5e0l0CmOXpxjBNYe5ILZheGl CRRRKBfG6UBARiNynDfB6PNIReiaDSDWJMxO2Jbm78FR8sMW8qCw8fvcJdJYpPOikZ4e 3pKdRg0a2RMOfafgcj+7wNoKgDqoacg9T4DaVs9o+l5DSDVShSq8w01cOsPicLH6b3cd vcHRhyGdBji6IMdAG0pR5LYpS7tkjYc4JNjsS4HeCGFfPciqnx9cJ82kz17FIyl/PQrd zdEw== X-Gm-Message-State: AOAM532MwgEloibzyRzZHW6Wf1+uVh89qAGJ8/yBU7uKYguuWECezHGu T5Dp50OG+nbMWuHW4XlNIlSBpN5mZljCZfEQxkI= X-Google-Smtp-Source: ABdhPJxSSKb79/S9KJ9skDqnDIkFKdKt19bv9pTS7aYFsq0K6EQF7spJo5XbpBWa42Zv96DgrV9EkbaqwPB1746h47A= X-Received: by 2002:a05:6402:3192:: with SMTP id di18mr32589202edb.186.1626663553733; Sun, 18 Jul 2021 19:59:13 -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: From: Zhouyi Zhou Date: Mon, 19 Jul 2021 10:59:02 +0800 Message-ID: Subject: Re: linux-5.13.2: warning from kernel/rcu/tree_plugin.h:359 To: Matthew Wilcox Cc: paulmck@kernel.org, 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: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=SsYjEoFu; spf=pass (imf17.hostedemail.com: domain of zhouzhouyi@gmail.com designates 209.85.208.49 as permitted sender) smtp.mailfrom=zhouzhouyi@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-Stat-Signature: mrfskuimf7s543nw9b71x6qxi4jat1c8 X-Rspamd-Queue-Id: BB7BAF00038C X-HE-Tag: 1626663554-893642 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 10:44 AM Matthew Wilcox wrote: > > On Mon, Jul 19, 2021 at 10:24:18AM +0800, Zhouyi Zhou wrote: > > 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. > > Yes, but the caller is supposed to call put_swap_device() which > calls rcu_read_unlock(). See commit eb085574a752. I see, sorry for the mistake