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=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 7C1C0C432C3 for ; Mon, 18 Nov 2019 12:24:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 41424206F4 for ; Mon, 18 Nov 2019 12:24:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="HKS562rH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41424206F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CE5396B0010; Mon, 18 Nov 2019 07:24:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C92C56B0266; Mon, 18 Nov 2019 07:24:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA8A06B0269; Mon, 18 Nov 2019 07:24:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id A7F616B0010 for ; Mon, 18 Nov 2019 07:24:55 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 5D961180AD815 for ; Mon, 18 Nov 2019 12:24:55 +0000 (UTC) X-FDA: 76169317350.01.mice17_823b584af3f27 X-HE-Tag: mice17_823b584af3f27 X-Filterd-Recvd-Size: 2454 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Mon, 18 Nov 2019 12:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dm/FqO7pEaBMOHlwP/o7HivoT7Z5gx0tkztNRe5tKmc=; b=HKS562rHRCAQJxyU4uIFQvblm mzTD3qwO2jHc4ESz0OVSiOpnjE6m887kielblNJq7m1sTz/wsueUdan5UEojjphb1gzNyx5mkXUqk C3+Jjqrb36J+h/PvMeH1oMsS8HYZSwqyA2AMU8Eu/rBnnHRhLxFpWug+WdF7APSgW3bOBlUvjYwXl nPA/JsKF1khMnjVvwqIZWSHDPKDaj8tG9gCPpbZ4an/DAVDQocGuAPHhO6FwJ0IvnSeDlHOwIkV+Y R8ysI751XYGUgMM5bfxv1S2LR8DvbjaxwMZc7IiRyKfoMFZvKYKIjtzajLprf0drnrMTXvXIkzHQF gVjS/f6zA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iWg5M-0006f4-W3; Mon, 18 Nov 2019 12:24:52 +0000 Date: Mon, 18 Nov 2019 04:24:52 -0800 From: Matthew Wilcox To: zhong jiang Cc: sashal@kernel.org, gregkh@linuxfoundation.org, stable@vger.kernel.org, linux-mm@kvack.org, yangyingliang@huawei.com Subject: Re: [PATCH 4.14] memfd: Use radix_tree_deref_slot_protected to avoid the warning. Message-ID: <20191118122452.GH20752@bombadil.infradead.org> References: <20191118032610.182862-1-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191118032610.182862-1-zhongjiang@huawei.com> User-Agent: Mutt/1.12.1 (2019-06-15) 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, Nov 18, 2019 at 11:26:07AM +0800, zhong jiang wrote: > The commit 391d4ee568b5 ("memfd: Fix locking when tagging pins") > introduces the following warning messages. > > *WARNING: suspicious RCU usage in memfd_wait_for_pins* > > It is because we still use radix_tree_deref_slot without read_rcu_lock. > We should use radix_tree_deref_slot_protected instead in the case. > > Cc: stable@vger.kernel.org > Fixes: 391d4ee568b5 ("memfd: Fix locking when tagging pins") > Signed-off-by: zhong jiang Reviewed-by: Matthew Wilcox (Oracle)