Remove redundant locks from metadata flush/load all

Locks acquired in ocf_metadata_flush(/load)_all are
acquired only for the duration of queueing asynch
service for flush/load, no actual metadata accesses
are performed there.

Also flush/load all are always performed with metadata
marked as deinitialized (metadata reference counter freezed),
so no I/O is reading nor writing the metadata. The only source
of potential concurrent metadata accesses are other management
operations, which should be synchronized using management lock.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski 2020-11-23 15:39:00 -06:00
parent 3acbe657c5
commit d2af0bafda

View File

@ -120,17 +120,13 @@ ocf_cache_line_t ocf_metadata_get_cachelines_count(ocf_cache_t cache)
void ocf_metadata_flush_all(ocf_cache_t cache,
ocf_metadata_end_t cmpl, void *priv)
{
ocf_metadata_start_shared_access(&cache->metadata.lock);
cache->metadata.iface.flush_all(cache, cmpl, priv);
ocf_metadata_end_shared_access(&cache->metadata.lock);
}
void ocf_metadata_load_all(ocf_cache_t cache,
ocf_metadata_end_t cmpl, void *priv)
{
ocf_metadata_start_exclusive_access(&cache->metadata.lock);
cache->metadata.iface.load_all(cache, cmpl, priv);
ocf_metadata_end_exclusive_access(&cache->metadata.lock);
}
void ocf_metadata_load_recovery(ocf_cache_t cache,