[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <07A5567A-8BED-40DB-88F4-96C37DCD78BF@linux.dev>
Date: Sat, 8 Jul 2023 09:40:30 +0800
From: Muchun Song <muchun.song@...ux.dev>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Muchun Song <songmuchun@...edance.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: hugetlb_vmemmap: fix a race between vmemmap pmd split
> On Jul 8, 2023, at 03:41, Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> On Fri, 7 Jul 2023 11:38:59 +0800 Muchun Song <songmuchun@...edance.com> wrote:
>
>> And inline __split_vmemmap_huge_pmd()
>> since it only has one user.
>
> "open code" would be a better term than "inline" in this situation.
>
> If we are to offer this change to -stable then it would be better to do
> the open-coding of __split_vmemmap_huge_pmd() in a separate, later
> patch.
>
I see. Bug fix is better to "open code" instead of "inline". However, it
is a simpler and cleaner way to fix this bug by using "inline". Because
we must hold init_mm.page_table_lock to get the page table page in __split_vmemmap_huge_pmd(), then it is just a couple of duplicated
code from split_vmemmap_huge_pmd(). Consequently, split_vmemmap_huge_pmd()
is redundant, just remove it. And rename __split_vmemmap_huge_pmd()
to split_vmemmap_huge_pmd(). The result is the same as the "inline" way.
So I keep "inline" to fix this.
Thanks.
Powered by blists - more mailing lists