Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3348478pxv; Sun, 18 Jul 2021 20:00:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWGo+h9gxCkRrCW6epxW3zbzNBpYztrG+IQ3DKmiD1Y5ApZpGz/eIzviMgt0meLf/P2f5G X-Received: by 2002:a92:b748:: with SMTP id c8mr15450512ilm.302.1626663602095; Sun, 18 Jul 2021 20:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626663602; cv=none; d=google.com; s=arc-20160816; b=rpQcI/6+89lSU+kC2qwxikoOXiXrqT09VPenLIi8f7V0XhcICZzFKieuF07BRYCAI/ 6czAzCt+uqmdQcF+nNpzO4U02RvsxHIgDkvhGLTbY4uVkgYOnJCuJ3sDA20Z39tjJRdJ ymR88jkl6jnd/Euwg1JZ9RyAI/yh7Linj1Ss0FdC5RuUzXqRqR6FxGITvP4IcwVzHacV rdOV1qLLFM2Iz0DRXtb54dRwase6n5BG9C+NKe2lhnC4N6s/8X5gzJE28UWxKb9ZEGRJ lYnk1pdN9P3QcDggAuIWJ9mGCDJEG33g0X7QJg/h7ZzSv1M3cG5cQT8bDWnh+swpo9H6 3z/Q== 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=nYVwyV2u8gzZBQODuuL7mZYv5EOHG+se5X56gjvhVXE=; b=qS6idaoSv0sO4y92q0F1haFml4DSbbqQEj8ueMYuSeGgLrngxXAAWkXVcRJvgNncrj XEV2r30oGA6za67Geoty8O15ghPqmw4S49c28HPjFrr0njCgfh4Rk8MUJ94w45NV016n eS2MKGm9WLPSYbfVDEnJn5lwkjZaS9WKLC5PKp4mA50ckcnBHp2Dk6cDCv0DYqBWWjdP 5p292xRv/552XpOMzVcP6onXQ7xqcwCetwHpG4MtKICUn++yMpQ9RQ8cFiC83gFd0BhF Ggjfo6y39q+7Oyp4TZPG6kb5lT7Kio0ZCtSl8AqCiVKg7e5va3jrr5gC1JSoMGL8oJIM XzZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SsYjEoFu; 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 x1si20577412jan.58.2021.07.18.19.59.50; Sun, 18 Jul 2021 20:00:02 -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=SsYjEoFu; 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 S234171AbhGSDCP (ORCPT + 99 others); Sun, 18 Jul 2021 23:02:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233720AbhGSDCP (ORCPT ); Sun, 18 Jul 2021 23:02:15 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13DB5C061762; Sun, 18 Jul 2021 19:59:15 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id k27so21814301edk.9; Sun, 18 Jul 2021 19:59:15 -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=eZhYYHxfcdliWHxMoPfLh5RY2yYpZXVOoKUn7JqQSaMubNRJS/Y/cTA0qetD9dQUW1 k+nWJsbRWTYSwahkNKeHHvuPYYV/eG1GwmH7SqOoPYv/qtaYEUF7as5BGGUjYjwMcRUs hdh4kfocxGNqHEA9Mgx3RDSlHNgqgvZx758mlSdh+P3HiEvQfF2YQrQeCa/sPipbBuKA iLS9udPle5M/8scxQ7Db8VgvKtxM4/oNsBTHi12SBeRrSo+Vxjf1GXcbNBkkrhcNr+zj nBJzGjrTYygOMpyni2ouQ8FMDdGRSYX/ZHyvanbpcgmZ9g4iYaT3m2tMM8UAFJ/9HFIE Qlog== X-Gm-Message-State: AOAM530vAhDi0Pe10HC6XV5+rLq7cN/2evDo+xCMkdNFXiYvCKHDU8PT 2s7B9ONFgdrdps/k+aCv8DVcHkLh8pPwiLsEFrY= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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