mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 09:56:18 +07:00
libnvdimm, dimm: Maximize label transfer size
Use kvzalloc() to bypass the arbitrary PAGE_SIZE limit of label transfer operations. Given the expense of calling into firmware, maximize the amount of label data we transfer per call to be up to the total label space if allowed by the firmware. Instead of limiting based on PAGE_SIZE we can instead simply limit the maximum size based on either the config_size int he case of the get operation, or the length of the write based on the set operation. On a system with 24 NVDIMM modules each with a config_size of 128K and a maximum transfer size of 64K - 4, this patch reduces the init time for the label data from around 24 seconds down to between 4-5 seconds. Reviewed-by: Toshi Kani <toshi.kani@hpe.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
91ed7ac444
commit
d11cf4a732
@ -111,8 +111,8 @@ int nvdimm_init_config_data(struct nvdimm_drvdata *ndd)
|
||||
if (!ndd->data)
|
||||
return -ENOMEM;
|
||||
|
||||
max_cmd_size = min_t(u32, PAGE_SIZE, ndd->nsarea.max_xfer);
|
||||
cmd = kzalloc(max_cmd_size + sizeof(*cmd), GFP_KERNEL);
|
||||
max_cmd_size = min_t(u32, ndd->nsarea.config_size, ndd->nsarea.max_xfer);
|
||||
cmd = kvzalloc(max_cmd_size + sizeof(*cmd), GFP_KERNEL);
|
||||
if (!cmd)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -134,7 +134,7 @@ int nvdimm_init_config_data(struct nvdimm_drvdata *ndd)
|
||||
memcpy(ndd->data + offset, cmd->out_buf, cmd->in_length);
|
||||
}
|
||||
dev_dbg(ndd->dev, "len: %zu rc: %d\n", offset, rc);
|
||||
kfree(cmd);
|
||||
kvfree(cmd);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@ -157,9 +157,8 @@ int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset,
|
||||
if (offset + len > ndd->nsarea.config_size)
|
||||
return -ENXIO;
|
||||
|
||||
max_cmd_size = min_t(u32, PAGE_SIZE, len);
|
||||
max_cmd_size = min_t(u32, max_cmd_size, ndd->nsarea.max_xfer);
|
||||
cmd = kzalloc(max_cmd_size + sizeof(*cmd) + sizeof(u32), GFP_KERNEL);
|
||||
max_cmd_size = min_t(u32, len, ndd->nsarea.max_xfer);
|
||||
cmd = kvzalloc(max_cmd_size + sizeof(*cmd) + sizeof(u32), GFP_KERNEL);
|
||||
if (!cmd)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -183,7 +182,7 @@ int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset,
|
||||
break;
|
||||
}
|
||||
}
|
||||
kfree(cmd);
|
||||
kvfree(cmd);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user