Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma is enable

2020-07-09 Thread Mike Kravetz
rton ; linux...@kvack.org; >> linux-kernel@vger.kernel.org; Linuxarm ; Jonathan >> Cameron >> Subject: Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma >> is enable >> >> Looks like this produced a warning in linux-next. I suspect it is due to

RE: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma is enable

2020-07-09 Thread Song Bao Hua (Barry Song)
; Cameron > Subject: Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma > is enable > > Looks like this produced a warning in linux-next. I suspect it is due to the > combination CONFIG_HUGETLB_PAGE && !CONFIG_CMA. > > Instead of adding the routine hugetlb

Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma is enable

2020-07-09 Thread Mike Kravetz
Looks like this produced a warning in linux-next. I suspect it is due to the combination CONFIG_HUGETLB_PAGE && !CONFIG_CMA. Instead of adding the routine hugetlb_cma_enabled() to scan the hugetlb_cma array, could we just use a boolean as follows? It can simply be set in hugetlb_cma_reserve

RE: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma is enable

2020-07-08 Thread Song Bao Hua (Barry Song)
Subject: Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma > is enable > > On Wed, Jul 08, 2020 at 10:45:16AM -0700, Mike Kravetz wrote: > > On 7/7/20 12:56 PM, Andrew Morton wrote: > > > On Tue, 7 Jul 2020 16:02:04 +1200 Barry Song > wrote: > >

Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma is enable

2020-07-08 Thread Roman Gushchin
On Wed, Jul 08, 2020 at 10:45:16AM -0700, Mike Kravetz wrote: > On 7/7/20 12:56 PM, Andrew Morton wrote: > > On Tue, 7 Jul 2020 16:02:04 +1200 Barry Song > > wrote: > > > >> hugetlb_cma[0] can be NULL due to various reasons, for example, node0 has > >> no memory. so NULL hugetlb_cma[0] doesn't

Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma is enable

2020-07-08 Thread Mike Kravetz
On 7/7/20 12:56 PM, Andrew Morton wrote: > On Tue, 7 Jul 2020 16:02:04 +1200 Barry Song > wrote: > >> hugetlb_cma[0] can be NULL due to various reasons, for example, node0 has >> no memory. so NULL hugetlb_cma[0] doesn't necessarily mean cma is not >> enabled. gigantic pages might have been

Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma is enable

2020-07-07 Thread Andrew Morton
On Tue, 7 Jul 2020 16:02:04 +1200 Barry Song wrote: > hugetlb_cma[0] can be NULL due to various reasons, for example, node0 has > no memory. so NULL hugetlb_cma[0] doesn't necessarily mean cma is not > enabled. gigantic pages might have been reserved on other nodes. I'm trying to figure out

Re: [PATCH v3] mm/hugetlb: avoid hardcoding while checking if cma is enable

2020-07-07 Thread Mike Rapoport
On Tue, Jul 07, 2020 at 04:02:04PM +1200, Barry Song wrote: > hugetlb_cma[0] can be NULL due to various reasons, for example, node0 has > no memory. so NULL hugetlb_cma[0] doesn't necessarily mean cma is not > enabled. gigantic pages might have been reserved on other nodes. > > Fixes: