Improve concurrency by dropping the write lock around
dt_object_sync(). This is safe because all consistency
related to a single object is supposed to be maintained
by the osd internally. In this case:
1) osd_object_sync() doesn't rely on the object at all:
global sync is called
2) even if object is being destroyed at the same time -
we're holding a reference, so we're safe
3) dt_version_get() -> osd_xattr_get() has own internal
locking, protecting xattr consistency to improve
concurrency
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Prakash Surya <surya1@llnl.gov>
Change-Id: I60c5b6a1d10afc717a24e7471071f1e2fdb89c29
Reviewed-on: http://review.whamcloud.com/4117
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
GOTO(out, rc = PTR_ERR(fo));
}
GOTO(out, rc = PTR_ERR(fo));
}
- ofd_write_lock(env, fo);
if (!ofd_object_exists(fo))
if (!ofd_object_exists(fo))
- GOTO(unlock, rc = -ENOENT);
+ GOTO(put, rc = -ENOENT);
if (dt_version_get(env, ofd_object_child(fo)) >
ofd_obd(ofd)->obd_last_committed) {
rc = dt_object_sync(env, ofd_object_child(fo));
if (rc)
if (dt_version_get(env, ofd_object_child(fo)) >
ofd_obd(ofd)->obd_last_committed) {
rc = dt_object_sync(env, ofd_object_child(fo));
if (rc)
}
oinfo->oi_oa->o_valid = OBD_MD_FLID;
}
oinfo->oi_oa->o_valid = OBD_MD_FLID;
ofd_counter_incr(exp, LPROC_OFD_STATS_SYNC, oinfo->oi_jobid, 1);
EXIT;
ofd_counter_incr(exp, LPROC_OFD_STATS_SYNC, oinfo->oi_jobid, 1);
EXIT;
-unlock:
- ofd_write_unlock(env, fo);
ofd_object_put(env, fo);
out:
return rc;
ofd_object_put(env, fo);
out:
return rc;