All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 0/3] Increase coverage for swapon syscall
@ 2026-08-28 11:10 Andrea Cervesato
  2026-08-28 11:10 ` [LTP] [PATCH v3 1/3] tse_swap: Add fallback definitions for swapon Andrea Cervesato
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andrea Cervesato @ 2026-08-28 11:10 UTC (permalink / raw)
  To: Linux Test Project

Complete the EINVAL coverage on invalid input data and create a new test
to verify discarding pages functionalities.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
Changes in v3:
- better description for fallbacks
- swapon02: make sure we swapoff() if swapon() accidentally pass
- Link to v2: https://lore.kernel.org/20260828-swapon_discard_coverage-v2-0-e55a86dad729@suse.com

Changes in v2:
- ensure buffer is flushed after discard using fsync()
- add messages to show what test cases we are running
- Link to v1: https://lore.kernel.org/20260827-swapon_discard_coverage-v1-0-633bcb11c181@suse.com

---
Andrea Cervesato (3):
      tse_swap: Add fallback definitions for swapon
      swapon04: Add test for discard flags
      swapon02: Add test cases for invalid swapflags

 include/tse_swap.h                          |  16 +++
 runtest/syscalls                            |   1 +
 testcases/kernel/syscalls/swapon/.gitignore |   1 +
 testcases/kernel/syscalls/swapon/swapon02.c |  60 ++++++--
 testcases/kernel/syscalls/swapon/swapon04.c | 204 ++++++++++++++++++++++++++++
 5 files changed, 267 insertions(+), 15 deletions(-)
---
base-commit: 8e6b93c2832ff4940091abafefd8b8f97539ff5b
change-id: 20260827-swapon_discard_coverage-34861d63fc55

Best regards,
--  
Andrea Cervesato <andrea.cervesato@suse.com>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [LTP] [PATCH v4 1/3] tse_swap: Add fallback definitions for swapon
@ 2026-09-03 13:04 Andrea Cervesato
  2026-09-03 16:01 ` [LTP] " linuxtestproject.agent
  0 siblings, 1 reply; 9+ messages in thread
From: Andrea Cervesato @ 2026-09-03 13:04 UTC (permalink / raw)
  To: Linux Test Project

From: Andrea Cervesato <andrea.cervesato@suse.com>

Introduce fallback definitions inside include/tse_swap.h for:

- SWAP_FLAG_PREFER
- SWAP_FLAG_PRIO_MASK
- SWAP_FLAG_DISCARD
- SWAP_FLAG_DISCARD_ONCE
- SWAP_FLAG_DISCARD_PAGES

Reviewed-by: Li Wang <li.wang@linux.dev>
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 include/tse_swap.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/tse_swap.h b/include/tse_swap.h
index c4979b3e5..25fe4ad77 100644
--- a/include/tse_swap.h
+++ b/include/tse_swap.h
@@ -14,6 +14,22 @@
 #ifndef TSE_SWAP_H__
 #define TSE_SWAP_H__
 
+#ifndef SWAP_FLAG_PREFER
+# define SWAP_FLAG_PREFER	0x8000
+#endif
+#ifndef SWAP_FLAG_PRIO_MASK
+# define SWAP_FLAG_PRIO_MASK	0x7fff
+#endif
+#ifndef SWAP_FLAG_DISCARD
+# define SWAP_FLAG_DISCARD	0x10000
+#endif
+#ifndef SWAP_FLAG_DISCARD_ONCE
+# define SWAP_FLAG_DISCARD_ONCE	0x20000
+#endif
+#ifndef SWAP_FLAG_DISCARD_PAGES
+# define SWAP_FLAG_DISCARD_PAGES 0x40000
+#endif
+
 enum swapfile_method {
     SWAPFILE_BY_SIZE,
     SWAPFILE_BY_BLKS

-- 
2.51.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2026-09-04  7:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28 11:10 [LTP] [PATCH v3 0/3] Increase coverage for swapon syscall Andrea Cervesato
2026-08-28 11:10 ` [LTP] [PATCH v3 1/3] tse_swap: Add fallback definitions for swapon Andrea Cervesato
2026-08-28 11:30   ` [LTP] " linuxtestproject.agent
2026-08-28 11:10 ` [LTP] [PATCH v3 2/3] swapon04: Add test for discard flags Andrea Cervesato
2026-09-03 11:18   ` Cyril Hrubis
2026-08-28 11:10 ` [LTP] [PATCH v3 3/3] swapon02: Add test cases for invalid swapflags Andrea Cervesato
2026-09-03 11:32   ` Cyril Hrubis
  -- strict thread matches above, loose matches on Subject: below --
2026-09-03 13:04 [LTP] [PATCH v4 1/3] tse_swap: Add fallback definitions for swapon Andrea Cervesato
2026-09-03 16:01 ` [LTP] " linuxtestproject.agent
2026-09-04  7:16   ` Andrea Cervesato via ltp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.