* [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup
@ 2024-05-21 7:49 Petr Vorel
2024-05-21 7:49 ` [LTP] [PATCH v2 1/3] libswap: Split long lines (readability) Petr Vorel
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Petr Vorel @ 2024-05-21 7:49 UTC (permalink / raw)
To: ltp
Hi,
Changes v1->v2:
* Don't swap 5.19 and 6.2 conditions (Cyril)
* Separate whitelist changes to "libswap: Split long lines
(readability)"
* Add new commit "libswap: Remove function description"
@Cyril any change I could rebase and merge this patch (Li acked)
* libs: Remove 'libltp' prefix from libs source directories
https://patchwork.ozlabs.org/project/ltp/patch/20240419110230.191809-1-pvorel@suse.cz/
Petr Vorel (3):
libswap: Split long lines (readability)
libswap: Fix tst_max_swapfiles() for SLE12-SP5
libswap: Remove function description
libs/libltpswap/libswap.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 7+ messages in thread* [LTP] [PATCH v2 1/3] libswap: Split long lines (readability) 2024-05-21 7:49 [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup Petr Vorel @ 2024-05-21 7:49 ` Petr Vorel 2024-05-21 8:30 ` Li Wang 2024-05-21 7:49 ` [LTP] [PATCH v2 2/3] libswap: Fix tst_max_swapfiles() for SLE12-SP5 Petr Vorel ` (2 subsequent siblings) 3 siblings, 1 reply; 7+ messages in thread From: Petr Vorel @ 2024-05-21 7:49 UTC (permalink / raw) To: ltp Signed-off-by: Petr Vorel <pvorel@suse.cz> --- Changes v1->v2: * Separated from the next commit libs/libltpswap/libswap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/libltpswap/libswap.c b/libs/libltpswap/libswap.c index eb066df71..0066ca734 100644 --- a/libs/libltpswap/libswap.c +++ b/libs/libltpswap/libswap.c @@ -93,7 +93,9 @@ static int file_is_contiguous(const char *filename) fd = SAFE_OPEN(filename, O_RDONLY); - fiemap = (struct fiemap *)SAFE_MALLOC(sizeof(struct fiemap) + sizeof(struct fiemap_extent)); + fiemap = (struct fiemap *)SAFE_MALLOC(sizeof(struct fiemap) + + sizeof(struct fiemap_extent)); + memset(fiemap, 0, sizeof(struct fiemap) + sizeof(struct fiemap_extent)); fiemap->fm_start = 0; @@ -243,7 +245,8 @@ 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"); @@ -281,7 +284,8 @@ int tst_max_swapfiles(void) 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] 7+ messages in thread
* Re: [LTP] [PATCH v2 1/3] libswap: Split long lines (readability) 2024-05-21 7:49 ` [LTP] [PATCH v2 1/3] libswap: Split long lines (readability) Petr Vorel @ 2024-05-21 8:30 ` Li Wang 0 siblings, 0 replies; 7+ messages in thread From: Li Wang @ 2024-05-21 8:30 UTC (permalink / raw) To: Petr Vorel; +Cc: ltp Hi Petr, For series: Reviewed-by: Li Wang <liwang@redhat.com> On Tue, May 21, 2024 at 3:50 PM Petr Vorel <pvorel@suse.cz> wrote: > Signed-off-by: Petr Vorel <pvorel@suse.cz> > --- > Changes v1->v2: > * Separated from the next commit > > libs/libltpswap/libswap.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/libs/libltpswap/libswap.c b/libs/libltpswap/libswap.c > index eb066df71..0066ca734 100644 > --- a/libs/libltpswap/libswap.c > +++ b/libs/libltpswap/libswap.c > @@ -93,7 +93,9 @@ static int file_is_contiguous(const char *filename) > > fd = SAFE_OPEN(filename, O_RDONLY); > > - fiemap = (struct fiemap *)SAFE_MALLOC(sizeof(struct fiemap) + > sizeof(struct fiemap_extent)); > + fiemap = (struct fiemap *)SAFE_MALLOC(sizeof(struct fiemap) > + + sizeof(struct > fiemap_extent)); > + > memset(fiemap, 0, sizeof(struct fiemap) + sizeof(struct > fiemap_extent)); > > fiemap->fm_start = 0; > @@ -243,7 +245,8 @@ 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"); > @@ -281,7 +284,8 @@ int tst_max_swapfiles(void) > 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 > > -- Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 7+ messages in thread
* [LTP] [PATCH v2 2/3] libswap: Fix tst_max_swapfiles() for SLE12-SP5 2024-05-21 7:49 [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup Petr Vorel 2024-05-21 7:49 ` [LTP] [PATCH v2 1/3] libswap: Split long lines (readability) Petr Vorel @ 2024-05-21 7:49 ` Petr Vorel 2024-05-21 7:49 ` [LTP] [PATCH v2 3/3] libswap: Remove function description Petr Vorel 2024-05-21 9:03 ` [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup Cyril Hrubis 3 siblings, 0 replies; 7+ messages in thread From: Petr Vorel @ 2024-05-21 7:49 UTC (permalink / raw) To: ltp SLE12-SP4 backported kernel commit 5042db43cc26. It's now EOL, but SLE12-SP5 is still supported, this fixes swapon03 on it. Signed-off-by: Petr Vorel <pvorel@suse.cz> --- Changes v1->v2: * Don't swap 5.19 and 6.2 conditions (Cyril) * Separate whitelist changes to "libswap: Split long lines (readability)" libs/libltpswap/libswap.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/libs/libltpswap/libswap.c b/libs/libltpswap/libswap.c index 0066ca734..e587f315e 100644 --- a/libs/libltpswap/libswap.c +++ b/libs/libltpswap/libswap.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved. + * Copyright (c) Linux Test Project, 2014-2024 * Author: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com> */ @@ -251,19 +252,25 @@ int tst_max_swapfiles(void) 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; @@ -273,14 +280,15 @@ 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_kvercmp2(5, 19, 0, kvers_marker_migration) >= 0) + || tst_kvercmp(6, 2, 0) >= 0) { swp_pte_marker_num = 1; } -- 2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [LTP] [PATCH v2 3/3] libswap: Remove function description 2024-05-21 7:49 [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup Petr Vorel 2024-05-21 7:49 ` [LTP] [PATCH v2 1/3] libswap: Split long lines (readability) Petr Vorel 2024-05-21 7:49 ` [LTP] [PATCH v2 2/3] libswap: Fix tst_max_swapfiles() for SLE12-SP5 Petr Vorel @ 2024-05-21 7:49 ` Petr Vorel 2024-05-21 9:03 ` [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup Cyril Hrubis 3 siblings, 0 replies; 7+ messages in thread From: Petr Vorel @ 2024-05-21 7:49 UTC (permalink / raw) To: ltp We have docs in libswap.h, better not duplicate the description. Fixes: 703406ba4 ("doc: libltpswap: Add kerneldoc") Signed-off-by: Petr Vorel <pvorel@suse.cz> --- New in v2 libs/libltpswap/libswap.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libs/libltpswap/libswap.c b/libs/libltpswap/libswap.c index e587f315e..ce419a76e 100644 --- a/libs/libltpswap/libswap.c +++ b/libs/libltpswap/libswap.c @@ -241,9 +241,6 @@ bool is_swap_supported(const char *filename) return true; } -/* - * Get kernel constant MAX_SWAPFILES value. - */ int tst_max_swapfiles(void) { unsigned int swp_migration_num = 0, swp_hwpoison_num = 0, @@ -296,9 +293,6 @@ int tst_max_swapfiles(void) - swp_device_num - swp_pte_marker_num; } -/* - * Get the used swapfiles number. - */ int tst_count_swaps(void) { FILE *fp; -- 2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup 2024-05-21 7:49 [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup Petr Vorel ` (2 preceding siblings ...) 2024-05-21 7:49 ` [LTP] [PATCH v2 3/3] libswap: Remove function description Petr Vorel @ 2024-05-21 9:03 ` Cyril Hrubis 2024-05-21 9:48 ` Petr Vorel 3 siblings, 1 reply; 7+ messages in thread From: Cyril Hrubis @ 2024-05-21 9:03 UTC (permalink / raw) To: Petr Vorel; +Cc: ltp Hi! > * Don't swap 5.19 and 6.2 conditions (Cyril) > * Separate whitelist changes to "libswap: Split long lines > (readability)" > * Add new commit "libswap: Remove function description" The libswap patchset looks good to me now: Reviewed-by: Cyril Hrubis <chrubis@suse.cz> > @Cyril any change I could rebase and merge this patch (Li acked) > > * libs: Remove 'libltp' prefix from libs source directories > https://patchwork.ozlabs.org/project/ltp/patch/20240419110230.191809-1-pvorel@suse.cz/ Can we please do that after the release, it's quite late now. -- Cyril Hrubis chrubis@suse.cz -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup 2024-05-21 9:03 ` [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup Cyril Hrubis @ 2024-05-21 9:48 ` Petr Vorel 0 siblings, 0 replies; 7+ messages in thread From: Petr Vorel @ 2024-05-21 9:48 UTC (permalink / raw) To: Cyril Hrubis; +Cc: ltp > Hi! > > * Don't swap 5.19 and 6.2 conditions (Cyril) > > * Separate whitelist changes to "libswap: Split long lines > > (readability)" > > * Add new commit "libswap: Remove function description" > The libswap patchset looks good to me now: > Reviewed-by: Cyril Hrubis <chrubis@suse.cz> Thanks a lot, merged! > > @Cyril any change I could rebase and merge this patch (Li acked) > > * libs: Remove 'libltp' prefix from libs source directories > > https://patchwork.ozlabs.org/project/ltp/patch/20240419110230.191809-1-pvorel@suse.cz/ > Can we please do that after the release, it's quite late now. Sure, I'll postpone that. Kind regards, Petr -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-05-21 9:49 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-05-21 7:49 [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup Petr Vorel 2024-05-21 7:49 ` [LTP] [PATCH v2 1/3] libswap: Split long lines (readability) Petr Vorel 2024-05-21 8:30 ` Li Wang 2024-05-21 7:49 ` [LTP] [PATCH v2 2/3] libswap: Fix tst_max_swapfiles() for SLE12-SP5 Petr Vorel 2024-05-21 7:49 ` [LTP] [PATCH v2 3/3] libswap: Remove function description Petr Vorel 2024-05-21 9:03 ` [LTP] [PATCH v2 0/3] libswap: Fix SLE12-SP5 + cleanup Cyril Hrubis 2024-05-21 9:48 ` Petr Vorel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox