From: Jason Gunthorpe <[email protected]>
There is no reason for a user to select this or not directly - it should
be selected by drivers that are going to use the feature, similar to how
CONFIG_HMM_MIRROR works.
Currently all drivers provide a feature kconfig that will disable use of
DEVICE_PRIVATE in that driver, allowing users to avoid enabling this if
they don't want the overhead.
Acked-by: Felix Kuehling <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
---
arch/powerpc/Kconfig | 2 +-
drivers/gpu/drm/nouveau/Kconfig | 2 +-
mm/Kconfig | 7 +------
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 924c541a926008..8de52aefdc74cc 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -455,7 +455,7 @@ config PPC_TRANSACTIONAL_MEM
config PPC_UV
bool "Ultravisor support"
depends on KVM_BOOK3S_HV_POSSIBLE
- depends on DEVICE_PRIVATE
+ select DEVICE_PRIVATE
default n
help
This option paravirtualizes the kernel to run in POWER platforms that
diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index d6e4ae1ef7053a..af5793f3e7c2cf 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -86,10 +86,10 @@ config DRM_NOUVEAU_BACKLIGHT
config DRM_NOUVEAU_SVM
bool "(EXPERIMENTAL) Enable SVM (Shared Virtual Memory) support"
- depends on DEVICE_PRIVATE
depends on DRM_NOUVEAU
depends on MMU
depends on STAGING
+ select DEVICE_PRIVATE
select HMM_MIRROR
select MMU_NOTIFIER
default n
diff --git a/mm/Kconfig b/mm/Kconfig
index c1acc34c1c358c..7ca36bf5f5058e 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -805,15 +805,10 @@ config HMM_MIRROR
depends on MMU
config DEVICE_PRIVATE
- bool "Unaddressable device memory (GPU memory, ...)"
+ bool
depends on ZONE_DEVICE
select DEV_PAGEMAP_OPS
- help
- Allows creation of struct pages to represent unaddressable device
- memory; i.e., memory that is only accessible from the device (or
- group of devices). You likely also want to select HMM_MIRROR.
-
config FRAME_VECTOR
bool
--
2.26.2
On 2020-05-01 11:20, Jason Gunthorpe wrote:
> From: Jason Gunthorpe <[email protected]>
>
> There is no reason for a user to select this or not directly - it should
> be selected by drivers that are going to use the feature, similar to how
> CONFIG_HMM_MIRROR works.
Yes, this is a nice touch.
Reviewed-by: John Hubbard <[email protected]>
thanks,
--
John Hubbard
NVIDIA
>
> Currently all drivers provide a feature kconfig that will disable use of
> DEVICE_PRIVATE in that driver, allowing users to avoid enabling this if
> they don't want the overhead.
>
> Acked-by: Felix Kuehling <[email protected]>
> Reviewed-by: Christoph Hellwig <[email protected]>
> Signed-off-by: Jason Gunthorpe <[email protected]>
> ---
> arch/powerpc/Kconfig | 2 +-
> drivers/gpu/drm/nouveau/Kconfig | 2 +-
> mm/Kconfig | 7 +------
> 3 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 924c541a926008..8de52aefdc74cc 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -455,7 +455,7 @@ config PPC_TRANSACTIONAL_MEM
> config PPC_UV
> bool "Ultravisor support"
> depends on KVM_BOOK3S_HV_POSSIBLE
> - depends on DEVICE_PRIVATE
> + select DEVICE_PRIVATE
> default n
> help
> This option paravirtualizes the kernel to run in POWER platforms that
> diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
> index d6e4ae1ef7053a..af5793f3e7c2cf 100644
> --- a/drivers/gpu/drm/nouveau/Kconfig
> +++ b/drivers/gpu/drm/nouveau/Kconfig
> @@ -86,10 +86,10 @@ config DRM_NOUVEAU_BACKLIGHT
>
> config DRM_NOUVEAU_SVM
> bool "(EXPERIMENTAL) Enable SVM (Shared Virtual Memory) support"
> - depends on DEVICE_PRIVATE
> depends on DRM_NOUVEAU
> depends on MMU
> depends on STAGING
> + select DEVICE_PRIVATE
> select HMM_MIRROR
> select MMU_NOTIFIER
> default n
> diff --git a/mm/Kconfig b/mm/Kconfig
> index c1acc34c1c358c..7ca36bf5f5058e 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -805,15 +805,10 @@ config HMM_MIRROR
> depends on MMU
>
> config DEVICE_PRIVATE
> - bool "Unaddressable device memory (GPU memory, ...)"
> + bool
> depends on ZONE_DEVICE
> select DEV_PAGEMAP_OPS
>
> - help
> - Allows creation of struct pages to represent unaddressable device
> - memory; i.e., memory that is only accessible from the device (or
> - group of devices). You likely also want to select HMM_MIRROR.
> -
> config FRAME_VECTOR
> bool
>
>
On Fri, 1 May 2020 15:20:44 -0300 Jason Gunthorpe <[email protected]> wrote:
> From: Jason Gunthorpe <[email protected]>
>
> There is no reason for a user to select this or not directly - it should
> be selected by drivers that are going to use the feature, similar to how
> CONFIG_HMM_MIRROR works.
>
> Currently all drivers provide a feature kconfig that will disable use of
> DEVICE_PRIVATE in that driver, allowing users to avoid enabling this if
> they don't want the overhead.
>
I'm not too sure what's going on here, but i386 allmodconfig broke.
kernel/resource.c: In function '__request_free_mem_region':
kernel/resource.c:1653:28: error: 'PA_SECTION_SHIFT' undeclared (first use in this function); did you mean 'SECTIONS_PGSHIFT'?
size = ALIGN(size, 1UL << PA_SECTION_SHIFT);
because in current mainline, allmodconfig produces
CONFIG_DEVICE_PRIVATE=n but in current linux-next, allmodconfig
produces CONFIG_DEVICE_PRIVATE=y. But CONFIG_SPARSEMEM=n so the build
breaks.
Bisection fingers this commit, but reverting it doesn't seem to fix
things. Could you take a look please?
I'm seeing this from menuconfig:
WARNING: unmet direct dependencies detected for DEVICE_PRIVATE
Depends on [n]: ZONE_DEVICE [=n]
Selected by [m]:
- DRM_NOUVEAU_SVM [=y] && HAS_IOMEM [=y] && DRM_NOUVEAU [=m] && MMU [=y] && STAGING [=y]
- TEST_HMM [=m] && RUNTIME_TESTING_MENU [=y] && TRANSPARENT_HUGEPAGE [=y]
`select' rather sucks this way - easy to break dependencies. Quite a
number of years ago the Kconfig gurus were saying "avoid", but I don't
recall the details.
On Sat, May 09, 2020 at 05:16:12PM -0700, Andrew Morton wrote:
> On Fri, 1 May 2020 15:20:44 -0300 Jason Gunthorpe <[email protected]> wrote:
>
> > From: Jason Gunthorpe <[email protected]>
> >
> > There is no reason for a user to select this or not directly - it should
> > be selected by drivers that are going to use the feature, similar to how
> > CONFIG_HMM_MIRROR works.
> >
> > Currently all drivers provide a feature kconfig that will disable use of
> > DEVICE_PRIVATE in that driver, allowing users to avoid enabling this if
> > they don't want the overhead.
> >
>
> I'm not too sure what's going on here, but i386 allmodconfig broke.
>
> kernel/resource.c: In function '__request_free_mem_region':
> kernel/resource.c:1653:28: error: 'PA_SECTION_SHIFT' undeclared (first use in this function); did you mean 'SECTIONS_PGSHIFT'?
> size = ALIGN(size, 1UL << PA_SECTION_SHIFT);
>
> because in current mainline, allmodconfig produces
> CONFIG_DEVICE_PRIVATE=n but in current linux-next, allmodconfig
> produces CONFIG_DEVICE_PRIVATE=y. But CONFIG_SPARSEMEM=n so the build
> breaks.
I think Arnd identified this, let us just revet the patch that caused
it.
> Bisection fingers this commit, but reverting it doesn't seem to fix
> things. Could you take a look please?
There is a latter patch adding a 'select DEVICE_PRIVATE' so reverting
this needs to swap that to 'depends on'.
I've done both and updated git
Regards,
Jason