linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hmm: add ARCH_HAS_HMM_MIRROR ARCH_HAS_HMM_DEVICE Kconfig
@ 2019-04-17 21:11 jglisse
  2019-05-01 18:38 ` Jerome Glisse
  0 siblings, 1 reply; 4+ messages in thread
From: jglisse @ 2019-04-17 21:11 UTC (permalink / raw)
  To: linux-mm
  Cc: linux-kernel, Jérôme Glisse, Guenter Roeck,
	Leon Romanovsky, Jason Gunthorpe, Andrew Morton, Ralph Campbell,
	John Hubbard

From: Jérôme Glisse <jglisse@redhat.com>

This patch just add 2 new Kconfig that are _not use_ by anyone. I check
that various make ARCH=somearch allmodconfig do work and do not complain.
This new Kconfig need to be added first so that device driver that do
depend on HMM can be updated.

Once drivers are updated then i can update the HMM Kconfig to depends
on this new Kconfig in a followup patch.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Leon Romanovsky <leonro@mellanox.com>
Cc: Jason Gunthorpe <jgg@mellanox.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
---
 mm/Kconfig | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/mm/Kconfig b/mm/Kconfig
index 25c71eb8a7db..daadc9131087 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -676,6 +676,22 @@ config ZONE_DEVICE
 
 	  If FS_DAX is enabled, then say Y.
 
+config ARCH_HAS_HMM_MIRROR
+	bool
+	default y
+	depends on (X86_64 || PPC64)
+	depends on MMU && 64BIT
+
+config ARCH_HAS_HMM_DEVICE
+	bool
+	default y
+	depends on (X86_64 || PPC64)
+	depends on MEMORY_HOTPLUG
+	depends on MEMORY_HOTREMOVE
+	depends on SPARSEMEM_VMEMMAP
+	depends on ARCH_HAS_ZONE_DEVICE
+	select XARRAY_MULTI
+
 config ARCH_HAS_HMM
 	bool
 	default y
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/hmm: add ARCH_HAS_HMM_MIRROR ARCH_HAS_HMM_DEVICE Kconfig
  2019-04-17 21:11 [PATCH] mm/hmm: add ARCH_HAS_HMM_MIRROR ARCH_HAS_HMM_DEVICE Kconfig jglisse
@ 2019-05-01 18:38 ` Jerome Glisse
  2019-05-01 19:23   ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Jerome Glisse @ 2019-05-01 18:38 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Guenter Roeck, Leon Romanovsky, Jason Gunthorpe,
	Ralph Campbell, linux-mm, John Hubbard

Andrew just the patch that would be nice to get in 5.2 so i can fix
device driver Kconfig before doing the real update to mm HMM Kconfig

On Wed, Apr 17, 2019 at 05:11:41PM -0400, jglisse@redhat.com wrote:
> From: Jérôme Glisse <jglisse@redhat.com>
> 
> This patch just add 2 new Kconfig that are _not use_ by anyone. I check
> that various make ARCH=somearch allmodconfig do work and do not complain.
> This new Kconfig need to be added first so that device driver that do
> depend on HMM can be updated.
> 
> Once drivers are updated then i can update the HMM Kconfig to depends
> on this new Kconfig in a followup patch.
> 
> Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Leon Romanovsky <leonro@mellanox.com>
> Cc: Jason Gunthorpe <jgg@mellanox.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Ralph Campbell <rcampbell@nvidia.com>
> Cc: John Hubbard <jhubbard@nvidia.com>
> ---
>  mm/Kconfig | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/mm/Kconfig b/mm/Kconfig
> index 25c71eb8a7db..daadc9131087 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -676,6 +676,22 @@ config ZONE_DEVICE
>  
>  	  If FS_DAX is enabled, then say Y.
>  
> +config ARCH_HAS_HMM_MIRROR
> +	bool
> +	default y
> +	depends on (X86_64 || PPC64)
> +	depends on MMU && 64BIT
> +
> +config ARCH_HAS_HMM_DEVICE
> +	bool
> +	default y
> +	depends on (X86_64 || PPC64)
> +	depends on MEMORY_HOTPLUG
> +	depends on MEMORY_HOTREMOVE
> +	depends on SPARSEMEM_VMEMMAP
> +	depends on ARCH_HAS_ZONE_DEVICE
> +	select XARRAY_MULTI
> +
>  config ARCH_HAS_HMM
>  	bool
>  	default y
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/hmm: add ARCH_HAS_HMM_MIRROR ARCH_HAS_HMM_DEVICE Kconfig
  2019-05-01 18:38 ` Jerome Glisse
@ 2019-05-01 19:23   ` Guenter Roeck
  2019-05-02 16:22     ` Jerome Glisse
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2019-05-01 19:23 UTC (permalink / raw)
  To: Jerome Glisse
  Cc: Andrew Morton, linux-kernel, Leon Romanovsky, Jason Gunthorpe,
	Ralph Campbell, linux-mm, John Hubbard

On Wed, May 01, 2019 at 02:38:51PM -0400, Jerome Glisse wrote:
> Andrew just the patch that would be nice to get in 5.2 so i can fix
> device driver Kconfig before doing the real update to mm HMM Kconfig
> 
> On Wed, Apr 17, 2019 at 05:11:41PM -0400, jglisse@redhat.com wrote:
> > From: Jérôme Glisse <jglisse@redhat.com>
> > 
> > This patch just add 2 new Kconfig that are _not use_ by anyone. I check
> > that various make ARCH=somearch allmodconfig do work and do not complain.
> > This new Kconfig need to be added first so that device driver that do
> > depend on HMM can be updated.
> > 
> > Once drivers are updated then i can update the HMM Kconfig to depends
> > on this new Kconfig in a followup patch.
> > 

I am probably missing something, but why not submit the entire series together ?
That might explain why XARRAY_MULTI is enabled below, and what the series is
about. Additional comments below.

> > Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
> > Cc: Guenter Roeck <linux@roeck-us.net>
> > Cc: Leon Romanovsky <leonro@mellanox.com>
> > Cc: Jason Gunthorpe <jgg@mellanox.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Ralph Campbell <rcampbell@nvidia.com>
> > Cc: John Hubbard <jhubbard@nvidia.com>
> > ---
> >  mm/Kconfig | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> > 
> > diff --git a/mm/Kconfig b/mm/Kconfig
> > index 25c71eb8a7db..daadc9131087 100644
> > --- a/mm/Kconfig
> > +++ b/mm/Kconfig
> > @@ -676,6 +676,22 @@ config ZONE_DEVICE
> >  
> >  	  If FS_DAX is enabled, then say Y.
> >  
> > +config ARCH_HAS_HMM_MIRROR
> > +	bool
> > +	default y
> > +	depends on (X86_64 || PPC64)
> > +	depends on MMU && 64BIT
> > +
> > +config ARCH_HAS_HMM_DEVICE
> > +	bool
> > +	default y
> > +	depends on (X86_64 || PPC64)
> > +	depends on MEMORY_HOTPLUG
> > +	depends on MEMORY_HOTREMOVE
> > +	depends on SPARSEMEM_VMEMMAP
> > +	depends on ARCH_HAS_ZONE_DEVICE

This is almost identical to ARCH_HAS_HMM except ARCH_HAS_HMM
depends on ZONE_DEVICE and MMU && 64BIT. ARCH_HAS_HMM_MIRROR
and ARCH_HAS_HMM_DEVICE together almost match ARCH_HAS_HMM,
except for the ARCH_HAS_ZONE_DEVICE vs. ZONE_DEVICE dependency.
And ZONE_DEVICE selects XARRAY_MULTI, meaning there is really
substantial overlap.

Not really my concern, but personally I'd like to see some
reasoning why the additional options are needed .. thus the
question above, why not submit the series together ?

Thanks,
Guenter

> > +	select XARRAY_MULTI
> > +
> >  config ARCH_HAS_HMM
> >  	bool
> >  	default y
> > -- 
> > 2.20.1
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/hmm: add ARCH_HAS_HMM_MIRROR ARCH_HAS_HMM_DEVICE Kconfig
  2019-05-01 19:23   ` Guenter Roeck
@ 2019-05-02 16:22     ` Jerome Glisse
  0 siblings, 0 replies; 4+ messages in thread
From: Jerome Glisse @ 2019-05-02 16:22 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Andrew Morton, linux-kernel, Leon Romanovsky, Jason Gunthorpe,
	Ralph Campbell, linux-mm, John Hubbard

On Wed, May 01, 2019 at 12:23:58PM -0700, Guenter Roeck wrote:
> On Wed, May 01, 2019 at 02:38:51PM -0400, Jerome Glisse wrote:
> > Andrew just the patch that would be nice to get in 5.2 so i can fix
> > device driver Kconfig before doing the real update to mm HMM Kconfig
> > 
> > On Wed, Apr 17, 2019 at 05:11:41PM -0400, jglisse@redhat.com wrote:
> > > From: Jérôme Glisse <jglisse@redhat.com>
> > > 
> > > This patch just add 2 new Kconfig that are _not use_ by anyone. I check
> > > that various make ARCH=somearch allmodconfig do work and do not complain.
> > > This new Kconfig need to be added first so that device driver that do
> > > depend on HMM can be updated.
> > > 
> > > Once drivers are updated then i can update the HMM Kconfig to depends
> > > on this new Kconfig in a followup patch.
> > > 
> 
> I am probably missing something, but why not submit the entire series together ?
> That might explain why XARRAY_MULTI is enabled below, and what the series is
> about. Additional comments below.
> 
> > > Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
> > > Cc: Guenter Roeck <linux@roeck-us.net>
> > > Cc: Leon Romanovsky <leonro@mellanox.com>
> > > Cc: Jason Gunthorpe <jgg@mellanox.com>
> > > Cc: Andrew Morton <akpm@linux-foundation.org>
> > > Cc: Ralph Campbell <rcampbell@nvidia.com>
> > > Cc: John Hubbard <jhubbard@nvidia.com>
> > > ---
> > >  mm/Kconfig | 16 ++++++++++++++++
> > >  1 file changed, 16 insertions(+)
> > > 
> > > diff --git a/mm/Kconfig b/mm/Kconfig
> > > index 25c71eb8a7db..daadc9131087 100644
> > > --- a/mm/Kconfig
> > > +++ b/mm/Kconfig
> > > @@ -676,6 +676,22 @@ config ZONE_DEVICE
> > >  
> > >  	  If FS_DAX is enabled, then say Y.
> > >  
> > > +config ARCH_HAS_HMM_MIRROR
> > > +	bool
> > > +	default y
> > > +	depends on (X86_64 || PPC64)
> > > +	depends on MMU && 64BIT
> > > +
> > > +config ARCH_HAS_HMM_DEVICE
> > > +	bool
> > > +	default y
> > > +	depends on (X86_64 || PPC64)
> > > +	depends on MEMORY_HOTPLUG
> > > +	depends on MEMORY_HOTREMOVE
> > > +	depends on SPARSEMEM_VMEMMAP
> > > +	depends on ARCH_HAS_ZONE_DEVICE
> 
> This is almost identical to ARCH_HAS_HMM except ARCH_HAS_HMM
> depends on ZONE_DEVICE and MMU && 64BIT. ARCH_HAS_HMM_MIRROR
> and ARCH_HAS_HMM_DEVICE together almost match ARCH_HAS_HMM,
> except for the ARCH_HAS_ZONE_DEVICE vs. ZONE_DEVICE dependency.
> And ZONE_DEVICE selects XARRAY_MULTI, meaning there is really
> substantial overlap.
> 
> Not really my concern, but personally I'd like to see some
> reasoning why the additional options are needed .. thus the
> question above, why not submit the series together ?
> 

There is no serie here, this is about solving Kconfig for HMM given
that device driver are going through their own tree we want to avoid
changing them from the mm tree. So plan is:

1 - Kernel release N add the new Kconfig to mm/Kconfig (this patch)
2 - Kernel release N+1 update driver to depend on new Kconfig ie
    stop using ARCH_HASH_HMM and start using ARCH_HAS_HMM_MIRROR
    and ARCH_HAS_HMM_DEVICE (one or the other or both depending
    on the driver)
3 - Kernel release N+2 remove ARCH_HASH_HMM and do final Kconfig
    update in mm/Kconfig

This has been discuss in the past and while it is bit painfull it
is the easiest solution (outside git topic branch but mm tree is
not merge as git).

Cheers,
Jérôme

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-02 16:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 21:11 [PATCH] mm/hmm: add ARCH_HAS_HMM_MIRROR ARCH_HAS_HMM_DEVICE Kconfig jglisse
2019-05-01 18:38 ` Jerome Glisse
2019-05-01 19:23   ` Guenter Roeck
2019-05-02 16:22     ` Jerome Glisse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).