Received: by 10.223.164.202 with SMTP id h10csp662471wrb; Wed, 22 Nov 2017 13:16:16 -0800 (PST) X-Google-Smtp-Source: AGs4zMaQsyypS73AfmdpEFVk90hO35hNUjlKy8XcJqBCN5rLHGD070MaCql8+zCqnPY4rsxRxMyF X-Received: by 10.101.81.136 with SMTP id h8mr21673140pgq.250.1511385375950; Wed, 22 Nov 2017 13:16:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511385375; cv=none; d=google.com; s=arc-20160816; b=WAsyurvTV+2f8MoW3HRRUX1W7Mz4bQCnDUUlzWpxB4AjP6RSUHfLWQpP0twamASmjZ S8pL6TjbZly6+VK4wYW8jDGSsBkVvaQcrQJRBTeZDJw2ZTnOmzbWUOexkUm3PnoVjwiE 0G/MWKUFKEZov64Njji+DYM0QnAPU9SwzzmCipQWHjPQjePLcYWiuOUZG4a5CoFopJym W2OfdBV+Q5NHcJx0BbCjCbwvC3xnbQdhqCRC5VstKPl3y0Kp4luDiy9x+tI2fyzoN+tf 8mjq4n0quIZfmoMIeLR+V/kQ+56vqGqaokKr8lXcRIGjP3JLsy4f1qXMduhyaTiyatUt F/9g== 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=N0hru5eZv9jiSqM/OTvNQMtDLkgumh0Su0sM15NZxYU=; b=q+74Lmi+9o1bgYQSjpjwCJreBLJOAfSJovp+WDFlnDk2Llzr2NAYWv++irVTWQ0b/O d16ZGbyhgfDi+jOScEkDYcmW4OEwOCdQlWrwyE19o/dkJSs/et3Yd9gQ35LdZDcK/V24 KEQNZgXQYqwQ3KgdZXEWeBxG7T/AOtqVDZchWtKGS0oR2q/ubBgmTEvzNzW/OaUtPwsp qY5UZa7jiFFH/F3W8PZjhBZRhmNz1bIlkXlNi6lm3aPpuNgShBZR3v8POzRR6wDmVnH6 twqC8AovGEZh1+KAaJ9KZFde0Npa0Tc03LEZiJBhtKGlmQCihGYKDpzOd1xbXKCM5gqU 1dtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gE/l+Hx6; 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 25si15494950pfl.135.2017.11.22.13.16.04; Wed, 22 Nov 2017 13:16:15 -0800 (PST) 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=gE/l+Hx6; 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 S1752302AbdKVVOa (ORCPT + 77 others); Wed, 22 Nov 2017 16:14:30 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:58331 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751820AbdKVVIT (ORCPT ); Wed, 22 Nov 2017 16:08:19 -0500 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=N0hru5eZv9jiSqM/OTvNQMtDLkgumh0Su0sM15NZxYU=; b=gE/l+Hx6wiwtLu8WCe0dI19eM rZxopWVvjLAr7rHdHbHazoAp7xrI2yFgDxjoC7wLfHBDmVpzjZ/a4zPnXYDnT1Gg0Aqx986cYzFPH yFDHdNk58RrpW4+FKEUghxPaKNw1aFkADdQKj8NZ9x+9rTyirqD8GQkwzAvf1RXrNq/Hl9q9a+5oS 47tXDzQ6jjdj65vMws6TKXs7UvHNcw+QvjsoixoYxI7nOpLvDeozMOeHQq6yBQJWC/ON1HkraEFAC KeXD3M7oEp+H6LyxhyLKKHhiApTe0MGA/F5CC0rbau7my0ky5QZAmGhBnNMCwlAFyLNJ1RoF0Ej7l CZ4OwaoEQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.87 #1 (Red Hat Linux)) id 1eHcFm-0007wD-Oh; Wed, 22 Nov 2017 21:08:18 +0000 From: Matthew Wilcox To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Matthew Wilcox Subject: [PATCH 38/62] shmem: Convert shmem_confirm_swap to XArray Date: Wed, 22 Nov 2017 13:07:15 -0800 Message-Id: <20171122210739.29916-39-willy@infradead.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171122210739.29916-1-willy@infradead.org> References: <20171122210739.29916-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 f16afa03cfb0..98944cff6319 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.15.0 From 1584785390099370659@xxx Wed Nov 22 16:45:23 +0000 2017 X-GM-THRID: 1584785390099370659 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread