Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1101237ybc; Tue, 12 Nov 2019 14:23:12 -0800 (PST) X-Google-Smtp-Source: APXvYqxal0YV2uGY8PEgDzTfzZs0wGY9THgieD6gxDt/3IJqfGKLOXRomorq4hugiQcQ43B6cBcJ X-Received: by 2002:a50:e8c2:: with SMTP id l2mr92943edn.78.1573597391898; Tue, 12 Nov 2019 14:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573597391; cv=none; d=google.com; s=arc-20160816; b=khp5Hz5Xz3WwHKAg3D1m5yjZurx9ENmoOUufXf5pB16zJBTNbAH5ES8yMDHO1msCdc wrc+tLhac4/92srnJDGfVNFkzw4klm6rGiLyARCQzBkH26yg2gU15+0H7L1gC41BwuXF K9bd4959UdVOzrnJEUCAqwTycmIPMDioUt4o51qen8ITp2jJHJZ1EgOjKUWTO/FBKvg8 W6L1MnTjojIMTezHkik8i/1YGd2AndIeJw33FTsVteFdjPdrG+en1Bs8mFuc2BU1F3eg Cv6T77SBvl+mRG5OhoIqQodxwq9DOM5sFN1HnMC/IzPdCQVyBLxV3P3KsyJH1ziwd+Pk 444Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Mjsgzq4tTY1ttPXWj4o1nKG2G54sIpqkFXsKMyN1ai4=; b=sAlsEOdzrAe1dqgThy50ttsQa7JNDAXZlO1TpjNT3sjL+1WGjm0mI+yunp0t64Q08O bw9MYAClXg1ligI2sxbT51bXdQgbDGmA99YMZ5hkISzldnOGSpuWDaHPYRNbjxOzADh2 42jJf2WrVYyfLEd6yonFg3ONcFS1b/COrmILd2Jl2A3Gp3ZVIADFJOhDDcPnvgmiuO31 PSX+1WdjeP11CI6nWHcTYJI0oc8pfskkJ7Zh2M8PkwkuFmdnhMLA+eZ/0rLy86j9aqMU wrMs6iu/Z0h90/zjaIWpM/HZj0aW/PVkLl6MLXcZvnYchqzzfc0UmPUn3CNNG69akVCZ +A9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=n3+rgoO7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10si951400ejr.19.2019.11.12.14.22.47; Tue, 12 Nov 2019 14:23:11 -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=pass header.i=@nvidia.com header.s=n1 header.b=n3+rgoO7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727058AbfKLWVX (ORCPT + 99 others); Tue, 12 Nov 2019 17:21:23 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:14448 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726896AbfKLWVW (ORCPT ); Tue, 12 Nov 2019 17:21:22 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 12 Nov 2019 14:21:22 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 12 Nov 2019 14:21:22 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 12 Nov 2019 14:21:22 -0800 Received: from rcampbell-dev.nvidia.com (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 12 Nov 2019 22:21:19 +0000 Subject: Re: [PATCH v4 1/2] mm/hmm: make full use of walk_page_range() To: Christoph Hellwig CC: Jerome Glisse , John Hubbard , Jason Gunthorpe , Shuah Khan , , , , References: <20191104222141.5173-1-rcampbell@nvidia.com> <20191104222141.5173-2-rcampbell@nvidia.com> <20191112151856.GB12550@lst.de> X-Nvconfidentiality: public From: Ralph Campbell Message-ID: <3e2da09f-a305-14b7-c116-77e4d1b9e3f2@nvidia.com> Date: Tue, 12 Nov 2019 14:21:19 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20191112151856.GB12550@lst.de> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1573597282; bh=Mjsgzq4tTY1ttPXWj4o1nKG2G54sIpqkFXsKMyN1ai4=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=n3+rgoO7Cosk1b8j0LFmjpqfy8vh/1vgXoyo1ZFsHWrDwoNjbxshEcMMFtJooukY+ T7fDLY+vAopGHZ/4qpGFIhxkA194rJAuMM41B4/euZtC0I/pznU+Ne28KxNiQIcFK3 Faf6R0IaXpEGuTlifVRQBbuUAKsUmrmUDs7OSQOnPR1KyJI5m+wBQBetYH6lUuXlDa nC68T3zwoJ2tzJq6kUVOW/4U2KMqyYcHufw9VRZOIX60Um0xspk9k3555KmBo+KGar speu/qs92JpbwFBiJYqP5q+w7GIbTcxVibLgBIOdtJsy1GoVW6I9WqRRBVh/dmnQlV bzOKy1bGxsOSQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/12/19 7:18 AM, Christoph Hellwig wrote: > 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) > Thanks for the review. I'll add this to patch 1 since I need to send a v5 for patch 2.