Merge pull request #479 from arutk/lru_fix3

Always call LRU_set_hot() under hash bucket lock
This commit is contained in:
Michał Mielewczyk 2021-03-26 11:04:59 +01:00 committed by GitHub
commit a6c8cbb1ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -598,8 +598,8 @@ int ocf_engine_prepare_clines(struct ocf_request *req)
mapped = ocf_engine_is_mapped(req);
if (mapped) {
lock = lock_clines(req);
ocf_hb_req_prot_unlock_rd(req);
ocf_engine_set_hot(req);
ocf_hb_req_prot_unlock_rd(req);
return lock;
}
@ -615,6 +615,8 @@ int ocf_engine_prepare_clines(struct ocf_request *req)
/* Mapping must be performed holding (at least) hash-bucket write lock */
ocf_hb_req_prot_lock_upgrade(req);
result = ocf_prepare_clines_miss(req);
if (!ocf_req_test_mapping_error(req))
ocf_engine_set_hot(req);
ocf_hb_req_prot_unlock_wr(req);
if (ocf_req_test_clean_eviction(req)) {
@ -622,9 +624,6 @@ int ocf_engine_prepare_clines(struct ocf_request *req)
128);
}
if (!ocf_req_test_mapping_error(req))
ocf_engine_set_hot(req);
return result;
}