From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id 2112D6B02FD for ; Thu, 1 Jun 2017 05:33:17 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id d127so8635267wmf.15 for ; Thu, 01 Jun 2017 02:33:17 -0700 (PDT) Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id t11si22369534wme.143.2017.06.01.02.33.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Jun 2017 02:33:15 -0700 (PDT) From: Jan Kara Subject: [PATCH 04/35] dax: Fix inefficiency in dax_writeback_mapping_range() Date: Thu, 1 Jun 2017 11:32:14 +0200 Message-Id: <20170601093245.29238-5-jack@suse.cz> In-Reply-To: <20170601093245.29238-1-jack@suse.cz> References: <20170601093245.29238-1-jack@suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org Cc: Hugh Dickins , David Howells , linux-afs@lists.infradead.org, Ryusuke Konishi , linux-nilfs@vger.kernel.org, Bob Peterson , cluster-devel@redhat.com, Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net, tytso@mit.edu, linux-ext4@vger.kernel.org, Ilya Dryomov , "Yan, Zheng" , ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, David Sterba , "Darrick J . Wong" , linux-xfs@vger.kernel.org, Nadia Yvette Chambers , Jan Kara , stable@vger.kernel.org dax_writeback_mapping_range() fails to update iteration index when searching radix tree for entries needing cache flushing. Thus each pagevec worth of entries is searched starting from the start which is inefficient and prone to livelocks. Update index properly. CC: stable@vger.kernel.org Fixes: 9973c98ecfda3a1dfcab981665b5f1e39bcde64a Signed-off-by: Jan Kara --- fs/dax.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/dax.c b/fs/dax.c index c22eaf162f95..c204445a69b0 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -859,6 +859,7 @@ int dax_writeback_mapping_range(struct address_space *mapping, if (ret < 0) goto out; } + start_index = indices[pvec.nr - 1] + 1; } out: put_dax(dax_dev); -- 2.12.3 -- 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