diff mbox

mmotm 2017-08-25-15-50 uploaded

Message ID 20170828075931.GC17097@dhcp22.suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Hocko Aug. 28, 2017, 7:59 a.m. UTC
On Fri 25-08-17 16:50:26, Randy Dunlap wrote:
> On 08/25/17 15:50, akpm@linux-foundation.org wrote:
> > The mm-of-the-moment snapshot 2017-08-25-15-50 has been uploaded to
> > 
> >    http://www.ozlabs.org/~akpm/mmotm/
> > 
> > mmotm-readme.txt says
> > 
> > README for mm-of-the-moment:
> > 
> > http://www.ozlabs.org/~akpm/mmotm/
> > 
> > This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
> > more than once a week.
> 
> lots of this one (on x86_64, i386, or UML):
> 
> ../kernel/fork.c:818:2: error: implicit declaration of function 'hmm_mm_init' [-Werror=implicit-function-declaration]
> ../kernel/fork.c:897:2: error: implicit declaration of function 'hmm_mm_destroy' [-Werror=implicit-function-declaration]
> 
> from mm-hmm-heterogeneous-memory-management-hmm-for-short-v5.patch
> 
> Cc: Jérôme Glisse <jglisse@redhat.com>

This one should address it
---
From 31d551dbcb1b7987a4cd07767c1e2805849b7a26 Mon Sep 17 00:00:00 2001
From: Michal Hocko <mhocko@suse.com>
Date: Mon, 28 Aug 2017 09:41:39 +0200
Subject: [PATCH] 
 mm-hmm-struct-hmm-is-only-use-by-hmm-mirror-functionality-v2-fix

Compiler is complaining for allnoconfig

kernel/fork.c: In function 'mm_init':
kernel/fork.c:814:2: error: implicit declaration of function 'hmm_mm_init' [-Werror=implicit-function-declaration]
  hmm_mm_init(mm);
  ^
kernel/fork.c: In function '__mmdrop':
kernel/fork.c:893:2: error: implicit declaration of function 'hmm_mm_destroy' [-Werror=implicit-function-declaration]
  hmm_mm_destroy(mm);

Make sure that hmm_mm_init/hmm_mm_destroy empty stups are defined when
CONFIG_HMM is disabled.

Signed-off-by: Michal Hocko <mhocko@suse.com>
---
 include/linux/hmm.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Stephen Rothwell Aug. 28, 2017, 8:27 a.m. UTC | #1
Hi Michal,

On Mon, 28 Aug 2017 09:59:31 +0200 Michal Hocko <mhocko@kernel.org> wrote:
>
> From 31d551dbcb1b7987a4cd07767c1e2805849b7a26 Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@suse.com>
> Date: Mon, 28 Aug 2017 09:41:39 +0200
> Subject: [PATCH] 
>  mm-hmm-struct-hmm-is-only-use-by-hmm-mirror-functionality-v2-fix
> 
> Compiler is complaining for allnoconfig
> 
> kernel/fork.c: In function 'mm_init':
> kernel/fork.c:814:2: error: implicit declaration of function 'hmm_mm_init' [-Werror=implicit-function-declaration]
>   hmm_mm_init(mm);
>   ^
> kernel/fork.c: In function '__mmdrop':
> kernel/fork.c:893:2: error: implicit declaration of function 'hmm_mm_destroy' [-Werror=implicit-function-declaration]
>   hmm_mm_destroy(mm);
> 
> Make sure that hmm_mm_init/hmm_mm_destroy empty stups are defined when
> CONFIG_HMM is disabled.
> 
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> ---
>  include/linux/hmm.h | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/hmm.h b/include/linux/hmm.h
> index 9583d9a15f9c..aeb94e682dda 100644
> --- a/include/linux/hmm.h
> +++ b/include/linux/hmm.h
> @@ -508,11 +508,10 @@ static inline void hmm_mm_init(struct mm_struct *mm)
>  {
>  	mm->hmm = NULL;
>  }
> -#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
> +#endif
> +
> +#else /* IS_ENABLED(CONFIG_HMM) */
>  static inline void hmm_mm_destroy(struct mm_struct *mm) {}
>  static inline void hmm_mm_init(struct mm_struct *mm) {}
> -#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
> -
> -
>  #endif /* IS_ENABLED(CONFIG_HMM) */
>  #endif /* LINUX_HMM_H */

What happens when CONFIG_HMM is defined but CONFIG_HMM_MIRROR is not?
Or is that not possible (in which case why would we have
CONFIG_HMM_MIRROR)?
Michal Hocko Aug. 28, 2017, 8:31 a.m. UTC | #2
On Mon 28-08-17 18:27:05, Stephen Rothwell wrote:
> Hi Michal,
> 
> On Mon, 28 Aug 2017 09:59:31 +0200 Michal Hocko <mhocko@kernel.org> wrote:
> >
> > From 31d551dbcb1b7987a4cd07767c1e2805849b7a26 Mon Sep 17 00:00:00 2001
> > From: Michal Hocko <mhocko@suse.com>
> > Date: Mon, 28 Aug 2017 09:41:39 +0200
> > Subject: [PATCH] 
> >  mm-hmm-struct-hmm-is-only-use-by-hmm-mirror-functionality-v2-fix
> > 
> > Compiler is complaining for allnoconfig
> > 
> > kernel/fork.c: In function 'mm_init':
> > kernel/fork.c:814:2: error: implicit declaration of function 'hmm_mm_init' [-Werror=implicit-function-declaration]
> >   hmm_mm_init(mm);
> >   ^
> > kernel/fork.c: In function '__mmdrop':
> > kernel/fork.c:893:2: error: implicit declaration of function 'hmm_mm_destroy' [-Werror=implicit-function-declaration]
> >   hmm_mm_destroy(mm);
> > 
> > Make sure that hmm_mm_init/hmm_mm_destroy empty stups are defined when
> > CONFIG_HMM is disabled.
> > 
> > Signed-off-by: Michal Hocko <mhocko@suse.com>
> > ---
> >  include/linux/hmm.h | 7 +++----
> >  1 file changed, 3 insertions(+), 4 deletions(-)
> > 
> > diff --git a/include/linux/hmm.h b/include/linux/hmm.h
> > index 9583d9a15f9c..aeb94e682dda 100644
> > --- a/include/linux/hmm.h
> > +++ b/include/linux/hmm.h
> > @@ -508,11 +508,10 @@ static inline void hmm_mm_init(struct mm_struct *mm)
> >  {
> >  	mm->hmm = NULL;
> >  }
> > -#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
> > +#endif
> > +
> > +#else /* IS_ENABLED(CONFIG_HMM) */
> >  static inline void hmm_mm_destroy(struct mm_struct *mm) {}
> >  static inline void hmm_mm_init(struct mm_struct *mm) {}
> > -#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
> > -
> > -
> >  #endif /* IS_ENABLED(CONFIG_HMM) */
> >  #endif /* LINUX_HMM_H */
> 
> What happens when CONFIG_HMM is defined but CONFIG_HMM_MIRROR is not?
> Or is that not possible (in which case why would we have
> CONFIG_HMM_MIRROR)? 

This is something to Jerome to answer but hmm_mm_init/hmm_mm_destroy are
used regardless of the specific HMM configuration so an empty stub
should be defined unconditionally AFAIU.
Jerome Glisse Aug. 28, 2017, 3:46 p.m. UTC | #3
> On Mon 28-08-17 18:27:05, Stephen Rothwell wrote:
> > Hi Michal,
> > 
> > On Mon, 28 Aug 2017 09:59:31 +0200 Michal Hocko <mhocko@kernel.org> wrote:
> > >
> > > From 31d551dbcb1b7987a4cd07767c1e2805849b7a26 Mon Sep 17 00:00:00 2001
> > > From: Michal Hocko <mhocko@suse.com>
> > > Date: Mon, 28 Aug 2017 09:41:39 +0200
> > > Subject: [PATCH]
> > >  mm-hmm-struct-hmm-is-only-use-by-hmm-mirror-functionality-v2-fix
> > > 
> > > Compiler is complaining for allnoconfig
> > > 
> > > kernel/fork.c: In function 'mm_init':
> > > kernel/fork.c:814:2: error: implicit declaration of function
> > > 'hmm_mm_init' [-Werror=implicit-function-declaration]
> > >   hmm_mm_init(mm);
> > >   ^
> > > kernel/fork.c: In function '__mmdrop':
> > > kernel/fork.c:893:2: error: implicit declaration of function
> > > 'hmm_mm_destroy' [-Werror=implicit-function-declaration]
> > >   hmm_mm_destroy(mm);
> > > 
> > > Make sure that hmm_mm_init/hmm_mm_destroy empty stups are defined when
> > > CONFIG_HMM is disabled.
> > > 
> > > Signed-off-by: Michal Hocko <mhocko@suse.com>
> > > ---
> > >  include/linux/hmm.h | 7 +++----
> > >  1 file changed, 3 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/include/linux/hmm.h b/include/linux/hmm.h
> > > index 9583d9a15f9c..aeb94e682dda 100644
> > > --- a/include/linux/hmm.h
> > > +++ b/include/linux/hmm.h
> > > @@ -508,11 +508,10 @@ static inline void hmm_mm_init(struct mm_struct
> > > *mm)
> > >  {
> > >  	mm->hmm = NULL;
> > >  }
> > > -#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
> > > +#endif
> > > +
> > > +#else /* IS_ENABLED(CONFIG_HMM) */
> > >  static inline void hmm_mm_destroy(struct mm_struct *mm) {}
> > >  static inline void hmm_mm_init(struct mm_struct *mm) {}
> > > -#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
> > > -
> > > -
> > >  #endif /* IS_ENABLED(CONFIG_HMM) */
> > >  #endif /* LINUX_HMM_H */
> > 
> > What happens when CONFIG_HMM is defined but CONFIG_HMM_MIRROR is not?
> > Or is that not possible (in which case why would we have
> > CONFIG_HMM_MIRROR)?
> 
> This is something to Jerome to answer but hmm_mm_init/hmm_mm_destroy are
> used regardless of the specific HMM configuration so an empty stub
> should be defined unconditionally AFAIU.

Sorry for the build issue i posted a patch on friday that i tested against
all combination :

https://lkml.org/lkml/2017/8/25/802

Michal is right this function needs to be defined no matter what but they
only need to be stub if HMM_MIRROR is not enabled.

The fix i posted has the correct logic. I missplaced the endif when i was
fixing Arnd build issue when HMM_MIRROR was not enabled but other HMM feature
were.

Jérôme
diff mbox

Patch

diff --git a/include/linux/hmm.h b/include/linux/hmm.h
index 9583d9a15f9c..aeb94e682dda 100644
--- a/include/linux/hmm.h
+++ b/include/linux/hmm.h
@@ -508,11 +508,10 @@  static inline void hmm_mm_init(struct mm_struct *mm)
 {
 	mm->hmm = NULL;
 }
-#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
+#endif
+
+#else /* IS_ENABLED(CONFIG_HMM) */
 static inline void hmm_mm_destroy(struct mm_struct *mm) {}
 static inline void hmm_mm_init(struct mm_struct *mm) {}
-#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
-
-
 #endif /* IS_ENABLED(CONFIG_HMM) */
 #endif /* LINUX_HMM_H */