Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8704488ybi; Thu, 6 Jun 2019 18:03:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjr06u7KMQsD9KVa1biWMD7hG78abSYy+l1n/QsoY6I4rnjq3X3AFZasOA1onUxUNSgV/Y X-Received: by 2002:a17:90a:3ae8:: with SMTP id b95mr2676561pjc.68.1559869403605; Thu, 06 Jun 2019 18:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559869403; cv=none; d=google.com; s=arc-20160816; b=Sv/pn+0cZGP7lQiTc1P/1TcTfPEZl5fSNT/UuZDMLinDJn72GKjteDXql5VeEBg0ku INKmNNtv/iwC+8+z9+MQXWTgzvfWVx5b+lvIIL7WHUNVlT6sa6Kpic1hbzYLgSJZHGEh l0irvL4SfFs0dMFgVa9SwghwtB846Fdb6nkjuGZ8lOHeL/h48MkcE3Mj/RxG0YJO2nYB TW0cNRPTNII/gtclP8GH/9xojctsll5KN8/SIwVuZo4Ig+98+W5Azj0nbGYN74fBdIjd XzhNztD4wXy2nbqjLG3HCIheLAED7xa23NVZdiJT9t8E+VXnFkV6+UVx748285nZLLJh 70mw== 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=+Mit/5a+rC2Wlxiu6u6imSr0LN6DP+ltnocf5OY9+X8=; b=gL1FBMb0VlDQ2bT2IzdMpfj5oo6KTW82Ya+0brw0NPFFhRh9JH+uby9RnzJRMC861k 8j8yczZq5JdxzbLeGC2fuA1wD7PTqI4QFv6vZ1jNSiVcwa4Vqai3hAoSzKfC74Opnfdl DTsAut4ewTHbPk9lWYA7y6rLqsPrF2PrL1yV2lDX9OjspkfCcZgBtfvVmEXUVA/gGtd8 Y/BboCfmqtFGP2/w4bdu0v8V7ykXEiSV/TgklyhY/CrHfXN7HaWz+xjTDTqHGIkD+qTX fUYVZepD2xQpfwiAGQpB6u9+2z0e8m39uxuvwil1lqrYPjBQ5AiP0U+bSK21we38x+8E tqfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=YFPe9L12; 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 f3si550979pgs.135.2019.06.06.18.03.05; Thu, 06 Jun 2019 18:03:23 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=YFPe9L12; 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 S1727001AbfFGAoS (ORCPT + 99 others); Thu, 6 Jun 2019 20:44:18 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:15867 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbfFGAoR (ORCPT ); Thu, 6 Jun 2019 20:44:17 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 06 Jun 2019 17:44:14 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 06 Jun 2019 17:44:16 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 06 Jun 2019 17:44:16 -0700 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; Fri, 7 Jun 2019 00:44:16 +0000 Subject: Re: [PATCH 2/5] mm/hmm: Clean up some coding style and comments To: Jason Gunthorpe CC: , , John Hubbard , Ira Weiny , Dan Williams , Arnd Bergmann , Balbir Singh , Dan Carpenter , "Matthew Wilcox" , Souptick Joarder , "Andrew Morton" References: <20190506232942.12623-1-rcampbell@nvidia.com> <20190506232942.12623-3-rcampbell@nvidia.com> <20190606155719.GA8896@ziepe.ca> X-Nvconfidentiality: public From: Ralph Campbell Message-ID: <3a91e9a7-e533-863b-ee5f-c34f1e10433c@nvidia.com> Date: Thu, 6 Jun 2019 17:44:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <20190606155719.GA8896@ziepe.ca> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) 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=1559868254; bh=+Mit/5a+rC2Wlxiu6u6imSr0LN6DP+ltnocf5OY9+X8=; 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=YFPe9L12IwlVFW/uqZXMuLBzFKRY4kU3BNWs7W76LnhmesrNFPJru/HQ0xy/VzFq7 iFqW/b8g6EGJGXC3ipAcfMEEgdVqJ+2B5Qrod5NcuYzHnGO2makj85RecVap7Qahsq BGrWOKjjUAkZ9dSKp0uN3V8bf9uCsZsafyvSRsDFxFbttruxdRiTJU0P0vlCIES0Jy UoY9M63J7l2A0EenhMJegmbfcEg45stvVce39dcwAUUokWhazrFOCWYNSymbJwfZMD dh2Q/lRs3T5Mp7NDJS/TJOPEhmq8AGBKL4clWVFq1oVY9AUEPnTAWftTnLu646cdCo uu6whBYo7fVGg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/6/19 8:57 AM, Jason Gunthorpe wrote: > On Mon, May 06, 2019 at 04:29:39PM -0700, rcampbell@nvidia.com wrote: >> @@ -924,6 +922,7 @@ int hmm_range_register(struct hmm_range *range, >> unsigned page_shift) >> { >> unsigned long mask = ((1UL << page_shift) - 1UL); >> + struct hmm *hmm; >> >> range->valid = false; >> range->hmm = NULL; > > I was finishing these patches off and noticed that 'hmm' above is > never initialized. > > I added the below to this patch: > > diff --git a/mm/hmm.c b/mm/hmm.c > index 678873eb21930a..8e7403f081f44a 100644 > --- a/mm/hmm.c > +++ b/mm/hmm.c > @@ -932,19 +932,20 @@ int hmm_range_register(struct hmm_range *range, > range->start = start; > range->end = end; > > - range->hmm = hmm_get_or_create(mm); > - if (!range->hmm) > + hmm = hmm_get_or_create(mm); > + if (!hmm) > return -EFAULT; > > /* Check if hmm_mm_destroy() was call. */ > - if (range->hmm->mm == NULL || range->hmm->dead) { > - hmm_put(range->hmm); > + if (hmm->mm == NULL || hmm->dead) { > + hmm_put(hmm); > return -EFAULT; > } > > /* Initialize range to track CPU page table updates. */ > - mutex_lock(&range->hmm->lock); > + mutex_lock(&hmm->lock); > > + range->hmm = hmm; > list_add_rcu(&range->list, &hmm->ranges); > > /* > > Which I think was the intent of adding the 'struct hmm *'. I prefer > this arrangement as it does not set an leave an invalid hmm pointer in > the range if there is a failure.. > > Most probably the later patches fixed this up? > > Please confirm, thanks > > Regards, > Jason > Yes, you understand correctly. That was the intended clean up. I must have split my original patch set incorrectly.