From patchwork Fri Jan 29 14:45:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 8163971 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 91A929F440 for ; Fri, 29 Jan 2016 14:46:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BADEF20265 for ; Fri, 29 Jan 2016 14:46:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE36E20256 for ; Fri, 29 Jan 2016 14:46:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756396AbcA2OqE (ORCPT ); Fri, 29 Jan 2016 09:46:04 -0500 Received: from mx2.suse.de ([195.135.220.15]:36567 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756389AbcA2OqC (ORCPT ); Fri, 29 Jan 2016 09:46:02 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CDD86AC8E; Fri, 29 Jan 2016 14:46:00 +0000 (UTC) Subject: Re: [PATCH 4/5] mm: Use radix_tree_iter_retry() To: Matthew Wilcox , Andrew Morton , Hugh Dickins References: <1453929472-25566-1-git-send-email-matthew.r.wilcox@intel.com> <1453929472-25566-5-git-send-email-matthew.r.wilcox@intel.com> Cc: Matthew Wilcox , Konstantin Khlebnikov , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org From: Vlastimil Babka Message-ID: <56AB7B27.3090805@suse.cz> Date: Fri, 29 Jan 2016 15:45:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1453929472-25566-5-git-send-email-matthew.r.wilcox@intel.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 01/27/2016 10:17 PM, Matthew Wilcox wrote: > From: Matthew Wilcox > > Instead of a 'goto restart', we can now use radix_tree_iter_retry() > to restart from our current position. This will make a difference > when there are more ways to happen across an indirect pointer. And it > eliminates some confusing gotos. > > Signed-off-by: Matthew Wilcox [...] > diff --git a/mm/shmem.c b/mm/shmem.c > index fa2ceb2d2655..6ec14b70d82d 100644 > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -388,8 +388,10 @@ restart: > * don't need to reset the counter, nor do we risk infinite > * restarts. > */ > - if (radix_tree_deref_retry(page)) > - goto restart; > + if (radix_tree_deref_retry(page)) { > + slot = radix_tree_iter_retry(&iter); > + continue; > + } > > if (radix_tree_exceptional_entry(page)) > swapped++; This should be applied on top. There are no restarts anymore. ----8<---- From 3b0bdd370b57fb6d83b213e140cd1fb0e8962af8 Mon Sep 17 00:00:00 2001 From: Vlastimil Babka Date: Fri, 29 Jan 2016 15:41:31 +0100 Subject: [PATCH] mm: Use radix_tree_iter_retry()-fix Remove now-obsolete-and-misleading comment. Signed-off-by: Vlastimil Babka Acked-by: Matthwe Wilcox --- mm/shmem.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 8f89abd4eaee..4d758938340c 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -382,11 +382,6 @@ unsigned long shmem_partial_swap_usage(struct address_space *mapping, page = radix_tree_deref_slot(slot); - /* - * This should only be possible to happen at index 0, so we - * don't need to reset the counter, nor do we risk infinite - * restarts. - */ if (radix_tree_deref_retry(page)) { slot = radix_tree_iter_retry(&iter); continue;