[LTP] [PATCH 0/1] overcommit_memory: Remove unstable subtest

Joerg Vehlow lkml@jv-coder.de
Wed Nov 18 08:54:31 CET 2020


Hi,

I did some experiments and made the per cpu counters visible. Then I 
realized kernel developers are not that stupid ;)
The per cpu counters can only grow up to batch size and down to negative 
batch size, then they are flushed back to the global counter.

That means the counter seen by __vm_enough_memory can only be off in the 
interval [-numcpu * batch_size, numcpu * batch_size]. So the test can be 
fixed by trying to allocate commit_left + numcpu * batch_size.
Now the only problem is, that the batch size is not visible to 
userspace, so has to be calculated. It depends on the number of cpus and 
total memory pages:
max(ncpus*2, 32, min(int32_max, ram_pages / ncpus / 256) = batch_size 
(in pages)

I guess we can determine these two values from userspace and add the 
batch size to commit_left.
I will prepare a new patch with this approach.

Jörg


More information about the ltp mailing list