[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f0fd4a6b-1d4a-8e7d-65c0-a454fbf550a2@infradead.org>
Date: Fri, 14 Feb 2020 17:56:57 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Mina Almasry <almasrymina@...gle.com>, linux-mm@...ck.org,
linux-next@...r.kernel.org,
open list <linux-kernel@...r.kernel.org>
Cc: David Rientjes <rientjes@...gle.com>,
Greg Thelen <gthelen@...gle.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Shakeel Butt <shakeelb@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] hugetlb: fix CONFIG_CGROUP_HUGETLB ifdefs
On 2/14/20 5:17 PM, Randy Dunlap wrote:
> On 2/14/20 1:00 PM, Mina Almasry wrote:
>> On Fri, Feb 14, 2020 at 12:46 PM Mina Almasry <almasrymina@...gle.com> wrote:
>>>
>>> Fixes an #ifdef bug in the patch referred to below that was
>>> causing a build error when CONFIG_DEBUG_VM &&
>>> !CONFIG_CCGROUP_HUGETLB.
>
> Hi Mina,
>
> I don't know if this was supposed to fix the 2 build reports that I made,
> but this does not apply cleanly to mmotm (and it's a reply email so it's
> more difficult to apply anyway):
>
> Applying patch mm-hugetlb-fix-CONFIG_CGROUP_HUGETLB.patch
> patching file mm/hugetlb.c
> Hunk #1 succeeded at 289 with fuzz 1.
> Hunk #2 succeeded at 325 with fuzz 2.
> Hunk #3 FAILED at 435.
> 1 out of 3 hunks FAILED -- rejects in file mm/hugetlb.c
>
OK, I applied this patch manually and it does fix most of the reported build problems.
The only one remaining is this:
CC mm/migrate.o
In file included from ../mm/migrate.c:39:0:
../include/linux/hugetlb_cgroup.h:146:21: warning: ‘struct file_region’ declared inside parameter list will not be visible outside of this definition or declaration
struct file_region *rg,
^~~~~~~~~~~
../include/linux/hugetlb_cgroup.h:145:63: warning: ‘struct resv_map’ declared inside parameter list will not be visible outside of this definition or declaration
static inline void hugetlb_cgroup_uncharge_file_region(struct resv_map *resv,
^~~~~~~~
../include/linux/hugetlb_cgroup.h:233:59: warning: ‘struct resv_map’ declared inside parameter list will not be visible outside of this definition or declaration
static inline void hugetlb_cgroup_uncharge_counter(struct resv_map *resv,
^~~~~~~~
>
>>> Fixes: b5f16a533ce8a ("hugetlb: support file_region coalescing again")
>>> Signed-off-by: Mina Almasry <almasrymina@...gle.com>
>>> Cc: David Rientjes <rientjes@...gle.com>
>>> Cc: Greg Thelen <gthelen@...gle.com>
>>> Cc: Mike Kravetz <mike.kravetz@...cle.com>
>>> Cc: Shakeel Butt <shakeelb@...gle.com>
>>> Cc: Andrew Morton <akpm@...ux-foundation.org>
>>> ---
>>> mm/hugetlb.c | 8 +++++---
>>> 1 file changed, 5 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
>>> index ee6d262fe6ac0..95d34c58981d2 100644
>>> --- a/mm/hugetlb.c
>>> +++ b/mm/hugetlb.c
>>> @@ -289,7 +289,7 @@ static bool has_same_uncharge_info(struct file_region *rg,
>>> #endif
>>> }
>>>
>>> -#ifdef CONFIG_DEBUG_VM
>>> +#if defined(CONFIG_DEBUG_VM) && defined(CONFIG_CGROUP_HUGETLB)
>>> static void dump_resv_map(struct resv_map *resv)
>>> {
>>> struct list_head *head = &resv->regions;
>>> @@ -325,6 +325,10 @@ static void check_coalesce_bug(struct resv_map *resv)
>>> }
>>> }
>>> }
>>> +#else
>>> +static void check_coalesce_bug(struct resv_map *resv)
>>> +{
>>> +}
>>> #endif
>>>
>>> static void coalesce_file_region(struct resv_map *resv, struct file_region *rg)
>>> @@ -431,9 +435,7 @@ static long add_reservation_in_range(struct resv_map *resv, long f, long t,
>>> }
>>>
>>> VM_BUG_ON(add < 0);
>>> -#ifdef CONFIG_DEBUG_VM
>>> check_coalesce_bug(resv);
>>> -#endif
>>> return add;
>>> }
>>>
>>> --
>>> 2.25.0.265.gbab2e86ba0-goog
--
~Randy
Reported-by: Randy Dunlap <rdunlap@...radead.org>
Powered by blists - more mailing lists