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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B7DDC433F5 for ; Fri, 11 Mar 2022 06:26:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B3598D0002; Fri, 11 Mar 2022 01:26:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 43ADD8D0001; Fri, 11 Mar 2022 01:26:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3026B8D0002; Fri, 11 Mar 2022 01:26:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 1E1A98D0001 for ; Fri, 11 Mar 2022 01:26:37 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id E1680120BF0 for ; Fri, 11 Mar 2022 06:26:36 +0000 (UTC) X-FDA: 79231121592.14.93E5977 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf13.hostedemail.com (Postfix) with ESMTP id 70A3020017 for ; Fri, 11 Mar 2022 06:26:35 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KFG6W66kjzcb4G; Fri, 11 Mar 2022 14:21:39 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 11 Mar 2022 14:26:31 +0800 Subject: Re: [PATCH] mm/huge_memory: remove unneeded local variable follflags To: Anshuman Khandual , CC: , References: <20220310131253.30970-1-linmiaohe@huawei.com> <90246c21-94e9-e64e-dd83-fce45de89f72@arm.com> From: Miaohe Lin Message-ID: <15d17cb9-6eae-0345-8e67-da30a5978300@huawei.com> Date: Fri, 11 Mar 2022 14:26:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <90246c21-94e9-e64e-dd83-fce45de89f72@arm.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 70A3020017 X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Stat-Signature: 49tgpmzkj58zux33jhgewzrk6jda7r1j X-HE-Tag: 1646979995-287690 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 2022/3/11 12:51, Anshuman Khandual wrote: > Hi Miaohe, > > On 3/10/22 18:42, Miaohe Lin wrote: >> We can pass FOLL_GET | FOLL_DUMP to follow_page directly to simplify >> the code a bit. >> >> Signed-off-by: Miaohe Lin >> --- >> mm/huge_memory.c | 4 +--- >> 1 file changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/mm/huge_memory.c b/mm/huge_memory.c >> index 3557aabe86fe..418d077da246 100644 >> --- a/mm/huge_memory.c >> +++ b/mm/huge_memory.c >> @@ -2838,7 +2838,6 @@ static int split_huge_pages_pid(int pid, unsigned long vaddr_start, >> */ >> for (addr = vaddr_start; addr < vaddr_end; addr += PAGE_SIZE) { >> struct vm_area_struct *vma = find_vma(mm, addr); >> - unsigned int follflags; >> struct page *page; >> >> if (!vma || addr < vma->vm_start) >> @@ -2851,8 +2850,7 @@ static int split_huge_pages_pid(int pid, unsigned long vaddr_start, >> } >> >> /* FOLL_DUMP to ignore special (like zero) pages */ >> - follflags = FOLL_GET | FOLL_DUMP; >> - page = follow_page(vma, addr, follflags); >> + page = follow_page(vma, addr, FOLL_GET | FOLL_DUMP); >> >> if (IS_ERR(page)) >> continue; > > LGTM, but there is another similar instance in add_page_for_migration() > inside mm/migrate.c, requiring this exact clean up. > Thanks for comment. That similar case is done in my previous patch series[1] aimed at migration cleanup and fixup. It might be more suitable to do that clean up in that specialized series? [1]:https://lore.kernel.org/linux-mm/20220304093409.25829-4-linmiaohe@huawei.com/ > Hence with that change in place. > > Reviewed-by: Anshuman Khandual Thanks again. > . >