qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/2] tests/functional: add memlock tests
@ 2025-04-17 11:40 Alexandr Moshkov
  2025-04-17 11:40 ` [PATCH v6 1/2] tests/functional: add skipLockedMemoryTest decorator Alexandr Moshkov
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Alexandr Moshkov @ 2025-04-17 11:40 UTC (permalink / raw)
  To: qemu-devel
  Cc: Cleber Rosa, yc-core @ yandex-team . ru, Paolo Bonzini,
	Daniel P . Berrangé, Alexandr Moshkov

Add new tests to check the correctness of the `-overcommit memlock`
option (possible values: off, on, on-fault) by using
`/proc/{qemu_pid}/smaps` file to check in Size, Rss and Locked fields of
anonymous segments:

* if `memlock=off`, then Locked = 0 on every anonymous smaps;
* if `memlock=on`, then Size, Rss and Locked values must be equal for
every anon smaps where Rss is not 0;
* if `memlock=on-fault`, then Rss and Locked must be equal on every anon
smaps and anonymous segment with Rss < Size must exists.

---

v5 -> v6:
* add python3 shebang to tests/functional/test_memlock.py

v4 -> v5:
* refactor skipLockedMemoryTest decorator: using resource.getrlimit()
  function instead of spawning a process

v3 -> v4:
* add skipLockedMemoryTest decorator to skip test if system's locked
  memory limit is below the required threashold;
* add to MemlockTest skipLockedMemoryTest decorator with 2 GB limit.

v2 -> v3:
Move tests to tests/functional dir, as the tests/avocado dir is being phased out.
v2 was [PATCH v2] tests/avocado: add memlock tests.
Supersedes: <20250414075702.9248-1-dtalexundeer@yandex-team.ru>

v1 -> v2:
In the previous send, i forgot to specify new patch version (v2)
So i resend previous patch with version specified.


Alexandr Moshkov (2):
  tests/functional: add skipLockedMemoryTest decorator
  tests/functional: add memlock tests

 tests/functional/meson.build             |   1 +
 tests/functional/qemu_test/__init__.py   |   2 +-
 tests/functional/qemu_test/decorators.py |  18 ++++
 tests/functional/test_memlock.py         | 104 +++++++++++++++++++++++
 4 files changed, 124 insertions(+), 1 deletion(-)
 create mode 100755 tests/functional/test_memlock.py

-- 
2.34.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-05-21 12:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 11:40 [PATCH v6 0/2] tests/functional: add memlock tests Alexandr Moshkov
2025-04-17 11:40 ` [PATCH v6 1/2] tests/functional: add skipLockedMemoryTest decorator Alexandr Moshkov
2025-05-21 10:25   ` Thomas Huth
2025-04-17 11:40 ` [PATCH v6 2/2] tests/functional: add memlock tests Alexandr Moshkov
2025-05-21 12:06   ` Thomas Huth
2025-04-28  9:34 ` [PATCH v6 0/2] " Alexandr Moshkov
2025-05-21  8:52 ` Alexandr Moshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).