diff options
| author | Stefan Hajnoczi <[email protected]> | 2018-07-31 14:32:46 +0000 |
|---|---|---|
| committer | Dave Jiang <[email protected]> | 2018-08-01 00:05:42 +0000 |
| commit | b7751410c180a05fdc21268f8661b1480169b0df (patch) | |
| tree | ec5c8bf369681268987df2866ee387e7946d51ca /tools/perf/scripts/python/stat-cpi.py | |
| parent | tools/testing/nvdimm: improve emulation of smart injection (diff) | |
| download | kernel-b7751410c180a05fdc21268f8661b1480169b0df.tar.gz kernel-b7751410c180a05fdc21268f8661b1480169b0df.zip | |
device-dax: avoid hang on error before devm_memremap_pages()
dax_pmem_percpu_exit() waits for dax_pmem_percpu_release() to invoke the
dax_pmem->cmp completion. Unfortunately this approach to cleaning up
the percpu_ref only works after devm_memremap_pages() was successful.
If devm_add_action_or_reset() or devm_memremap_pages() fails,
dax_pmem_percpu_release() is not invoked. Therefore
dax_pmem_percpu_exit() hangs waiting for the completion:
rc = devm_add_action_or_reset(dev, dax_pmem_percpu_exit,
&dax_pmem->ref);
if (rc)
return rc;
dax_pmem->pgmap.ref = &dax_pmem->ref;
addr = devm_memremap_pages(dev, &dax_pmem->pgmap);
Avoid the hang by calling percpu_ref_exit() in the error paths instead
of going through dax_pmem_percpu_exit().
Signed-off-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Dave Jiang <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stat-cpi.py')
0 files changed, 0 insertions, 0 deletions
