mem/swapping01: Make sure swap is supported by kernel
PATCH 1/1 mem/swapping01: Make sure swap is supported by kernel
Previous version caused false positive result
on machines support no swap in kernel.
--- testcases/kernel/mem/swapping/swapping01.c | 7 +++++++ 1 file changed, 7 insertions(+)
testcases/kernel/mem/swapping/swapping01.c +7 -0
@@ -155,11 +155,18 @@ static void check_swapping(void)SAFE_WAITPID (pid, &status,0 ); } +static void setup (void ) +{ +if (access ("/proc/swaps" ,F_OK )) +tst_brk (TCONF ,"swap not supported by kernel" ); +} +static struct tst_test test = { .needs_root =1 , .forks_child =1 , .min_mem_avail =10 , .test_all = test_swapping, + .setup = setup, .tags = (const struct tst_tag []) { {"linux-git" ,"50a15981a1fa" }, {}
Signature · 5 lines
2.35.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Applied, thanks.
I guess that the SAFE_OPEN() caused TBROK on machines without CONFIG_SWAP, right?
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Absolutely correct 🙂
Thanks for the review!
-Bogdan
________________________________
From: Cyril Hrubis <[email protected]>
Sent: Thursday, February 10, 2022 18:11
To: Bogdan Lezhepekov <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
Hi!
Applied, thanks.
I guess that the SAFE_OPEN() caused TBROK on machines without CONFIG_SWAP, right?
--
Cyril Hrubis
[email protected]
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 6 lines · Cyril Hrubis
Hi!
Applied, thanks.I guess that the
SAFE_OPEN()caused TBROK on machines withoutCONFIG_SWAP, right?
If so, why not go fix with .needs_config for "CONFIG_SWAP=y" ?
Signature · 2 lines
Regards, Li Wang
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Li
Quoted 5 lines
On Fri, Feb 11, 2022 at 12:09 AM Cyril Hrubis <[email protected] <mailto:[email protected]>> wrote:
Quoted 8 lines
Hi!
Applied, thanks.I guess that the
SAFE_OPEN()caused TBROK on machines withoutCONFIG_SWAP, right?If so, why not go fix with .needs_config for "
CONFIG_SWAP=y" ?
+1, it is also friendly to docparse.
ps: I never listen user complaint for the lack of CONFIG_PORC, so only using .needs_config for "CONFIG_SWAP=y" can work well.
Best Regards
Yang Xu
Quoted 8 lines
--
Regards,
Li Wang
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi all,
I didn't go for CONFIG_SWAP just because wanted to be aligned with syscalls/swapon/swapon03.c and to not multiply patterns.
If you see CONFIG_SWAP more beneficial for docparser, I can make another patch.
Should I?
Cheers,
Bogdan
________________________________
From: ltp <[email protected]> on behalf of [email protected] <[email protected]>
Sent: Friday, February 11, 2022 3:21
To: Li Wang <[email protected]>
Cc: LTP List <[email protected]>
Subject: Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
Hi Li
Quoted 5 lines
On Fri, Feb 11, 2022 at 12:09 AM Cyril Hrubis <[email protected] <mailto:[email protected]>> wrote:
Quoted 8 lines
Hi!
Applied, thanks.I guess that the
SAFE_OPEN()caused TBROK on machines withoutCONFIG_SWAP, right?If so, why not go fix with .needs_config for "
CONFIG_SWAP=y" ?
+1, it is also friendly to docparse.
ps: I never listen user complaint for the lack of CONFIG_PORC, so only using .needs_config for "CONFIG_SWAP=y" can work well.
Best Regards
Yang Xu
Quoted 8 lines
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Bogdan
Quoted 9 lines
Hi all,
I didn't go for
CONFIG_SWAPjust because wanted to be aligned withsyscalls/swapon/swapon03.cand to not multiply patterns.If you see
CONFIG_SWAPmore beneficial for docparser, I can make another patch.Should I?
IMO, yes, but let's listen voice from other maintainers. @Petr,@Cyril
Best Regards
Yang Xu
Quoted 44 lines
Cheers,
Bogdan
------------------------------------------------------------------------
*From:* ltp <[email protected]> on behalf of [email protected] <[email protected]> *Sent:* Friday, February 11, 2022 3:21
*To:* Li Wang <[email protected]>
*Cc:* LTP List <[email protected]>
*Subject:* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
Hi LiQuoted 5 lines
On Fri, Feb 11, 2022 at 12:09 AM Cyril Hrubis <[email protected] <mailto:[email protected]>> wrote:
Quoted 8 lines
Hi!
Applied, thanks.I guess that the
SAFE_OPEN()caused TBROK on machines withoutCONFIG_SWAP, right?If so, why not go fix with .needs_config for "
CONFIG_SWAP=y" ?+1, it is also friendly to docparse.
ps: I never listen user complaint for the lack of
CONFIG_PORC, so only using .needs_config for "CONFIG_SWAP=y" can work well.Best Regards
Yang XuQuoted 8 lines
--
Regards,
Li Wang--
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi all,
Quoted 6 lines
Hi Bogdan
Quoted 4 lines
Hi all,
I didn't go for
CONFIG_SWAPjust because wanted to be aligned withsyscalls/swapon/swapon03.cand to not multiply patterns.
Quoted 6 lines
Quoted 4 lines
If you see
CONFIG_SWAPmore beneficial for docparser, I can make another patch.Should I?
IMO, yes, but let's listen voice from other maintainers. @Petr,@Cyril
We have 3 options.
1) keep check access("/proc/swaps", F_OK)
2) use .needs_config for "CONFIG_SWAP=y"
3) Add .needs_swap flag to struct tst_test
To be honest, I'm not sure, what's the best, probably .needs_config. I worried little bit about .needs_config forcing config to be available in the past, but that should be solved KCONFIG_SKIP_CHECK added by Xu.
Kind regards,
Petr
Quoted 38 lines
Best Regards
Yang XuQuoted 35 lines
Cheers,
Bogdan
------------------------------------------------------------------------
*From:* ltp <[email protected]> on behalf of [email protected] <[email protected]> *Sent:* Friday, February 11, 2022 3:21
*To:* Li Wang <[email protected]>
*Cc:* LTP List <[email protected]>
*Subject:* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
Hi LiQuoted 11 lines
On Fri, Feb 11, 2022 at 12:09 AM Cyril Hrubis <[email protected] <mailto:[email protected]>> wrote:
Hi!
Applied, thanks.I guess that the
SAFE_OPEN()caused TBROK on machines withoutCONFIG_SWAP, right?If so, why not go fix with .needs_config for "
CONFIG_SWAP=y" ?+1, it is also friendly to docparse.
ps: I never listen user complaint for the lack of
CONFIG_PORC, so only using .needs_config for "CONFIG_SWAP=y" can work well.Best Regards
Yang XuQuoted 3 lines
--
Regards,
Li Wang
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Quoted 7 lines
1) keep check
access("/proc/swaps", F_OK)
2) use .needs_config for "CONFIG_SWAP=y"
3) Add .needs_swap flag to structtst_testTo be honest, I'm not sure, what's the best, probably .needs_config. I worried little bit about .needs_config forcing config to be available in the past, but that should be solved
KCONFIG_SKIP_CHECKadded by Xu.
I guess that the easiest solution would be .needs_kconfig, we ended up depending on it in quite a few testcases anyway so I would say that nobody is runing LTP without having kernel config exproted anyways.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi,
Ok, I will send out a new patch.
Do I need to update syscalls/swapon/swapon03.c accordingly to make it a pattern?
Cheers,
Bogdan
________________________________
From: Cyril Hrubis <[email protected]>
Sent: Friday, February 11, 2022 15:15
To: Petr Vorel <[email protected]>
Cc: [email protected] <[email protected]>; Bogdan Lezhepekov <[email protected]>; Li Wang <[email protected]>; LTP List <[email protected]>
Subject: Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
Hi!
Quoted 7 lines
1) keep check
access("/proc/swaps", F_OK)
2) use .needs_config for "CONFIG_SWAP=y"
3) Add .needs_swap flag to structtst_testTo be honest, I'm not sure, what's the best, probably .needs_config. I worried little bit about .needs_config forcing config to be available in the past, but that should be solved
KCONFIG_SKIP_CHECKadded by Xu.
I guess that the easiest solution would be .needs_kconfig, we ended up depending on it in quite a few testcases anyway so I would say that nobody is runing LTP without having kernel config exproted anyways.
--
Cyril Hrubis
[email protected]
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 7 lines · Bogdan Lezhepekov
Hi,
Ok, I will send out a new patch.
Do I need to update
syscalls/swapon/swapon03.caccordingly to make it a pattern?
Yes, that would be great to have. Thanks~
Signature · 2 lines
Regards, Li Wang
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp