Patchwork [v5,1/2] dax: introduce CONFIG_DAX_DRIVER

login
register
mail settings
Submitter Dan Williams
Date Sept. 22, 2017, 4:25 p.m.
Message ID <150609750599.25862.7194470012203223173.stgit@dwillia2-desk3.amr.corp.intel.com>
Download mbox | patch
Permalink /patch/9966663/
State Superseded, archived
Delegated to: Mike Snitzer
Headers show

Comments

Dan Williams - Sept. 22, 2017, 4:25 p.m.
In support of allowing device-mapper to compile out idle/dead code when
there are no dax providers in the system, introduce the DAX_DRIVER
symbol. This is selected by all leaf drivers that device-mapper might be
layered on top. This allows device-mapper to conditionally 'select DAX'
only when a provider is present.

Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Bart Van Assche <Bart.VanAssche@wdc.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 arch/powerpc/platforms/Kconfig |    1 +
 drivers/block/Kconfig          |    1 +
 drivers/dax/Kconfig            |    4 +++-
 drivers/nvdimm/Kconfig         |    1 +
 drivers/s390/block/Kconfig     |    1 +
 5 files changed, 7 insertions(+), 1 deletion(-)


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Michael Ellerman - Sept. 29, 2017, 6:11 a.m.
Dan Williams <dan.j.williams@intel.com> writes:

> In support of allowing device-mapper to compile out idle/dead code when
> there are no dax providers in the system, introduce the DAX_DRIVER
> symbol. This is selected by all leaf drivers that device-mapper might be
> layered on top. This allows device-mapper to conditionally 'select DAX'
> only when a provider is present.
>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Mike Snitzer <snitzer@redhat.com>
> Cc: Bart Van Assche <Bart.VanAssche@wdc.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  arch/powerpc/platforms/Kconfig |    1 +
>  drivers/block/Kconfig          |    1 +
>  drivers/dax/Kconfig            |    4 +++-
>  drivers/nvdimm/Kconfig         |    1 +
>  drivers/s390/block/Kconfig     |    1 +
>  5 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
> index 4fd64d3f5c44..4561340c1f92 100644
> --- a/arch/powerpc/platforms/Kconfig
> +++ b/arch/powerpc/platforms/Kconfig
> @@ -296,6 +296,7 @@ config AXON_RAM
>  	tristate "Axon DDR2 memory device driver"
>  	depends on PPC_IBM_CELL_BLADE && BLOCK
>  	select DAX
> +	select DAX_DRIVER


I would have thought you'd want to replace the select of DAX with
a select of DAX_DRIVER?

With the driver selecting both there's no need for the core to select
DAX, because all the DAX drivers have done it already.

cheers

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Dan Williams - Sept. 29, 2017, 2:47 p.m.
On Thu, Sep 28, 2017 at 11:11 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> Dan Williams <dan.j.williams@intel.com> writes:
>
>> In support of allowing device-mapper to compile out idle/dead code when
>> there are no dax providers in the system, introduce the DAX_DRIVER
>> symbol. This is selected by all leaf drivers that device-mapper might be
>> layered on top. This allows device-mapper to conditionally 'select DAX'
>> only when a provider is present.
>>
>> Cc: Paul Mackerras <paulus@samba.org>
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
>> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
>> Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Cc: Mike Snitzer <snitzer@redhat.com>
>> Cc: Bart Van Assche <Bart.VanAssche@wdc.com>
>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
>> ---
>>  arch/powerpc/platforms/Kconfig |    1 +
>>  drivers/block/Kconfig          |    1 +
>>  drivers/dax/Kconfig            |    4 +++-
>>  drivers/nvdimm/Kconfig         |    1 +
>>  drivers/s390/block/Kconfig     |    1 +
>>  5 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
>> index 4fd64d3f5c44..4561340c1f92 100644
>> --- a/arch/powerpc/platforms/Kconfig
>> +++ b/arch/powerpc/platforms/Kconfig
>> @@ -296,6 +296,7 @@ config AXON_RAM
>>       tristate "Axon DDR2 memory device driver"
>>       depends on PPC_IBM_CELL_BLADE && BLOCK
>>       select DAX
>> +     select DAX_DRIVER
>
>
> I would have thought you'd want to replace the select of DAX with
> a select of DAX_DRIVER?

Me too ;-)

> With the driver selecting both there's no need for the core to select
> DAX, because all the DAX drivers have done it already.

Thanks, yes, I'll fix that up.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Patch

diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 4fd64d3f5c44..4561340c1f92 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -296,6 +296,7 @@  config AXON_RAM
 	tristate "Axon DDR2 memory device driver"
 	depends on PPC_IBM_CELL_BLADE && BLOCK
 	select DAX
+	select DAX_DRIVER
 	default m
 	help
 	  It registers one block device per Axon's DDR2 memory bank found
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 4a438b8abe27..5d4821c91a76 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -298,6 +298,7 @@  config BLK_DEV_SX8
 config BLK_DEV_RAM
 	tristate "RAM block device support"
 	select DAX if BLK_DEV_RAM_DAX
+	select DAX_DRIVER if BLK_DEV_RAM_DAX
 	---help---
 	  Saying Y here will allow you to use a portion of your RAM memory as
 	  a block device, so that you can make file systems on it, read and
diff --git a/drivers/dax/Kconfig b/drivers/dax/Kconfig
index b79aa8f7a497..9bf940eb9c06 100644
--- a/drivers/dax/Kconfig
+++ b/drivers/dax/Kconfig
@@ -1,3 +1,6 @@ 
+config DAX_DRIVER
+	bool
+
 menuconfig DAX
 	tristate "DAX: direct access to differentiated memory"
 	select SRCU
@@ -16,7 +19,6 @@  config DEV_DAX
 	  baseline memory pool.  Mappings of a /dev/daxX.Y device impose
 	  restrictions that make the mapping behavior deterministic.
 
-
 config DEV_DAX_PMEM
 	tristate "PMEM DAX: direct access to persistent memory"
 	depends on LIBNVDIMM && NVDIMM_DAX && DEV_DAX
diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig
index 5bdd499b5f4f..afe4018d76cf 100644
--- a/drivers/nvdimm/Kconfig
+++ b/drivers/nvdimm/Kconfig
@@ -21,6 +21,7 @@  config BLK_DEV_PMEM
 	tristate "PMEM: Persistent memory block device support"
 	default LIBNVDIMM
 	select DAX
+	select DAX_DRIVER
 	select ND_BTT if BTT
 	select ND_PFN if NVDIMM_PFN
 	help
diff --git a/drivers/s390/block/Kconfig b/drivers/s390/block/Kconfig
index 31f014b57bfc..3f563f2f33d6 100644
--- a/drivers/s390/block/Kconfig
+++ b/drivers/s390/block/Kconfig
@@ -15,6 +15,7 @@  config BLK_DEV_XPRAM
 config DCSSBLK
 	def_tristate m
 	select DAX
+	select DAX_DRIVER
 	prompt "DCSSBLK support"
 	depends on S390 && BLOCK
 	help