Commit 83762cb5 authored by Dan Williams's avatar Dan Williams
Browse files

dax: Kill DEV_DAX_PMEM_COMPAT



The /sys/class/dax compatibility option has shipped in the kernel for 4
years now which should be sufficient time for tools to abandon the old
ABI in favor of the /sys/bus/dax device-model. Delete it now and see if
anyone screams.

Since this compatibility option shipped there has been more reports of
users being surprised by the compat ABI than surprised by the "new", so
the compat infrastructure has outlived its usefulness. Recall that
/sys/bus/dax device-model is required for the dax kmem driver which
allows PMEM to be used as "System RAM".

The following projects were known to have a dependency on /sys/class/dax
and have dropped their dependency as of the listed version:

- ndctl (including libndctl, daxctl, and libdaxctl): v64+
- fio: v3.13+
- pmdk: v1.5.2+

As further evidence this option is no longer needed some distributions
have already stopped enabling CONFIG_DEV_DAX_PMEM_COMPAT.

Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Reported-by: default avatarVishal Verma <vishal.l.verma@intel.com>
Acked-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: default avatarJane Chu <jane.chu@oracle.com>
Link: https://lore.kernel.org/r/163701116195.3784476.726128179293466337.stgit@dwillia2-desk3.amr.corp.intel.com


Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent fa55b7dc
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
What:           /sys/class/dax/
Date:           May, 2016
KernelVersion:  v4.7
Contact:        nvdimm@lists.linux.dev
Description:	Device DAX is the device-centric analogue of Filesystem
		DAX (CONFIG_FS_DAX).  It allows memory ranges to be
		allocated and mapped without need of an intervening file
		system.  Device DAX is strict, precise and predictable.
		Specifically this interface:

		1. Guarantees fault granularity with respect to a given
		   page size (pte, pmd, or pud) set at configuration time.

		2. Enforces deterministic behavior by being strict about
		   what fault scenarios are supported.

		The /sys/class/dax/ interface enumerates all the
		device-dax instances in the system. The ABI is
		deprecated and will be removed after 2020. It is
		replaced with the DAX bus interface /sys/bus/dax/ where
		device-dax instances can be found under
		/sys/bus/dax/devices/
+0 −9
Original line number Diff line number Diff line
@@ -70,13 +70,4 @@ config DEV_DAX_KMEM

	  Say N if unsure.

config DEV_DAX_PMEM_COMPAT
	tristate "PMEM DAX: support the deprecated /sys/class/dax interface"
	depends on m && DEV_DAX_PMEM=m
	default DEV_DAX_PMEM
	help
	  Older versions of the libdaxctl library expect to find all
	  device-dax instances under /sys/class/dax. If libdaxctl in
	  your distribution is older than v58 say M, otherwise say N.

endif
+2 −1
Original line number Diff line number Diff line
@@ -2,10 +2,11 @@
obj-$(CONFIG_DAX) += dax.o
obj-$(CONFIG_DEV_DAX) += device_dax.o
obj-$(CONFIG_DEV_DAX_KMEM) += kmem.o
obj-$(CONFIG_DEV_DAX_PMEM) += dax_pmem.o

dax-y := super.o
dax-y += bus.o
device_dax-y := device.o
dax_pmem-y := pmem.o

obj-y += pmem/
obj-y += hmem/
+2 −19
Original line number Diff line number Diff line
@@ -10,8 +10,6 @@
#include "dax-private.h"
#include "bus.h"

static struct class *dax_class;

static DEFINE_MUTEX(dax_bus_lock);

#define DAX_NAME_LEN 30
@@ -1343,10 +1341,7 @@ struct dev_dax *devm_create_dev_dax(struct dev_dax_data *data)

	inode = dax_inode(dax_dev);
	dev->devt = inode->i_rdev;
	if (data->subsys == DEV_DAX_BUS)
	dev->bus = &dax_bus_type;
	else
		dev->class = dax_class;
	dev->parent = parent;
	dev->type = &dev_dax_type;

@@ -1445,22 +1440,10 @@ EXPORT_SYMBOL_GPL(dax_driver_unregister);

int __init dax_bus_init(void)
{
	int rc;

	if (IS_ENABLED(CONFIG_DEV_DAX_PMEM_COMPAT)) {
		dax_class = class_create(THIS_MODULE, "dax");
		if (IS_ERR(dax_class))
			return PTR_ERR(dax_class);
	}

	rc = bus_register(&dax_bus_type);
	if (rc)
		class_destroy(dax_class);
	return rc;
	return bus_register(&dax_bus_type);
}

void __exit dax_bus_exit(void)
{
	bus_unregister(&dax_bus_type);
	class_destroy(dax_class);
}
+0 −13
Original line number Diff line number Diff line
@@ -16,24 +16,15 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
		struct range *range, int target_node, unsigned int align,
		unsigned long flags);

enum dev_dax_subsys {
	DEV_DAX_BUS = 0, /* zeroed dev_dax_data picks this by default */
	DEV_DAX_CLASS,
};

struct dev_dax_data {
	struct dax_region *dax_region;
	struct dev_pagemap *pgmap;
	enum dev_dax_subsys subsys;
	resource_size_t size;
	int id;
};

struct dev_dax *devm_create_dev_dax(struct dev_dax_data *data);

/* to be deleted when DEV_DAX_CLASS is removed */
struct dev_dax *__dax_pmem_probe(struct device *dev, enum dev_dax_subsys subsys);

struct dax_device_driver {
	struct device_driver drv;
	struct list_head ids;
@@ -49,10 +40,6 @@ int __dax_driver_register(struct dax_device_driver *dax_drv,
void dax_driver_unregister(struct dax_device_driver *dax_drv);
void kill_dev_dax(struct dev_dax *dev_dax);

#if IS_ENABLED(CONFIG_DEV_DAX_PMEM_COMPAT)
int dev_dax_probe(struct dev_dax *dev_dax);
#endif

/*
 * While run_dax() is potentially a generic operation that could be
 * defined in include/linux/dax.h we don't want to grow any users
Loading