libnvdimm: cycle flush hints
authorDan Williams <dan.j.williams@intel.com>
Fri, 27 May 2016 16:23:01 +0000 (09:23 -0700)
committerDan Williams <dan.j.williams@intel.com>
Mon, 11 Jul 2016 23:16:03 +0000 (16:16 -0700)
commit0c27af60d1bbd33c7d3dffb46a4c9f6aa103d754
tree8ee81feb4fcd84140077008b15e5c295d19ad972
parentf284a4f23752d0334e482d04e0a584d19c9c8cd0
libnvdimm: cycle flush hints

When the NFIT provides multiple flush hint addresses per-dimm it is
expressing that the platform is capable of processing multiple flush
requests in parallel.  There is some fixed cost per flush request, let
the cost be shared in parallel on multiple cpus.

Since there may not be enough flush hint addresses for each cpu to have
one, keep a per-cpu index of the last used hint, hash it with current
pid, and assume that access pattern and scheduler randomness will keep
the flush-hint usage somewhat staggered across cpus.

Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/nd.h
drivers/nvdimm/region_devs.c