Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6950452ybi; Thu, 1 Aug 2019 00:52:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpcY4iDB9ysp45O4hDCc9Md3o0YbWfG5ZKpY78F2VI24RmB2sNyfqRxAP2r/CnKKKRYrDP X-Received: by 2002:a17:90a:2163:: with SMTP id a90mr6801181pje.3.1564645925779; Thu, 01 Aug 2019 00:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564645925; cv=none; d=google.com; s=arc-20160816; b=dCjIVSyWJoL/FcGpXZauJaaFidIonRvr279lopCgp0DedzyAkl9qbODuRi1SuxsKgo NEn/0F9MIuFv1zlJm0JbAthwk7enDxF7HeEXFSXfRUm3yWMXNQ4weElMxmurys180eMo xKnLCS6avtzmV0WHOi7yg3ieHAbQ1YtBWC6D/WazVrZkzAPC/+XuR0/8SIsZh5pTnU08 WFSae4lLGve0KpZ++T1A9P/24mPO2f+DFqFnGjgjqozv1dZlm6xlm0CdMgPHpsDtP61v CpZOE3Cy/Va4kTACt7zjNGqooc6JKrzYK8S3aI4v691VCMyL6JDp0+XqjfRw1MUr/eh6 D+Kw== 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=N81JjqJoxDL6NZ7plmuMGoLQCRMLPCNgHubis+t4h30=; b=WGtvqX+nh7UUvjmoI3oa84gcjhyqzU74K2uJQSRqztXDXhWNK1ML5oSO5K2ZvHTGWW /V6rN3uyv3pcCitzzoC+u0X29Y5v+VTSUlue4c+tzDkOIAfMxirqxfJmqHyX71kKhb7N anClMiRUU4PQtXGW2IiGv/ClGcLQPRCmXXPWTt9mHs4Uv4X68mu231jEe1M3c78x9aQD UGXTZ3V/SOyL5jM7rZEefL+74qE00VpVXyb22wuQYnKRxc+UQucPTYTp6BJZz1dED8KL tASMSCorHAJ3ZtZicxPzWKNuCK/sz6LWjc97u0R20W1RfsRHEJf6xggCJTt7YS2GTkYI QMXw== 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 h189si24797658pge.36.2019.08.01.00.51.49; Thu, 01 Aug 2019 00:52:05 -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 S1730649AbfHAHmZ (ORCPT + 99 others); Thu, 1 Aug 2019 03:42:25 -0400 Received: from verein.lst.de ([213.95.11.211]:41121 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730577AbfHAHmZ (ORCPT ); Thu, 1 Aug 2019 03:42:25 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id D5C1E227A81; Thu, 1 Aug 2019 09:42:20 +0200 (CEST) Date: Thu, 1 Aug 2019 09:42:20 +0200 From: Christoph Hellwig To: Ralph Campbell Cc: Christoph Hellwig , =?iso-8859-1?B?Suly9G1l?= Glisse , Jason Gunthorpe , Ben Skeggs , 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 1/9] mm: turn migrate_vma upside down Message-ID: <20190801074220.GB16178@lst.de> References: <20190729142843.22320-1-hch@lst.de> <20190729142843.22320-2-hch@lst.de> <33b82c28-74be-8767-08fa-e41516d11c7e@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33b82c28-74be-8767-08fa-e41516d11c7e@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 On Tue, Jul 30, 2019 at 06:46:25PM -0700, Ralph Campbell wrote: >> for (i = 0; i < npages; i += c) { >> - unsigned long next; >> - >> c = min(SG_MAX_SINGLE_ALLOC, npages); >> - next = start + (c << PAGE_SHIFT); >> - ret = migrate_vma(&nouveau_dmem_migrate_ops, vma, start, >> - next, src_pfns, dst_pfns, &migrate); >> + args.end = start + (c << PAGE_SHIFT); > > Since migrate_vma_setup() is called in a loop, either args.cpages and > args.npages need to be cleared here or cleared in migrate_vma_setup(). I think clearing everything that is not used for argument passing in migrate_vma_setup is a good idea. I'll do that. Btw, it seems like this was a fullquote just for the little comment as far as I could tell from wading through it. It would be very appreciated to properly quote the replies.