Introduce core_is_dirty mngt method
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
This commit is contained in:
parent
4a6fc035e9
commit
b1a6c467a0
@ -605,6 +605,15 @@ typedef void (*ocf_mngt_cache_flush_end_t)(ocf_cache_t cache,
|
||||
void ocf_mngt_cache_flush(ocf_cache_t cache,
|
||||
ocf_mngt_cache_flush_end_t cmpl, void *priv);
|
||||
|
||||
/**
|
||||
* @brief Check if core is dirty
|
||||
*
|
||||
* @param[in] core Core handle
|
||||
*
|
||||
* @retval true if core is dirty, false otherwise
|
||||
*/
|
||||
bool ocf_mngt_core_is_dirty(ocf_core_t core);
|
||||
|
||||
/**
|
||||
* @brief Check if cache is dirty
|
||||
*
|
||||
|
@ -96,8 +96,7 @@ static int _ocf_cleaner_run_check_dirty_inactive(ocf_cache_t cache)
|
||||
return 0;
|
||||
|
||||
for_each_core(cache, core, core_id) {
|
||||
if (core->opened && env_atomic_read(
|
||||
&core->runtime_meta->dirty_clines)) {
|
||||
if (core->opened && ocf_mngt_core_is_dirty(core)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -105,6 +105,11 @@ static void _ocf_mngt_end_flush(ocf_cache_t cache)
|
||||
env_mutex_unlock(&cache->flush_mutex);
|
||||
}
|
||||
|
||||
bool ocf_mngt_core_is_dirty(ocf_core_t core)
|
||||
{
|
||||
return !!env_atomic_read(&core->runtime_meta->dirty_clines);
|
||||
}
|
||||
|
||||
bool ocf_mngt_cache_is_dirty(ocf_cache_t cache)
|
||||
{
|
||||
ocf_core_t core;
|
||||
@ -113,7 +118,7 @@ bool ocf_mngt_cache_is_dirty(ocf_cache_t cache)
|
||||
OCF_CHECK_NULL(cache);
|
||||
|
||||
for_each_core(cache, core, core_id) {
|
||||
if (env_atomic_read(&core->runtime_meta->dirty_clines))
|
||||
if (ocf_mngt_core_is_dirty(core))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user