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 linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 20 Nov 2017 17:07:09 +0000 From: Andrea Reale <ar@...ux.vnet.ibm.com> To: Zi Yan <zi.yan@...rutgers.edu> Cc: linux-kernel@...r.kernel.org, n-horiguchi@...jp.nec.com, akpm@...ux-foundation.org, jglisse@...hat.com, realean2@...ibm.com Subject: Re: [PATCH 1/1] mm/migrate: do not call prep_transhuge_page if !thp_migration_supported Hi Yan Zi, thanks for the feedback. Yes, it looks definitely less redundant :) Regards, Andrea On Mon, Nov 20, 2017 at 11:33:06AM -0500, Zi Yan wrote: > Hi Andrea, > > Thanks for pointing this out. > > I think the problem is that we should not prep_transhuge_page(new_page) > unless new_page is allocated and PageTransHuge(). And several lines above, > the allocation flags and the order is changed to make new_page a THP > only if thp_migration_supported() is true. > > Does the patch below look better? > > diff --git a/include/linux/migrate.h b/include/linux/migrate.h > index 895ec0c..725eac5 100644 > --- a/include/linux/migrate.h > +++ b/include/linux/migrate.h > @@ -54,7 +54,7 @@ static inline struct page *new_page_nodemask(struct page *page, > new_page = __alloc_pages_nodemask(gfp_mask, order, > preferred_nid, nodemask); > > - if (new_page && PageTransHuge(page)) > + if (new_page && PageTransHuge(new_page)) > prep_transhuge_page(new_page); > > return new_page; > -- > > > -- > Best Regards > Yan Zi > > On 20 Nov 2017, at 11:17, Andrea Reale wrote: > > > new_page_nodemask in linux/migrate.h should not call prep_transhuge_page > > if thp_migration_support is false. > > > > Fixes commit 8135d8926c08 ("mm: memory_hotplug: memory hotremove supports > > thp migration") > > > > Signed-off-by: Andrea Reale <ar@...ux.vnet.ibm.com> > > --- > > include/linux/migrate.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/include/linux/migrate.h b/include/linux/migrate.h > > index 895ec0c..725eac5 100644 > > --- a/include/linux/migrate.h > > +++ b/include/linux/migrate.h > > @@ -54,7 +54,7 @@ static inline struct page *new_page_nodemask(struct page *page, > > new_page = __alloc_pages_nodemask(gfp_mask, order, > > preferred_nid, nodemask); > > > > - if (new_page && PageTransHuge(page)) > > + if (thp_migration_supported() && new_page && PageTransHuge(page)) > > prep_transhuge_page(new_page); > > > > return new_page; > > -- > > 2.7.4
Powered by blists - more mailing lists