Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2452937imm; Sat, 16 Jun 2018 19:12:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKKg1f3Uhjq5MOdIKVHE8qGMb+4QIWCK1nhzkMmgX22IibRM/WYY6thnPMKqZme8kEvF2rM X-Received: by 2002:a63:a84f:: with SMTP id i15-v6mr6807329pgp.422.1529201536645; Sat, 16 Jun 2018 19:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529201536; cv=none; d=google.com; s=arc-20160816; b=LYzdxTZemb7BGB8VMhNWAp01F6vS7vifRqF0B5VTdikssKPHKqDI37gu76jsOoJYVw 9fl1Q0FPmxEEmBvLIuYucSrw+1OLIkH07oP4RuuoF2CCvLYufuKmF2UIRO9UT0jz/2HG 0V/RNSfoNC2uyFZH8tzyfeKuM42ccJUYNheVQGZKOzhsWxrbbYosDNqRx5utsHakxr38 ht7l2fSm2obJERulrpU76UBsSD7wdTgvI3iXnHhzSumX0FJAbI1QBW0hL6Qo46O/qOG/ ZZ9npYq3oM6FjhlfSCtxEvXWnfEdJTptR7x3Y1lP672gRGPvHJ2kzRlqYSjUwtH0CZet E9OQ== 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=L6O28U5bPiiNtAEzNBl43V8G8xo3oJqGs/4QpqAVQhg=; b=nuO8NUKJ01m0UymvG6trGtt+1qhFIQU1UkfPqcGbe/ProVvAwfgJh8KcLaZnQuIny0 63EV3H0j+AJl5VJSCIJcMTVDiia0PcLDBggNk5DQKU2m9LGskTA4XkLe1ApTDjDUg4ED wtbfV4vVspe9hUewpCczV27OBGHTVRK8JY+UZw8dwbBgnCFTVlh80JuGmgk5pqJR5wCe 2TYs1TgXa5pFmjxCmMZoaHuXiXOugfqdiLpZCS0JAk7fGiAsJ6sx7wb9d3cMdNssnqLm 96C9SD2Et3CEWOKS9zWpIl+Qri/yh7XjhS0Vx322ZDK3cfSo0/a9RIPg5CITNRQEyf1Z 1QSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tl7JYoDT; 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 s136-v6si11822369pfc.222.2018.06.16.19.12.01; Sat, 16 Jun 2018 19:12:16 -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=tl7JYoDT; 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 S934311AbeFQCJv (ORCPT + 99 others); Sat, 16 Jun 2018 22:09:51 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59182 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933953AbeFQCBJ (ORCPT ); Sat, 16 Jun 2018 22:01:09 -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=L6O28U5bPiiNtAEzNBl43V8G8xo3oJqGs/4QpqAVQhg=; b=tl7JYoDThgJELlV7nSJi9IIDV OfbXxR9CH0fIieO+rRqBzXr7h+GVspI0Ku3Y1/zp+VlYY5EHSkg0SFcNfMnTO2vCucsZC2RcNWP4h OkZ+Li1NnFfvpobXmooUXkVVCYIM90Rsxs4vccWME81KDr/BWupjwTTloNIVQ7vgjMQd+kTABpbf4 EHAqbOIIZIXfyd3PzqnkhlEzE+JGDMdHLTGzigeUGGJR0v7oMzkxd/ll4XHkQZe8Gn1zILSpQWC01 WrRkE9Poy0DFiBl1ysSbTmWp/HZPqCaOYKbOFt1jX+Of08BVfgy0jg61pzX3j5/hRR9mlfHlPccZN 5q+D2d6sQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fUN08-0001O6-MX; Sun, 17 Jun 2018 02:01:08 +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 v14 48/74] shmem: Convert shmem_confirm_swap to XArray Date: Sat, 16 Jun 2018 19:00:26 -0700 Message-Id: <20180617020052.4759-49-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180617020052.4759-1-willy@infradead.org> References: <20180617020052.4759-1-willy@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } /* -- 2.17.1