From patchwork Mon Jun 11 14:06:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10457971 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6496B601A0 for ; Mon, 11 Jun 2018 14:10:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 425DD284C8 for ; Mon, 11 Jun 2018 14:10:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E012284F5; Mon, 11 Jun 2018 14:10:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D14E2284F5 for ; Mon, 11 Jun 2018 14:10:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 049EA6B0291; Mon, 11 Jun 2018 10:07:05 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F14E76B0293; Mon, 11 Jun 2018 10:07:04 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1AEE6B0291; Mon, 11 Jun 2018 10:07:04 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f71.google.com (mail-pg0-f71.google.com [74.125.83.71]) by kanga.kvack.org (Postfix) with ESMTP id 78A5B6B0290 for ; Mon, 11 Jun 2018 10:07:04 -0400 (EDT) Received: by mail-pg0-f71.google.com with SMTP id g5-v6so6578947pgv.12 for ; Mon, 11 Jun 2018 07:07:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=0csFvUP++HIsjyS093eVt+iU23F6aEPdiKSGAjZkOUY=; b=fjO1GbWdgfUMUrzLH99LSLLXIsQTy8cO4amcCPcyTAEeFG96xYNGCDiaQgisIIsj1A xWQuvyAVYHfM7rdc/LSaxFEqCPEBq2ZI3Y3wPM/0zcWgDr+tio9XxiD9eJX0RARl6JRg FpByVrtIwUeU39OpNIL9xEeVBanUld5TBiNCbAOWfYvXUBjbQC/Of7Zzgrvi8O8ioRhE yAzAYKb4eiUfGB+I1XFuBD1/zrn9GHYCi/XahgLawbM1QxjfhqzJjYw7/+t0hKtGd/FD +ERBnzEz/7kurfg26wWqEn9U8ZAOWSZ36233z8EEb8Az8QHiJWSZtdDd/y4LpsNvFfAt NH/Q== X-Gm-Message-State: APt69E0WXkkoxxc1Y02LQFZsoZfCQTXtrcVAwOrFMAVkZmIxRFJ1dbsr +knc913AE8+4x7iYNYtopOHyOC73AV2LWR/8XI1aEJXejCyBfMhn3h9mvB8tJe/gSPFyYTHdBU1 hbBD8p27GBNYGoqMLQQnFdnoPVpG//0TDEy5vvina4CXFAGhn/f+aWSs/KyBrps9dVw== X-Received: by 2002:a65:6157:: with SMTP id o23-v6mr15203334pgv.310.1528726024183; Mon, 11 Jun 2018 07:07:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKUHlCiTkwGCL3JCZzZ67GWYId4dKVUM46tpF0nVHuszXiufM7ClKVU7/OvCcwNNDaDVRQd X-Received: by 2002:a65:6157:: with SMTP id o23-v6mr15203283pgv.310.1528726023333; Mon, 11 Jun 2018 07:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528726023; cv=none; d=google.com; s=arc-20160816; b=nUkNqz9kmm3eXr8mD91ueTtsqkoT40GhDVMuTNNdy7sot2bAR6ClL/ncMLa4L/Zjug s4uLGoaH3R74ADImwBnQZX4hrzER0I0Rey4ppLSI2Y4lcM7Z4DbBpf8HfX1Ubzfhn3RJ WiEPOHOR1OyVZoci93TPjWThIPCnRtBO1wfCfWGylVSXrQmut1xYnfmcwtlYar8JoLa2 CMY9ZaCurTILJCGguWFyHyfCQuh+oS2Xt3E+O2Jh62anclcTW32homlf9DYw76AqdHo7 3qOsFPWJid9QaKuUvatvrdnY8+Ze70fIvhVNIJQDelBtvY6aLwAm0gvxoh2G/QH73DZF 4oPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=0csFvUP++HIsjyS093eVt+iU23F6aEPdiKSGAjZkOUY=; b=FU1esmhTenPbmUhLG9SdUDEoD/8y0pV8uFJBbEJLba9wNAB6hB6S0CGQlYCVNdE1j6 /ELX+ufYG5h/zQdTYJslyWovJX37KtyMgn5Fe2HD4bLsO/gGoBfAj8qd5mIlOh/NL9i7 QvVlzZBRiskCSCKTdRWC7SSvnvNLewSq5KRxYAIU+WfVcE9xEvkp/SvvuvdVbHbPv9he 29EE41IEWiLqfQAhyvfzaPAKQMUClRra05r4ozo7Hyy9OgfndMkh/g9hccNXp+lI33mC PveLsRLni9I0lD8GTXThjBDDGuRhRDySGfEWQS+ld5TNEGztMCwrwYS7Ybv/TnIZThmp 5r9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=P6SXzgnI; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id b9-v6si24353639plx.286.2018.06.11.07.07.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jun 2018 07:07:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=P6SXzgnI; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: 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=0csFvUP++HIsjyS093eVt+iU23F6aEPdiKSGAjZkOUY=; b=P6SXzgnIPyKH0In6/65wJy+BI s045Y6AKyw0/S44kF49VUZiNW+U3TZ60CGj1gs279C8eRh5m4Y3G47QZWxH0Clzvp41zpqBHHkwvU sorI37jMVLQBywKZ+wSnZegKPigORWPP1nsv/xCqAaQK3NBX9Bg0f/fqlfucpXV6F9fvC+SdWkC+o OrlRG0O5McB7n5KX8AXugk+v1uhG+2LRtmMYFoRTp+/ay1NI07kqx8NEw6AUx5LbHBwAgRqcVxGXu 7XgykXDdpJaMGaXZRb4xHTR/tO4muxutNLTWWsZ4TxjgYi24I71+DbDm72DmHa23uWIhorDEJTfs/ TYVuGxYvA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSNTK-0004qd-8A; Mon, 11 Jun 2018 14:07:02 +0000 From: Matthew Wilcox To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Matthew Wilcox , Jan Kara , Jeff Layton , Lukas Czerner , Ross Zwisler , Christoph Hellwig , Goldwyn Rodrigues , Nicholas Piggin , Ryusuke Konishi , linux-nilfs@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH v13 47/72] shmem: Convert shmem_confirm_swap to XArray Date: Mon, 11 Jun 2018 07:06:14 -0700 Message-Id: <20180611140639.17215-48-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180611140639.17215-1-willy@infradead.org> References: <20180611140639.17215-1-willy@infradead.org> 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: X-Virus-Scanned: ClamAV using ClamSMTP From: Matthew Wilcox xa_load has its own RCU locking, so we can eliminate it here. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 2b8720d32e7a..479e4a8e6d68 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -348,12 +348,7 @@ static int shmem_replace_entry(struct address_space *mapping, static bool shmem_confirm_swap(struct address_space *mapping, pgoff_t index, swp_entry_t swap) { - void *item; - - rcu_read_lock(); - item = radix_tree_lookup(&mapping->i_pages, index); - rcu_read_unlock(); - return item == swp_to_radix_entry(swap); + return xa_load(&mapping->i_pages, index) == swp_to_radix_entry(swap); } /*