[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201210131608.GA7811@localhost.localdomain>
Date: Thu, 10 Dec 2020 14:16:08 +0100
From: Oscar Salvador <osalvador@...e.de>
To: Muchun Song <songmuchun@...edance.com>
Cc: Jonathan Corbet <corbet@....net>,
Mike Kravetz <mike.kravetz@...cle.com>,
Thomas Gleixner <tglx@...utronix.de>, mingo@...hat.com,
bp@...en8.de, x86@...nel.org, hpa@...or.com,
dave.hansen@...ux.intel.com, luto@...nel.org,
Peter Zijlstra <peterz@...radead.org>, viro@...iv.linux.org.uk,
Andrew Morton <akpm@...ux-foundation.org>, paulmck@...nel.org,
mchehab+huawei@...nel.org, pawan.kumar.gupta@...ux.intel.com,
Randy Dunlap <rdunlap@...radead.org>, oneukum@...e.com,
anshuman.khandual@....com, jroedel@...e.de,
Mina Almasry <almasrymina@...gle.com>,
David Rientjes <rientjes@...gle.com>,
Matthew Wilcox <willy@...radead.org>,
Michal Hocko <mhocko@...e.com>,
"Song Bao Hua (Barry Song)" <song.bao.hua@...ilicon.com>,
David Hildenbrand <david@...hat.com>,
Xiongchun duan <duanxiongchun@...edance.com>,
linux-doc@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [External] Re: [PATCH v8 12/12] mm/hugetlb: Optimize the code
with the help of the compiler
On Thu, Dec 10, 2020 at 08:14:18PM +0800, Muchun Song wrote:
> Yeah, you are right. But if we do this check can make the code simple.
>
> For example, here is a code snippet.
>
> void func(void)
> {
> if (free_vmemmap_pages_per_hpage())
> return;
> /* Do something */
> }
>
> With this patch, the func will be optimized to null when is_power_of_2
> returns false.
>
> void func(void)
> {
> }
>
> Without this patch, the compiler cannot do this optimization.
Ok, I misread the changelog.
So, then is_hugetlb_free_vmemmap_enabled, free_huge_page_vmemmap,
free_vmemmap_pages_per_hpage and hugetlb_vmemmap_init are optimized
out, right?
--
Oscar Salvador
SUSE L3
Powered by blists - more mailing lists