Re: [PATCH 7/8] device-dax: Add support for a dax override driver
From: Williams, Dan J
Date: Wed Nov 07 2018 - 18:42:40 EST
On Tue, 2018-10-30 at 20:13 -0700, Dan Williams wrote:
+AD4- Introduce the 'new+AF8-id' concept for enabling a custom device-driver attach
+AD4- policy for dax-bus drivers. The intended use is to have a mechanism for
+AD4- hot-plugging device-dax ranges into the page allocator on-demand. With
+AD4- this in place the default policy of using device-dax for performance
+AD4- differentiated memory can be overridden by user-space policy that can
+AD4- arrange for the memory range to be managed as 'System RAM' with
+AD4- user-defined NUMA and other performance attributes.
+AD4-
+AD4- Signed-off-by: Dan Williams +ADw-dan.j.williams+AEA-intel.com+AD4-
+AD4- ---
+AD4- drivers/dax/bus.c +AHw- 145 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+---
+AD4- drivers/dax/bus.h +AHw- 10 +-+-+-
+AD4- drivers/dax/device.c +AHw- 11 +-+---
+AD4- 3 files changed, 156 insertions(+-), 10 deletions(-)
+AD4-
+AD4-
Here's an incremental fixup for the string matching in this patch, I'll
send a v2 if other review comments come in:
diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index 178d76504f79..17af6fbc3be5 100644
--- a/drivers/dax/bus.c
+-+-+- b/drivers/dax/bus.c
+AEAAQA- -39,7 +-39,7 +AEAAQA- static struct dax+AF8-id +ACoAXwBf-dax+AF8-match+AF8-id(struct dax+AF8-device+AF8-driver +ACo-dax+AF8-drv,
lockdep+AF8-assert+AF8-held(+ACY-dax+AF8-bus+AF8-lock)+ADs-
list+AF8-for+AF8-each+AF8-entry(dax+AF8-id, +ACY-dax+AF8-drv-+AD4-ids, list)
- if (strcmp(dax+AF8-id-+AD4-dev+AF8-name, dev+AF8-name) +AD0APQ- 0)
+- if (sysfs+AF8-streq(dax+AF8-id-+AD4-dev+AF8-name, dev+AF8-name))
return dax+AF8-id+ADs-
return NULL+ADs-
+AH0-
+AEAAQA- -60,6 +-60,7 +AEAAQA- static ssize+AF8-t do+AF8-id+AF8-store(struct device+AF8-driver +ACo-drv, const char +ACo-buf,
+AHs-
struct dax+AF8-device+AF8-driver +ACo-dax+AF8-drv +AD0- to+AF8-dax+AF8-drv(drv)+ADs-
unsigned int region+AF8-id, id+ADs-
+- char devname+AFs-DAX+AF8-NAME+AF8-LEN+AF0AOw-
struct dax+AF8-id +ACo-dax+AF8-id+ADs-
ssize+AF8-t rc +AD0- count+ADs-
int fields+ADs-
+AEAAQA- -67,8 +-68,8 +AEAAQA- static ssize+AF8-t do+AF8-id+AF8-store(struct device+AF8-driver +ACo-drv, const char +ACo-buf,
fields +AD0- sscanf(buf, +ACI-dax+ACU-d.+ACU-d+ACI-, +ACY-region+AF8-id, +ACY-id)+ADs-
if (fields +ACEAPQ- 2)
return -EINVAL+ADs-
-
- if (strlen(buf) +- 1 +AD4- DAX+AF8-NAME+AF8-LEN)
+- sprintf(devname, +ACI-dax+ACU-d.+ACU-d+ACI-, region+AF8-id, id)+ADs-
+- if (+ACE-sysfs+AF8-streq(buf, devname))
return -EINVAL+ADs-
mutex+AF8-lock(+ACY-dax+AF8-bus+AF8-lock)+ADs-
+AEAAQA- -99,7 +-100,6 +AEAAQA- static ssize+AF8-t new+AF8-id+AF8-store(struct device+AF8-driver +ACo-drv, const char +ACo-buf,
+AH0-
static DRIVER+AF8-ATTR+AF8-WO(new+AF8-id)+ADs-
-
static ssize+AF8-t remove+AF8-id+AF8-store(struct device+AF8-driver +ACo-drv, const char +ACo-buf,
size+AF8-t count)
+AHs-