[LTP] min_free_kbytes: Handle transient memory drops in check_monitor

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Fri Aug 7 02:01:13 CEST 2026


Hi Wei,

On Thu, 6 Aug 2026, Wei Gao wrote:
> min_free_kbytes: Handle transient memory drops in check_monitor

> 			for (i = 0; i < 200; i++) {
> 				usleep(10000);
> 				memfree = SAFE_READ_MEMINFO("MemFree:");
> 				if (memfree < min_memfree)
> 					min_memfree = memfree;
>
> 				if (memfree >= tune)
> 					break;
> 			}

Could min_free_kbytes be reread during this loop, or could the monitor be
synchronized with each test case? test_tune() can install the next value while
this loop still compares MemFree with the previous value. This can report a
failure for a value that is no longer configured, or accept recovery to an old
lower value after a higher value has been installed.

> 			for (i = 0; i < 200; i++) {
> 				usleep(10000);

Could this use exponential-backoff polling instead? A fixed usleep() loop uses
timed waits to synchronize with asynchronous reclaim, which the LTP
synchronization rules prohibit.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer


More information about the ltp mailing list