Linux-Next Archive on lore.kernel.org
 help / color / Atom feed
From: Mina Almasry <almasrymina@google.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-mm@kvack.org, linux-next@vger.kernel.org,
	open list <linux-kernel@vger.kernel.org>,
	David Rientjes <rientjes@google.com>,
	Greg Thelen <gthelen@google.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Shakeel Butt <shakeelb@google.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] hugetlb: fix CONFIG_CGROUP_HUGETLB ifdefs
Date: Sun, 16 Feb 2020 13:03:38 -0800
Message-ID: <CAHS8izOTc_7RKHoJVG_dOKEjT1d4KxNOUwMqqZwyqZm0fe=HcA@mail.gmail.com> (raw)
In-Reply-To: <CAHS8izP36oTFJdrV7+NSc1sc1fuGB48QDMCkamRM2nW2ni=tSg@mail.gmail.com>

On Sun, Feb 16, 2020 at 12:40 PM Mina Almasry <almasrymina@google.com> wrote:
>
> On Fri, Feb 14, 2020 at 5:57 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> >
> > 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@google.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,
> >                                                            ^~~~~~~~
> >
>
> Hi Randy,
>
> Yes this was supposed to fix the build errors. I'm having trouble
> reproducing the one you have pending above. This is my development
> environment:
>
> ➜  prodkernel2 git:(mm-build-fix) git remote show github-akpm
> * remote github-akpm
>   Fetch URL: https://github.com/hnaz/linux-mm.git
>   Push  URL: https://github.com/hnaz/linux-mm.git
>
> ➜  prodkernel2 git:(mm-build-fix) git s
> ## mm-build-fix...github-akpm/master [ahead 1]
>
> ➜  prodkernel2 git:(mm-build-fix) make -j80 mm/migrate.o
> (succeeds with no warnings).
>
> ➜  prodkernel2 git:(mm-build-fix) make -j80
> (succeeds with no warnings)
>
> Is my development environment wrong? Shouldn't I be able to reproduce
> this build warning on this tree with my fix?
> https://github.com/hnaz/linux-mm.git
>
> I'm using config-r9887 that you sent earlier.
>
> I'm probably supposed to use a different branch since you also say
> that my patch doesn't apply cleanily, but the mmotm readme says that
> github mirrors Andrew's tree?
>

Just looking at the build error without being able to reproduce, it
looks like this diff would fix it?

➜  prodkernel2 git:(mm-build-fix) ✗ git diff
diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h
index a09d4164ba910..5f66cdcbe9b10 100644
--- a/include/linux/hugetlb_cgroup.h
+++ b/include/linux/hugetlb_cgroup.h
@@ -15,6 +15,7 @@
 #ifndef _LINUX_HUGETLB_CGROUP_H
 #define _LINUX_HUGETLB_CGROUP_H

+#include <linux/hugetlb.h>
 #include <linux/mmdebug.h>

 struct hugetlb_cgroup;

Can you let me know? Or any insight into why I can't reproduce the
warning? Wrong tree perhaps?

I suspect a forward declaration of struct resv_map and struct
file_region in hugetlb_cgroup.h would also fix.

> > >
> > >>> Fixes: b5f16a533ce8a ("hugetlb: support file_region coalescing again")
> > >>> Signed-off-by: Mina Almasry <almasrymina@google.com>
> > >>> Cc: David Rientjes <rientjes@google.com>
> > >>> Cc: Greg Thelen <gthelen@google.com>
> > >>> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> > >>> Cc: Shakeel Butt <shakeelb@google.com>
> > >>> Cc: Andrew Morton <akpm@linux-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@infradead.org>

  reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200203173311.6269a8be06a05e5a4aa08a93@linux-foundation.org>
2020-02-14  6:26 ` mmotm 2020-02-13-22-26 uploaded Andrew Morton
2020-02-14 16:29   ` mmotm 2020-02-13-22-26 uploaded (mm/hugetlb.c) Randy Dunlap
2020-02-14 17:18     ` Mike Kravetz
2020-02-14 20:51       ` Mina Almasry
     [not found]       ` <20200214204544.231482-1-almasrymina@google.com>
2020-02-14 21:00         ` [PATCH] hugetlb: fix CONFIG_CGROUP_HUGETLB ifdefs Mina Almasry
2020-02-15  1:17           ` Randy Dunlap
2020-02-15  1:56             ` Randy Dunlap
2020-02-16 20:40               ` Mina Almasry
2020-02-16 21:03                 ` Mina Almasry [this message]
2020-02-17  2:48                   ` Randy Dunlap
2020-02-17  2:57                     ` [PATCH] hugetlb: fix <linux/hugetlb_cgroup.h> structs Randy Dunlap
2020-02-17  3:53               ` [PATCH] hugetlb: fix CONFIG_CGROUP_HUGETLB ifdefs Stephen Rothwell
2020-02-14 16:49   ` mmotm 2020-02-13-22-26 uploaded (mm/migrate.c, hugetlb_cgroup.h) Randy Dunlap
2020-02-25  3:53 ` mmotm 2020-02-24-19-53 uploaded Andrew Morton
2020-02-25  6:16   ` mmotm 2020-02-24-19-53 uploaded (init/main.c: initrd*) Randy Dunlap
2020-02-25  6:18     ` Randy Dunlap
2020-02-25  6:21       ` Randy Dunlap
2020-02-25 16:41   ` mmotm 2020-02-24-19-53 uploaded (drivers/platform/x86/intel_pmc_core.c) Randy Dunlap
2020-02-25 17:01   ` mmotm 2020-02-24-19-53 uploaded (objtool warning) Randy Dunlap
2020-02-27 21:52     ` Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHS8izOTc_7RKHoJVG_dOKEjT1d4KxNOUwMqqZwyqZm0fe=HcA@mail.gmail.com' \
    --to=almasrymina@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=gthelen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mike.kravetz@oracle.com \
    --cc=rdunlap@infradead.org \
    --cc=rientjes@google.com \
    --cc=shakeelb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Next Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-next/0 linux-next/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-next linux-next/ https://lore.kernel.org/linux-next \
		linux-next@vger.kernel.org
	public-inbox-index linux-next

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-next


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git