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 2885EC433EF for ; Fri, 11 Mar 2022 06:39:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D4648D0002; Fri, 11 Mar 2022 01:39:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9830E8D0001; Fri, 11 Mar 2022 01:39:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 899F58D0002; Fri, 11 Mar 2022 01:39:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id 798958D0001 for ; Fri, 11 Mar 2022 01:39:41 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3811C181AEF21 for ; Fri, 11 Mar 2022 06:39:41 +0000 (UTC) X-FDA: 79231154562.21.84A920A Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf05.hostedemail.com (Postfix) with ESMTP id 8F1C5100018 for ; Fri, 11 Mar 2022 06:39:40 +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 93C7814BF; Thu, 10 Mar 2022 22:39:39 -0800 (PST) Received: from [10.163.33.198] (unknown [10.163.33.198]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E653F3F99C; Thu, 10 Mar 2022 22:39:37 -0800 (PST) Message-ID: <2abaff3b-455a-c345-be93-0036b8dd1519@arm.com> Date: Fri, 11 Mar 2022 12:09:37 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] mm/huge_memory: remove unneeded local variable follflags Content-Language: en-US To: Miaohe Lin , akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220310131253.30970-1-linmiaohe@huawei.com> <90246c21-94e9-e64e-dd83-fce45de89f72@arm.com> <15d17cb9-6eae-0345-8e67-da30a5978300@huawei.com> From: Anshuman Khandual In-Reply-To: <15d17cb9-6eae-0345-8e67-da30a5978300@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8F1C5100018 X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf05.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-Stat-Signature: qw3xosgw8ut5eescndacbie9wrdr6p6h X-HE-Tag: 1646980780-777209 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 3/11/22 11:56, Miaohe Lin wrote: > 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? Both these similar scenarios i.e the one proposed here and other one in the migration series, should be folded into a separate single patch, either here or in the series itself. > > [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. > >> . >> >