Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9216489ybi; Wed, 24 Jul 2019 00:08:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkblLH9Tu63QTsMsyjkwO+vFClHErfOD049OQeU7Ze/pCEoOo+n9vUYRnzkQXhc2qHugkt X-Received: by 2002:a17:90a:5207:: with SMTP id v7mr82858865pjh.127.1563952107453; Wed, 24 Jul 2019 00:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563952107; cv=none; d=google.com; s=arc-20160816; b=B2TOP6fb8TD4s4hb2rRQGze97YrYVPAMImgofRMGNsTLF2Y0DE3zEw0dPFXRVgTfAq NoEU5Zj3j8wVx+1mI/nhGMPz9cHbMKeYeQkBScz5sWovbI9Ua8MiAX5dGlXK2jPxGnew 7IJ33PJhxgv5SHutHldoKEQSWEZOU+eeeM4Mm2SbWVbbocxSjZouwKZ4VnB0gFE3ublo CYncaIodTB10ia0TxUGCF0WC6Gis+JukJzZ1ha2NIvwRdAkmbbblkZzhFdM/dd+mqHor NB1vfHTStE+4vwMQ4zTTE2NFzoeCJzKMzwSaVb0tmDRvsIQ61PZFp2XOkW7uTFD8lVeE dLTg== 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=QHQrgXmr/PvS7gzjSStj5mj3QYtaq9lGEZK4VjwYz3E=; b=JKgsLntkCate4UlH0t3pBj3q/6MRMSWaiFce0pDNHtfSr1y5LTaXlzstpzR56x0dvw WxEZfuKUKsIYj33mHsg5Bl+wl38GaTcjTPjzxmAFmVOokS0IA2KjYZ0K6BJ5yhKi/WQW V3I4axvY8RvzDd8izKAm1ho4Iks+OivJ9BKbRaXkXFfNvPBXvc1D2zOyuivWb1ztQTQ/ mfUKD/+m+2flVixYj6tOZT5zE5OhdtKeE0vMJtI2zyLSLaBqmBrz38IZsUb6L0ZViVnN Oit1s7C+7eFL+r5Vh2UYuGiJ+GY1PXUkTabnsNkn7NoDm9y44YP76wX4L5k1XWEFm1T6 PfIg== 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 s24si17212990pgm.327.2019.07.24.00.08.12; Wed, 24 Jul 2019 00:08:27 -0700 (PDT) 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 S1726386AbfGXHF6 (ORCPT + 99 others); Wed, 24 Jul 2019 03:05:58 -0400 Received: from verein.lst.de ([213.95.11.211]:48269 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbfGXHF5 (ORCPT ); Wed, 24 Jul 2019 03:05:57 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 715E168B20; Wed, 24 Jul 2019 09:05:54 +0200 (CEST) Date: Wed, 24 Jul 2019 09:05:53 +0200 From: Christoph Hellwig To: Ralph Campbell Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, =?iso-8859-1?B?Suly9G1l?= Glisse , Jason Gunthorpe , Christoph Hellwig , Ben Skeggs Subject: Re: [PATCH] mm/hmm: replace hmm_update with mmu_notifier_range Message-ID: <20190724070553.GA2523@lst.de> References: <20190723210506.25127-1-rcampbell@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190723210506.25127-1-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 One comment on a related cleanup: > list_for_each_entry(mirror, &hmm->mirrors, list) { > int rc; > > - rc = mirror->ops->sync_cpu_device_pagetables(mirror, &update); > + rc = mirror->ops->sync_cpu_device_pagetables(mirror, nrange); > if (rc) { > - if (WARN_ON(update.blockable || rc != -EAGAIN)) > + if (WARN_ON(mmu_notifier_range_blockable(nrange) || > + rc != -EAGAIN)) > continue; > ret = -EAGAIN; > break; This magic handling of error seems odd. I think we should merge rc and ret into one variable and just break out if any error happens instead or claiming in the comments -EAGAIN is the only valid error and then ignoring all others here.