Re: [nvdimm PATCH 6/6] nvdimm: Use namespace index data to reduce number of label reads needed

Dan Williams
2018-10-12T01:35:39Z

On Wed, Oct 10, 2018 at 4:51 PM Alexander Duyck
<alexander.h.duyck@linux.intel.com> wrote:
>
> This patch adds logic that is meant to make use of the namespace index data
> to reduce the number of reads that are needed to initialize a given
> namespace. The general idea is that once we have enough data to validate
> the namespace index we do so and then proceed to fetch only those labels
> that are not listed as being "free". By doing this I am seeing a total time
> reduction from about 4-5 seconds to 2-3 seconds for 24 NVDIMM modules each
> with 128K of label config area.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> ---
> drivers/nvdimm/dimm.c | 4 --
> drivers/nvdimm/label.c | 93 +++++++++++++++++++++++++++++++++++++++++++++---
> drivers/nvdimm/label.h | 3 --
> 3 files changed, 88 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/nvdimm/dimm.c b/drivers/nvdimm/dimm.c
> index 07bf96948553..9899c97138a3 100644
> --- a/drivers/nvdimm/dimm.c
> +++ b/drivers/nvdimm/dimm.c
> @@ -452,7 +455,87 @@ int nd_label_data_init(struct nvdimm_drvdata *ndd)
[..]
> + /* Loop through the free list pulling in any active labels */
> + for (i = 0; i < nsindex->nslot; i++, offset += ndd->nslabel_size) {

0day points out a sparse warning on that usage of nslot which is an
__le32. I'll append a fixup.