lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 18 Dec 2020 17:41:24 +0800
From:   Muchun Song <songmuchun@...edance.com>
To:     Oscar Salvador <osalvador@...e.de>
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>, naoya.horiguchi@....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 v10 10/11] mm/hugetlb: Gather discrete
 indexes of tail page

On Fri, Dec 18, 2020 at 5:06 PM Oscar Salvador <osalvador@...e.de> wrote:
>
> On Thu, Dec 17, 2020 at 08:13:02PM +0800, Muchun Song wrote:
> > diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> > index 6c02f49959fd..78dd88dda857 100644
> > --- a/mm/hugetlb.c
> > +++ b/mm/hugetlb.c
> > @@ -1360,7 +1360,7 @@ static inline void hwpoison_subpage_deliver(struct hstate *h, struct page *head)
> >       if (!PageHWPoison(head) || !free_vmemmap_pages_per_hpage(h))
> >               return;
> >
> > -     page = head + page_private(head + 4);
> > +     page = head + page_private(head + SUBPAGE_INDEX_HWPOISON);
> >
> >       /*
> >        * Move PageHWPoison flag from head page to the raw error page,
> > @@ -1379,7 +1379,7 @@ static inline void hwpoison_subpage_set(struct hstate *h, struct page *head,
> >               return;
> >
> >       if (free_vmemmap_pages_per_hpage(h)) {
> > -             set_page_private(head + 4, page - head);
> > +             set_page_private(head + SUBPAGE_INDEX_HWPOISON, page - head);
>
> Ok, I was too eager here.
>
> If CONFIG_HUGETLB_PAGE_FREE_VMEMMAP is not set for whatever reason
> (e.g: CONFIG_MEMORY_HOTREMOVE is disabled), when you convert "+4"
> to its index (SUBPAGE_INDEX_HWPOISON), this will no longer build
> since we only define SUBPAGE_INDEX_HWPOISON when the config
> option CONFIG_HUGETLB_PAGE_FREE_VMEMMAP is set.

Yeah, it is my mistake. Thanks for pointing that out.

>
> Different things can be done to fix this:
>
> e.g:
>
>  - Define a two different hwpoison_subpage_{deliver,set}
>    and have them under
>    #ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
>    ...
>    #else
>    ...
>    #endif
>
>  - Work it around as is with IS_ENABLED(CONFIG_HUGETLB_...
>  - Have a common entry and decide depending on whether
>    the config is enabled.
>
> I guess option #1 might be cleaner.

Thanks for your suggestion. I also prefer option #1.

>
> --
> Oscar Salvador
> SUSE L3



-- 
Yours,
Muchun

Powered by blists - more mailing lists