tests: mem_protect/demand_paging: wait a bit for NRU to work

This waits a bit for NRU eviction algorithm (which is the default)
to work its magic to clear the access bit of physical frames.
This increases the number of clean pages which can be evicted,
to make sure the number of clean pages evicted is not zero, which
would cause an assertion.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2021-04-26 13:44:08 -07:00 committed by Anas Nashif
parent c9c5221b96
commit bf287c6e2b

View File

@ -149,6 +149,10 @@ void test_touch_anon_pages(void)
zassert_not_equal(stats.eviction.dirty, 0UL,
"there should be dirty pages being evicted.");
#ifdef CONFIG_EVICTION_NRU
k_msleep(CONFIG_EVICTION_NRU_PERIOD * 2);
#endif /* CONFIG_EVICTION_NRU */
/* There should be some clean pages to be evicted now,
* since the arena is not modified.
*/