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=-10.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 CCBBCC1975A for ; Thu, 12 Mar 2020 14:40:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9BB12206E7 for ; Thu, 12 Mar 2020 14:40:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BB12206E7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 44FE76B0003; Thu, 12 Mar 2020 10:40:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 400386B0006; Thu, 12 Mar 2020 10:40:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 315C66B0007; Thu, 12 Mar 2020 10:40:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0244.hostedemail.com [216.40.44.244]) by kanga.kvack.org (Postfix) with ESMTP id 1A36E6B0003 for ; Thu, 12 Mar 2020 10:40:19 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D820D5DFC for ; Thu, 12 Mar 2020 14:40:18 +0000 (UTC) X-FDA: 76586970516.23.week16_2aa41225f405 X-HE-Tag: week16_2aa41225f405 X-Filterd-Recvd-Size: 2601 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Mar 2020 14:40:18 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4D1D130E; Thu, 12 Mar 2020 07:40:17 -0700 (PDT) Received: from [10.57.15.252] (unknown [10.57.15.252]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 92E703F534; Thu, 12 Mar 2020 07:40:13 -0700 (PDT) Subject: Re: [PATCH] mm/hmm: Simplify hmm_vma_walk_pud slightly To: Jason Gunthorpe Cc: Jerome Glisse , Ralph Campbell , "Felix.Kuehling@amd.com" , Philip Yang , John Hubbard , "amd-gfx@lists.freedesktop.org" , "linux-mm@kvack.org" , "dri-devel@lists.freedesktop.org" , Christoph Hellwig References: <5bd778fa-51e5-3e0c-d9bb-b38539b03c8d@arm.com> <20200312102813.56699-1-steven.price@arm.com> <20200312142749.GM31668@ziepe.ca> From: Steven Price Message-ID: <58e296a6-d32b-bb37-28ce-ade0f784454d@arm.com> Date: Thu, 12 Mar 2020 14:40:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200312142749.GM31668@ziepe.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 12/03/2020 14:27, Jason Gunthorpe wrote: > On Thu, Mar 12, 2020 at 10:28:13AM +0000, Steven Price wrote: >> By refactoring to deal with the !pud_huge(pud) || !pud_devmap(pud) >> condition early it's possible to remove the 'ret' variable and remove a >> level of indentation from half the function making the code easier to >> read. >> >> No functional change. >> >> Signed-off-by: Steven Price >> --- >> Thanks to Jason's changes there were only two code paths left using >> the out_unlock label so it seemed like a good opportunity to >> refactor. > > Yes, I made something very similar, what do you think of this: > > https://github.com/jgunthorpe/linux/commit/93f0ed42ab3f9ceb27b58fb7c7c3ecaf60f16b36 Even better! Sorry I didn't realise you'd already done this. I just saw that the function was needlessly complicated after your fix, so I thought I'd do a drive-by cleanup since part of the mess was my fault! :) Thanks, Steve