Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3343098pxv; Sun, 18 Jul 2021 19:46:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGezUvwaVZ+AKDoSLcWdvOhMMkU/rop6Kc48cq4Y/bLYou6f5IK9R8nuhPwIJ8COVXjT/I X-Received: by 2002:a17:907:1b29:: with SMTP id mp41mr24758822ejc.459.1626662785909; Sun, 18 Jul 2021 19:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626662785; cv=none; d=google.com; s=arc-20160816; b=SMCHu1jk2Z8QJBfW5riywBFoi7R+53NII6NUNFnCtPMNy3Cv9urBaAM4+KROdjc8B2 frJRUExRZ4ELX9gYdvfTi0JExdQ0OrDSDK1zwipwCV6+efrItKllJOcXysu5gEQqvCWs KBBVYs1+KZ53bgdlNxdQsMOpZZyYx7eVLZpUjS10gIkKyXr83/7jTLsXiRUp4tA2/9sp 42IP6K8aOg4xQSxXU6rVTilB9YOqNVvOQoX5BN1HgCQrIR9dh9qKY6FaMcMkZL4szD36 FpNh1rwCYK8S87sO+x+5j7HyhGNjCaOBiBFlkUhN2VyHEET9GRtcAvjkGNTg1zVeBYia RtKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CkU8nVUDnffLrkz4DUK+GmPmahjzgRndjrnRCR8YauY=; b=gBQUO/pOvybf+Q0P/I85PHsZFyK18cq/ku3aBJcR4vzbQMwgMbCIblY429LiJRSPml tCsS+9Xjx2LtH+y90SWsNmPlLGD/HQX4RuiYsPLxKTWoZapABpJttFR2otA6Kmr81G4R OH06Oqy5zvv+oNXKpZaZ3MDlSCOdtM9M7pGpOrjYcAtBkNy+nX+2rFgWxP4hWI4dBMGe dTeJ6bIDgOwXmIE9bdtBlQAVxr1l4vjUUPsWwYLTV5uZZMZxbiE3M0WfPjwN9ce8kbQR eSI3Zqz+Z46vWch9vDlijKVTG5sQnuAVq7NlpzkEle33/OOi7YGGSpDTIySqFcyb+eIb oKDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UFffVny8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si22589407edc.560.2021.07.18.19.46.03; Sun, 18 Jul 2021 19:46:25 -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=@infradead.org header.s=casper.20170209 header.b=UFffVny8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234303AbhGSCrf (ORCPT + 99 others); Sun, 18 Jul 2021 22:47:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233720AbhGSCrf (ORCPT ); Sun, 18 Jul 2021 22:47:35 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25B9CC061762; Sun, 18 Jul 2021 19:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CkU8nVUDnffLrkz4DUK+GmPmahjzgRndjrnRCR8YauY=; b=UFffVny8+0I97DD+4Ofigd11P7 zDhen93BvIB5vb2XX78j/xX10LqnrvRjWNwN2sfNILyJDpI7D8/RVjukpSN2KsiDHJPclj9cXikm7 U1Yvzoj0zF0KHxzcGslUsLsG2GHoRlko377Dxo+VHw6u1oY2B37wjHCkVX6n74Q8lzI0LXQbEJWT0 hJjXabSUC+qR63Xl4GfF7uYDYBpzPOTYsaO0CjJexxcs5ZyN5s5Ig5NlXznFVLJj9weQOqYEFOLsg xMFkXLv6KSWJmXLez5SOSxYaXZaxA4RFFumDrA3tm0eEhvKMzo+iHaSBSa1U8gPhnsTKa0h0trUxk 0wfU23eQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5JFE-006TD0-Qc; Mon, 19 Jul 2021 02:43:17 +0000 Date: Mon, 19 Jul 2021 03:43:00 +0100 From: Matthew Wilcox To: Zhouyi Zhou 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 Subject: Re: linux-5.13.2: warning from kernel/rcu/tree_plugin.h:359 Message-ID: References: <2245518.LNIG0phfVR@natalenko.name> <6698965.kvI7vG0SvZ@natalenko.name> <20210718215914.GQ4397@paulmck-ThinkPad-P17-Gen-1> <20210719015313.GS4397@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.