* @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 */
| 283 | * @return Always returns 0 indicating success |
| 284 | */ |
| 285 | static 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 |
no test coverage detected