* [LTP] [PATCH 1/1] libswap: Fix tst_max_swapfiles() for SLE12-SP5
@ 2024-05-20 12:40 Petr Vorel
2024-05-20 12:43 ` Petr Vorel
2024-05-20 15:10 ` Cyril Hrubis
0 siblings, 2 replies; 3+ messages in thread
From: Petr Vorel @ 2024-05-20 12:40 UTC (permalink / raw)
To: ltp
SLE12-SP4 backported 5042db43cc26. It's now EOL, but SLE12-SP5 is still
supported, thus fix tst_max_swapfiles() detection.
While at it, fix whitespace.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
NOTE: this should get merged before release.
I can split whitelist change into a separate commit.
libs/libltpswap/libswap.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/libs/libltpswap/libswap.c b/libs/libltpswap/libswap.c
index eb066df71..6c21ac8af 100644
--- a/libs/libltpswap/libswap.c
+++ b/libs/libltpswap/libswap.c
@@ -243,24 +243,31 @@ bool is_swap_supported(const char *filename)
*/
int tst_max_swapfiles(void)
{
- unsigned int swp_migration_num = 0, swp_hwpoison_num = 0, swp_device_num = 0, swp_pte_marker_num = 0;
+ unsigned int swp_migration_num = 0, swp_hwpoison_num = 0,
+ swp_device_num = 0, swp_pte_marker_num = 0;
struct tst_kconfig_var migration = TST_KCONFIG_INIT("CONFIG_MIGRATION");
struct tst_kconfig_var memory = TST_KCONFIG_INIT("CONFIG_MEMORY_FAILURE");
struct tst_kconfig_var device = TST_KCONFIG_INIT("CONFIG_DEVICE_PRIVATE");
struct tst_kconfig_var marker = TST_KCONFIG_INIT("CONFIG_PTE_MARKER");
- struct tst_kern_exv kvers[] = {
+ struct tst_kern_exv kvers_marker_migration[] = {
/* RHEL9 kernel has patch 6c287605f and 679d10331 since 5.14.0-179 */
{ "RHEL9", "5.14.0-179" },
{ NULL, NULL},
};
+ struct tst_kern_exv kvers_device[] = {
+ /* SLES12-SP4 has patch 5042db43cc26 since 4.12.14-5.5 */
+ { "SLES", "4.12.14-5.5" },
+ { NULL, NULL},
+ };
+
tst_kconfig_read(&migration, 1);
tst_kconfig_read(&memory, 1);
tst_kconfig_read(&device, 1);
tst_kconfig_read(&marker, 1);
if (migration.choice == 'y') {
- if (tst_kvercmp2(5, 19, 0, kvers) < 0)
+ if (tst_kvercmp2(5, 19, 0, kvers_marker_migration) < 0)
swp_migration_num = 2;
else
swp_migration_num = 3;
@@ -270,18 +277,19 @@ int tst_max_swapfiles(void)
swp_hwpoison_num = 1;
if (device.choice == 'y') {
- if (tst_kvercmp(4, 14, 0) >= 0)
+ if (tst_kvercmp2(4, 14, 0, kvers_device) >= 0)
swp_device_num = 2;
if (tst_kvercmp(5, 14, 0) >= 0)
swp_device_num = 4;
}
- if ((marker.choice == 'y' && tst_kvercmp2(5, 19, 0, kvers) >= 0) ||
- tst_kvercmp(6, 2, 0) >= 0) {
+ if ((marker.choice == 'y' && tst_kvercmp(6, 2, 0) >= 0) ||
+ tst_kvercmp2(5, 19, 0, kvers_marker_migration) >= 0) {
swp_pte_marker_num = 1;
}
- return DEFAULT_MAX_SWAPFILE - swp_migration_num - swp_hwpoison_num - swp_device_num - swp_pte_marker_num;
+ return DEFAULT_MAX_SWAPFILE - swp_migration_num - swp_hwpoison_num
+ - swp_device_num - swp_pte_marker_num;
}
/*
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH 1/1] libswap: Fix tst_max_swapfiles() for SLE12-SP5
2024-05-20 12:40 [LTP] [PATCH 1/1] libswap: Fix tst_max_swapfiles() for SLE12-SP5 Petr Vorel
@ 2024-05-20 12:43 ` Petr Vorel
2024-05-20 15:10 ` Cyril Hrubis
1 sibling, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2024-05-20 12:43 UTC (permalink / raw)
To: ltp
Hi all,
> SLE12-SP4 backported 5042db43cc26. It's now EOL, but SLE12-SP5 is still
> supported, thus fix tst_max_swapfiles() detection.
FYI this fixes swapon03 on SLE12-SP5.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH 1/1] libswap: Fix tst_max_swapfiles() for SLE12-SP5
2024-05-20 12:40 [LTP] [PATCH 1/1] libswap: Fix tst_max_swapfiles() for SLE12-SP5 Petr Vorel
2024-05-20 12:43 ` Petr Vorel
@ 2024-05-20 15:10 ` Cyril Hrubis
1 sibling, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2024-05-20 15:10 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> SLE12-SP4 backported 5042db43cc26. It's now EOL, but SLE12-SP5 is still
> supported, thus fix tst_max_swapfiles() detection.
>
> While at it, fix whitespace.
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> NOTE: this should get merged before release.
>
> I can split whitelist change into a separate commit.
Yes please.
> libs/libltpswap/libswap.c | 22 +++++++++++++++-------
> 1 file changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/libs/libltpswap/libswap.c b/libs/libltpswap/libswap.c
> index eb066df71..6c21ac8af 100644
> --- a/libs/libltpswap/libswap.c
> +++ b/libs/libltpswap/libswap.c
> @@ -243,24 +243,31 @@ bool is_swap_supported(const char *filename)
> */
> int tst_max_swapfiles(void)
> {
> - unsigned int swp_migration_num = 0, swp_hwpoison_num = 0, swp_device_num = 0, swp_pte_marker_num = 0;
> + unsigned int swp_migration_num = 0, swp_hwpoison_num = 0,
> + swp_device_num = 0, swp_pte_marker_num = 0;
> struct tst_kconfig_var migration = TST_KCONFIG_INIT("CONFIG_MIGRATION");
> struct tst_kconfig_var memory = TST_KCONFIG_INIT("CONFIG_MEMORY_FAILURE");
> struct tst_kconfig_var device = TST_KCONFIG_INIT("CONFIG_DEVICE_PRIVATE");
> struct tst_kconfig_var marker = TST_KCONFIG_INIT("CONFIG_PTE_MARKER");
> - struct tst_kern_exv kvers[] = {
> + struct tst_kern_exv kvers_marker_migration[] = {
> /* RHEL9 kernel has patch 6c287605f and 679d10331 since 5.14.0-179 */
> { "RHEL9", "5.14.0-179" },
> { NULL, NULL},
> };
>
> + struct tst_kern_exv kvers_device[] = {
> + /* SLES12-SP4 has patch 5042db43cc26 since 4.12.14-5.5 */
> + { "SLES", "4.12.14-5.5" },
> + { NULL, NULL},
> + };
> +
> tst_kconfig_read(&migration, 1);
> tst_kconfig_read(&memory, 1);
> tst_kconfig_read(&device, 1);
> tst_kconfig_read(&marker, 1);
>
> if (migration.choice == 'y') {
> - if (tst_kvercmp2(5, 19, 0, kvers) < 0)
> + if (tst_kvercmp2(5, 19, 0, kvers_marker_migration) < 0)
> swp_migration_num = 2;
> else
> swp_migration_num = 3;
> @@ -270,18 +277,19 @@ int tst_max_swapfiles(void)
> swp_hwpoison_num = 1;
>
> if (device.choice == 'y') {
> - if (tst_kvercmp(4, 14, 0) >= 0)
> + if (tst_kvercmp2(4, 14, 0, kvers_device) >= 0)
> swp_device_num = 2;
> if (tst_kvercmp(5, 14, 0) >= 0)
> swp_device_num = 4;
> }
>
> - if ((marker.choice == 'y' && tst_kvercmp2(5, 19, 0, kvers) >= 0) ||
> - tst_kvercmp(6, 2, 0) >= 0) {
> + if ((marker.choice == 'y' && tst_kvercmp(6, 2, 0) >= 0) ||
> + tst_kvercmp2(5, 19, 0, kvers_marker_migration) >= 0) {
The 5.19 and 6.2 seems to be swapped after the patch, that does not look
right.
> swp_pte_marker_num = 1;
> }
>
> - return DEFAULT_MAX_SWAPFILE - swp_migration_num - swp_hwpoison_num - swp_device_num - swp_pte_marker_num;
> + return DEFAULT_MAX_SWAPFILE - swp_migration_num - swp_hwpoison_num
> + - swp_device_num - swp_pte_marker_num;
> }
>
> /*
> --
> 2.43.0
>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-20 15:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-20 12:40 [LTP] [PATCH 1/1] libswap: Fix tst_max_swapfiles() for SLE12-SP5 Petr Vorel
2024-05-20 12:43 ` Petr Vorel
2024-05-20 15:10 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox