From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f72.google.com (mail-pg0-f72.google.com [74.125.83.72]) by kanga.kvack.org (Postfix) with ESMTP id A800A6B02A1 for ; Mon, 19 Feb 2018 14:46:28 -0500 (EST) Received: by mail-pg0-f72.google.com with SMTP id o11so5821798pgp.14 for ; Mon, 19 Feb 2018 11:46:28 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id k4si5583098pgr.73.2018.02.19.11.46.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Feb 2018 11:46:27 -0800 (PST) From: Matthew Wilcox Subject: [PATCH v7 45/61] shmem: Convert shmem_confirm_swap to XArray Date: Mon, 19 Feb 2018 11:45:40 -0800 Message-Id: <20180219194556.6575-46-willy@infradead.org> In-Reply-To: <20180219194556.6575-1-willy@infradead.org> References: <20180219194556.6575-1-willy@infradead.org> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@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 a8db3241f826..25a8e611bf1b 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->pages, index); - rcu_read_unlock(); - return item == swp_to_radix_entry(swap); + return xa_load(&mapping->pages, index) == swp_to_radix_entry(swap); } /* -- 2.16.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org