Received: by 10.213.65.68 with SMTP id h4csp357038imn; Tue, 13 Mar 2018 06:40:00 -0700 (PDT) X-Google-Smtp-Source: AG47ELtb7CO5/Iia4/i/TcDKEdWtZS7ksc94nA15OX1w/gH/gXC5tLSCIziGjdoG6XuiIUYWanR1 X-Received: by 2002:a17:902:a70f:: with SMTP id w15-v6mr617613plq.79.1520948400163; Tue, 13 Mar 2018 06:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520948400; cv=none; d=google.com; s=arc-20160816; b=l86SZujwGkcWVHTNNtF1mBZeNrVZORLHY4f3vFXlOSpP10jOjo8XYeYoPglOgJn/QL Xytf9F9STz59h7gpvZXWj80FqzM+aXsZqO0u2vgyBelan31+S6SI7ISXaW/914kyq70A IdpngEssY49GBPx/Mapcw/Ww4qorziX34n0jgw0s+wzzROQiTyZOjyzBZwaILCsRHEik RTZsiGcxBqn75oGGZb/m+LbkuQc13V5hxiMGSxROSUNBidBOgT/B83r7Fh89gBHVX8AS vN7AMgieSXA0eRXaWwM3sFTyq8UdZuICeUiKbOkG9LWwO8PmddsI8xpRh9o6oMdGE+2a d7fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=03pTud/1qACkCUUsdo0GFSxlZtWKgSD/sjY7c1IOHPA=; b=UZd4VW4dO8raqjZOAdnMjXYYmVQj7eqSJ6iy9ea+fKCgUsgoh5bOEflrjZheoIqx+P CNGfOrXTiHqbWOXEYUG4o4e3XSNbvGN4c0UVcliIqe3rv/f2TLT4rNCfTqKcQaLrRc/o 29Gj59oomHnNSKETObzNlkWQTZMJBPB43rzm2N+zrIMLWqhdYUNdt1POjN4sbfLMH0aZ HR6X2kqc8PFoy+wPYIyn1D6kBrJMghYcNYuNEu0Xeg3IL959m34Wi7TYe9p82t7c5kFN JTRM+o6DwiwJKtJaABV3taXKb+4EjdjScJnh6yX6wzSaXr59RtQtdIxem5s1JGtFP4SL dsEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=sHr7uXYb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11si74543pgs.782.2018.03.13.06.39.45; Tue, 13 Mar 2018 06:40:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=sHr7uXYb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752782AbeCMNiE (ORCPT + 99 others); Tue, 13 Mar 2018 09:38:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35462 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932610AbeCMN1C (ORCPT ); Tue, 13 Mar 2018 09:27:02 -0400 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=03pTud/1qACkCUUsdo0GFSxlZtWKgSD/sjY7c1IOHPA=; b=sHr7uXYbThmlFhexIx73g/oi6 Dpjkwp+glUvIhcOoH1ZvMW++LR/k523sCTLNi3RpfGV2rCAF1YeDm6TTzkWFm8XIqM7MeOTCSDCce Ce5brOwcqNEp1mC6aikdpxtgRMV4OZOGsgucNbQLwb8MRbDNRWOwxYiAuN9yFpAfw+gq8sSARS6Ng /apnc4kkjYjLEsBjl5rX0ZqBM338jKs8PhRbQ3GJcjfW/prKQf1Bb3jtkwLDJkCQ1Vz7IhAeB+Ol8 cZwZLXzyUtlb6RPE4MqCEudLoX5R6UvJi4EgWO3DCGwY/2hjgSABrza7WwVBDFHcp1WW9B/Tqluix jBHmSRd7w==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1evjxF-0004jn-0I; Tue, 13 Mar 2018 13:27:01 +0000 From: Matthew Wilcox To: Andrew Morton Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Ryusuke Konishi , linux-nilfs@vger.kernel.org Subject: [PATCH v9 44/61] shmem: Convert shmem_confirm_swap to XArray Date: Tue, 13 Mar 2018 06:26:22 -0700 Message-Id: <20180313132639.17387-45-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180313132639.17387-1-willy@infradead.org> References: <20180313132639.17387-1-willy@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 5813808965cd..0af8a439dfad 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -348,12 +348,7 @@ static int shmem_xa_replace(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); } /* -- 2.16.1