MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dfs_pcache_limit_check

Function dfs_pcache_limit_check

components/dfs/dfs_v2/src/dfs_pcache.c:285–296  ·  view source on GitHub ↗

* @brief Check and enforce page cache memory limit * * This function checks if the current page cache usage exceeds the working level threshold. * If exceeded, it will trigger page cache release up to 4 times to reduce cache size. * * @return Always returns 0 indicating success */

Source from the content-addressed store, hash-verified

283 * @return Always returns 0 indicating success
284 */
285static int dfs_pcache_limit_check(void)
286{
287 int index = 4;
288
289 while (index && rt_atomic_load(&(__pcache.pages_count)) > RT_PAGECACHE_COUNT * RT_PAGECACHE_GC_WORK_LEVEL / 100)
290 {
291 dfs_pcache_release(0);
292 index --;
293 }
294
295 return 0;
296}
297
298/**
299 * @brief Page cache management thread

Callers 2

dfs_pcache_threadFunction · 0.85
dfs_page_lookupFunction · 0.85

Calls 1

dfs_pcache_releaseFunction · 0.85

Tested by

no test coverage detected