Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3670853ioo; Mon, 30 May 2022 07:13:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjk0m87dMJPR+MLJOLhfHngLZGoTQo4d5OoEKB32UTqJ/SBnUm+JEAGwxEqchLI/4GeczX X-Received: by 2002:aa7:d697:0:b0:42d:d033:d5b6 with SMTP id d23-20020aa7d697000000b0042dd033d5b6mr6506840edr.175.1653920033059; Mon, 30 May 2022 07:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653920033; cv=none; d=google.com; s=arc-20160816; b=vUwJgQhvTW5m7EK0VbWHnyjQMWJ2h9yVH78jk9PHO/YiJY5fDPk6E+ogYCWUQSVQoV 1oiJCZAwUgM6ptfIFn0zY3IG/iGw8oLgKJgljvIhMNzr6iC2s2SMWerUfyhkJkLU0VRZ 5WKljg3QCt3Wiz74e+CFynDVefDPpMFRO4LX+2mkxiRuYdumlGrNDSk/Lpf/x5aMQ6ft /gF263+oxUFJjdc4Jmhjr0ZJY1SCFU//FoXlVbeSmJK2hyjmsHgFxHidTQozMsNliLz1 EPxRHFMUbuRdI29cwmzjTHgwsDUNfORngtpB/TC5AEHJvS2lF3VB6Cjsq6eJHRX1sl6B GQ9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=T+oFo4wRXTsafA606Qz3LM5KH3RxFR4t5i/SJMMWs+0=; b=agy5Wb/V/QlrXlGlY6JX3BobAQ70O9ssotTJ0e6JLD9viihY4qk0wLa7mzt9ezyaPE YcoOK86pHkk/zN20WqufrUCKGRbWla7rlvc1y24b9sfrQJIAOlPvcxViNFl8uizgD3RT n1rVMGbC9YAMjiXSQWpH4mFjk5wLY3gS34Qof0bnGu9hNrRcnN6JnLczxX0SdRlz5G5c 28qLQBxJ3UeEaJ85986UVnHefhvT0l2iq+96nDa5Hy9kzJm42QDsmtiZbsQCqzBr0Jd/ 22GY2YvNhYefsQeHy7+M2DRl4swFbnmzchBWfVDFWP1L4AY/KOWF9Ff99uhSzKZTknwf 7qBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b25-20020a50e799000000b0042aeb5fb6e5si12317265edn.446.2022.05.30.07.13.25; Mon, 30 May 2022 07:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235154AbiE3KO3 (ORCPT + 99 others); Mon, 30 May 2022 06:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234092AbiE3KO0 (ORCPT ); Mon, 30 May 2022 06:14:26 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4E9473790 for ; Mon, 30 May 2022 03:14:24 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R891e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0VEnJoDi_1653905659; Received: from 30.47.200.245(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VEnJoDi_1653905659) by smtp.aliyun-inc.com(127.0.0.1); Mon, 30 May 2022 18:14:20 +0800 Message-ID: Date: Mon, 30 May 2022 18:14:45 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [RFC PATCH 2/3] hugetlb: do not update address in huge_pmd_unshare To: Mike Kravetz , linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Muchun Song , Michal Hocko , Peter Xu , Naoya Horiguchi , James Houghton , Mina Almasry , "Aneesh Kumar K . V" , Anshuman Khandual , Paul Walmsley , Christian Borntraeger , Andrew Morton References: <20220527225849.284839-1-mike.kravetz@oracle.com> <20220527225849.284839-3-mike.kravetz@oracle.com> From: Baolin Wang In-Reply-To: <20220527225849.284839-3-mike.kravetz@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/28/2022 6:58 AM, Mike Kravetz wrote: > As an optimization for loops sequentially processing hugetlb address > ranges, huge_pmd_unshare would update a passed address if it unshared a > pmd. Updating a loop control variable outside the loop like this is > generally a bad idea. These loops are now using hugetlb_mask_last_hp > to optimize scanning when non-present ptes are discovered. The same > can be done when huge_pmd_unshare returns 1 indicating a pmd was > unshared. > > Remove address update from huge_pmd_unshare. Change the passed argument > type and update all callers. In loops sequentially processing addresses > use hugetlb_mask_last_hp to update address if pmd is unshared. > > Signed-off-by: Mike Kravetz LGTM. Please feel free to add: Reviewed-by: Baolin Wang