Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp660014ybc; Tue, 12 Nov 2019 07:20:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzkj9Fg8xkyQC42wvyZdPNhR+Pv5smCDmFAtXiFkNSr7g5T3su9kVsQ5Yv2S41syubNd0YT X-Received: by 2002:a50:fc02:: with SMTP id i2mr34409408edr.284.1573572040136; Tue, 12 Nov 2019 07:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573572040; cv=none; d=google.com; s=arc-20160816; b=sbNihbbkIADQMe5qS3JgNyNnd4kI2NTyN0a9yrCn5FijrWAjiTt9M9bUYaBqEUNnxe rySS+O2E6TlumjPOmtN9X11IoxsyU3XQJYDw/jXrkWaHrlDgWMozwgfuMKStvFbL8C/1 t3Trl4yim2V5maevjHdq0384OsfJCWYcfvVydMTA++nfajj1T14Wv2Lx7VIicnfvBFLs 5hHoA1S2QDSpCesuHWUj8SCfkSD4IfocZ10P+8/zZDpxKgJlwp9cviSITapv3r4jtcCH tiL4e3Bvuh6Q3fgzEYqjRDb4EFXFZ//cdbAGjD19/bm4+lUtoObmgsTDOxQJiu9UCIrJ ErtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rHGIgvAN/zxcV+XSdQt/ca8fHj294+nQ8iNJfYma61o=; b=mvIW+YVRWKdReLjej4vQfgomGIb+kGEjlw0Orx5nZfMlodWI2LLLsDgMWD4Y35pyVz GzQ5YgkxiyOTNGfjfQrLh7EqrF7ZrnCGxeIlqxHW2YAR/ak+TBwHQLi3f+7+8CjjYnq3 Dc95qluj8UnibikX8LU+JEoglDsmf1pBs0/apRUZucGqQjTNpNAyuouKTk/Ef51k+Fbc R+Bb7B4gtxo/wIrIayhGqDNDHQLdchVkqB/tmJleQPBu+4UiQzY6lJian/aDx4vtZ/7S uX22bC17lAjxbCLm0+zPdA8J2JlNLjmI2Fs3HzQx1jaZf6k/+/3n1JhkmJlHVNir2giC iZFg== ARC-Authentication-Results: i=1; mx.google.com; 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 e22si159625ejt.189.2019.11.12.07.20.15; Tue, 12 Nov 2019 07:20:40 -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; 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 S1727431AbfKLPTA (ORCPT + 99 others); Tue, 12 Nov 2019 10:19:00 -0500 Received: from verein.lst.de ([213.95.11.211]:56369 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727364AbfKLPTA (ORCPT ); Tue, 12 Nov 2019 10:19:00 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 02B8368BE1; Tue, 12 Nov 2019 16:18:57 +0100 (CET) Date: Tue, 12 Nov 2019 16:18:56 +0100 From: Christoph Hellwig To: Ralph Campbell Cc: Jerome Glisse , John Hubbard , Christoph Hellwig , Jason Gunthorpe , Shuah Khan , linux-rdma@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v4 1/2] mm/hmm: make full use of walk_page_range() Message-ID: <20191112151856.GB12550@lst.de> References: <20191104222141.5173-1-rcampbell@nvidia.com> <20191104222141.5173-2-rcampbell@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191104222141.5173-2-rcampbell@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Looks good, Reviewed-by: Christoph Hellwig Although we could clean this up a tidbit more by removing the start variable: diff --git a/mm/hmm.c b/mm/hmm.c index d4984a08ed9b..b5b1ed646c2f 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -667,10 +667,9 @@ static const struct mm_walk_ops hmm_walk_ops = { */ long hmm_range_fault(struct hmm_range *range, unsigned int flags) { - unsigned long start = range->start; struct hmm_vma_walk hmm_vma_walk = { .range = range, - .last = start, + .last = range->start, .flags = flags, }; struct mm_struct *mm = range->notifier->mm; @@ -682,9 +681,8 @@ long hmm_range_fault(struct hmm_range *range, unsigned int flags) /* If range is no longer valid force retry. */ if (mmu_range_check_retry(range->notifier, range->notifier_seq)) return -EBUSY; - ret = walk_page_range(mm, start, range->end, &hmm_walk_ops, - &hmm_vma_walk); - start = hmm_vma_walk.last; + ret = walk_page_range(mm, hmm_vma_walk.last, range->end, + &hmm_walk_ops, &hmm_vma_walk); } while (ret == -EBUSY); if (ret)