Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp470971ybl; Sat, 17 Aug 2019 04:33:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+Jl9QwyoYQxhDD2fW/tULqeH2N1tNv0GkFRX1Yvdc4CJezQuRNPHtoIO/8G4wDkjuNL25 X-Received: by 2002:a65:5cca:: with SMTP id b10mr11906042pgt.365.1566041599558; Sat, 17 Aug 2019 04:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566041599; cv=none; d=google.com; s=arc-20160816; b=YwF7JcBxFOxEfDfWYDV7nF4r3idbq17eIwjWnaAtxQBcF3AVPfjMglsjN09Szn1gwh 80atJBBqWq0OQE3uGLot+FmQz2s+tVbarbbMrosTXVqvoLElf6RNsSR+hUMRovdoJEZl ELc2vTeUuS6gA3D0MAtCRYpsAhCYQcB9zuVzqXTlxKu3k4efRKRK5h2AlU85Bzw/oe1C YDrPwnsBtim7n6+CuMvuM6fHm1FnRq71eazB06MtrJPvTWVtQYDeJcvUukWuFrkFwPx8 iULqbydzE3EA9Z/bQY2tPDbuFpJwbL5ZdAQDq7v49Pb+Ol3XjegPOGEdV8ALCByLmiUm Unpw== 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=14wBSLm3VG4aQTLNKIQFrhg4z6t3uAF+QAzbAOExk5A=; b=X0XTFRqc0uWeI6UuHEMPSh2VQTP7otMfrghh3c6z1gaFWcGnmbxwLzGiXtC9/8fL2A cGToLRw0OMC353s8FlOXiBc/i+soGN1rH2lad+gXCS0nq4EUlyo8Xtb36GYYEnToau4n N6lj1pIvLtGCiCrIdqPQxtu4nRdBKj6Y87hGp9h1k9MOa4hj20whRPRDeC2hNBjPToY3 W0jkI+RdjlJSU/kjf0K0eecEjvZ7a3rmQkTJkCULv+naut4dGX3QWVE0n4Ps2af8YlYf 3kzKw56/FFl2KsGvWKua0pBzUbQSpgokEEq9yGamB6KF62vufP1EPG40g/Rjvoxz7tU6 l8TA== 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 d7si5554332pgf.377.2019.08.17.04.32.53; Sat, 17 Aug 2019 04:33:19 -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 S1725938AbfHQLbd (ORCPT + 99 others); Sat, 17 Aug 2019 07:31:33 -0400 Received: from verein.lst.de ([213.95.11.211]:33778 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbfHQLbd (ORCPT ); Sat, 17 Aug 2019 07:31:33 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id D1B4A68B02; Sat, 17 Aug 2019 13:31:28 +0200 (CEST) Date: Sat, 17 Aug 2019 13:31:28 +0200 From: Christoph Hellwig To: Jason Gunthorpe Cc: Christoph Hellwig , =?iso-8859-1?B?Suly9G1l?= Glisse , Ben Skeggs , Ralph Campbell , Bharata B Rao , Andrew Morton , "linux-mm@kvack.org" , "nouveau@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 01/10] mm: turn migrate_vma upside down Message-ID: <20190817113128.GA23295@lst.de> References: <20190814075928.23766-1-hch@lst.de> <20190814075928.23766-2-hch@lst.de> <20190816171101.GK5412@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190816171101.GK5412@mellanox.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 On Fri, Aug 16, 2019 at 05:11:07PM +0000, Jason Gunthorpe wrote: > - if (args->cpages) > - migrate_vma_prepare(args); > - if (args->cpages) > - migrate_vma_unmap(args); > + if (!args->cpages) > + return 0; > + > + migrate_vma_prepare(args); > + migrate_vma_unmap(args); I don't think this is ok. Both migrate_vma_prepare and migrate_vma_unmap can reduce args->cpages, including possibly to 0.