From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com [74.125.83.51]) by kanga.kvack.org (Postfix) with ESMTP id B5E2A6B0031 for ; Fri, 10 Jan 2014 13:26:23 -0500 (EST) Received: by mail-ee0-f51.google.com with SMTP id b15so2086550eek.10 for ; Fri, 10 Jan 2014 10:26:22 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTP id a9si11508355eew.243.2014.01.10.10.26.22 for ; Fri, 10 Jan 2014 10:26:22 -0800 (PST) Message-ID: <52D03B13.60401@redhat.com> Date: Fri, 10 Jan 2014 13:25:23 -0500 From: Rik van Riel MIME-Version: 1.0 Subject: Re: [patch 3/9] mm: shmem: save one radix tree lookup when truncating swapped pages References: <1389377443-11755-1-git-send-email-hannes@cmpxchg.org> <1389377443-11755-4-git-send-email-hannes@cmpxchg.org> In-Reply-To: <1389377443-11755-4-git-send-email-hannes@cmpxchg.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner , Andrew Morton Cc: Andi Kleen , Andrea Arcangeli , Bob Liu , Christoph Hellwig , Dave Chinner , Greg Thelen , Hugh Dickins , Jan Kara , KOSAKI Motohiro , Luigi Semenzato , Mel Gorman , Metin Doslu , Michel Lespinasse , Minchan Kim , Ozgun Erdogan , Peter Zijlstra , Roman Gushchin , Ryan Mallon , Tejun Heo , Vlastimil Babka , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org On 01/10/2014 01:10 PM, Johannes Weiner wrote: > Page cache radix tree slots are usually stabilized by the page lock, > but shmem's swap cookies have no such thing. Because the overall > truncation loop is lockless, the swap entry is currently confirmed by > a tree lookup and then deleted by another tree lookup under the same > tree lock region. > > Use radix_tree_delete_item() instead, which does the verification and > deletion with only one lookup. This also allows removing the > delete-only special case from shmem_radix_tree_replace(). > > Signed-off-by: Johannes Weiner > Reviewed-by: Minchan Kim Reviewed-by: Rik van Riel -- All rights reversed -- 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