From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17AD9C54FD0 for ; Tue, 24 Mar 2020 08:14:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE2E4207FF for ; Tue, 24 Mar 2020 08:14:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE2E4207FF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A19C96E479; Tue, 24 Mar 2020 08:14:19 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by gabe.freedesktop.org (Postfix) with ESMTPS id D54596E07D; Tue, 24 Mar 2020 07:37:48 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 6123068BFE; Tue, 24 Mar 2020 08:37:46 +0100 (CET) Date: Tue, 24 Mar 2020 08:37:46 +0100 From: Christoph Hellwig To: Jason Gunthorpe Subject: Re: [PATCH v2 hmm 7/9] mm/hmm: do not unconditionally set pfns when returning EBUSY Message-ID: <20200324073746.GF23447@lst.de> References: <20200324011457.2817-1-jgg@ziepe.ca> <20200324011457.2817-8-jgg@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200324011457.2817-8-jgg@ziepe.ca> User-Agent: Mutt/1.5.17 (2007-11-01) X-Mailman-Approved-At: Tue, 24 Mar 2020 08:14:13 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Philip Yang , Ralph Campbell , John Hubbard , Felix.Kuehling@amd.com, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Jerome Glisse , Jason Gunthorpe , amd-gfx@lists.freedesktop.org, Christoph Hellwig Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Mon, Mar 23, 2020 at 10:14:55PM -0300, Jason Gunthorpe wrote: > if (pte_none(pte)) { > required_fault = hmm_pte_need_fault(hmm_vma_walk, orig_pfn, 0); > if (required_fault) > goto fault; > + *pfn = range->values[HMM_PFN_NONE]; > return 0; > } > > @@ -274,8 +274,10 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, > } > > required_fault = hmm_pte_need_fault(hmm_vma_walk, orig_pfn, 0); > - if (!required_fault) > + if (!required_fault) { > + *pfn = range->values[HMM_PFN_NONE]; > return 0; > + } Maybe throw in a goto hole to consolidaste the set PFN and return 0 cases? Otherwise looks good: Reviewed-by: Christoph Hellwig _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx