Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1416506

Re: [PATCH 04/13] libnvdimm, nfit: move flush hint mapping to dimm driver

From "Kani, Toshimitsu" <toshi.kani@hpe.com>
Newsgroups linux.kernel
Subject Re: [PATCH 04/13] libnvdimm, nfit: move flush hint mapping to dimm driver
Date 2016-06-07 20:50 +0200
Message-ID <rHtLz-64y-9@gated-at.bofh.it> (permalink)
References <rGqPM-5Oy-3@gated-at.bofh.it> <rGqPM-5Oy-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, 2016-06-04 at 13:52 -0700, Dan Williams wrote:
 :
> diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
> index 420e1a5e2250..5b6f85d00bb5 100644
> --- a/drivers/nvdimm/region_devs.c
> +++ b/drivers/nvdimm/region_devs.c
> @@ -803,11 +803,29 @@ EXPORT_SYMBOL_GPL(nvdimm_volatile_region_create);
>   */
>  void nvdimm_flush(struct nd_region *nd_region)
>  {
> +	int i;
> +
>  	/*
> -	 * TODO: replace wmb_pmem() usage with flush hint writes where
> -	 * available.
> +	 * The first wmb() is needed to 'sfence' all previous writes
> +	 * such that they are architecturally visible for the platform
> +	 * buffer flush.  Note that we've already arranged for pmem
> +	 * writes to avoid the cache via arch_memcpy_to_pmem().  The
> +	 * final wmb() ensures ordering for the NVDIMM flush write.
>  	 */
> -	wmb_pmem();
> +	wmb();
> +	for (i = 0; i < nd_region->ndr_mappings; i++) {
> +		struct nd_mapping *nd_mapping = &nd_region->mapping[i];
> +		struct nvdimm_drvdata *ndd = to_ndd_unlocked(nd_mapping);
> +
> +		/*
> +		 * Note, nvdimm_drvdata guaranteed to be live since we
> +		 * arrange for all associated regions to be disabled
> +		 * before the dimm is disabled.
> +		 */
> +		if (ndd->flush_wpq[0])

Hi Dan,

ndd is NULL on our system since nvdimm_probe() always fails
in nvdimm_init_nsarea(), which then calls put_ndd() and
nvdimm_drvdata_release().

Thanks,
-Toshi

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 04/13] libnvdimm,  nfit: move flush hint mapping to dimm driver Dan Williams <dan.j.williams@intel.com> - 2016-06-04 23:00 +0200
  Re: [PATCH 04/13] libnvdimm, nfit: move flush hint mapping to dimm  driver kbuild test robot <lkp@intel.com> - 2016-06-04 23:50 +0200
  Re: [PATCH 04/13] libnvdimm, nfit: move flush hint mapping to dimm  driver kbuild test robot <lkp@intel.com> - 2016-06-05 00:10 +0200
  Re: [PATCH 04/13] libnvdimm, nfit: move flush hint mapping to dimm driver Dan Williams <dan.j.williams@intel.com> - 2016-06-07 20:20 +0200
  Re: [PATCH 04/13] libnvdimm, nfit: move flush hint mapping to dimm  driver "Kani, Toshimitsu" <toshi.kani@hpe.com> - 2016-06-07 20:50 +0200

csiph-web