All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
@ 2022-02-10 13:38 Bogdan Lezhepekov via ltp
  2022-02-10 16:11 ` Cyril Hrubis
  0 siblings, 1 reply; 11+ messages in thread
From: Bogdan Lezhepekov via ltp @ 2022-02-10 13:38 UTC (permalink / raw)
  To: ltp

Previous version caused false positive result
on machines support no swap in kernel.

Signed-off-by: Bogdan Lezhepekov <bogdan.lezhepekov@suse.com>
---
 testcases/kernel/mem/swapping/swapping01.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/testcases/kernel/mem/swapping/swapping01.c b/testcases/kernel/mem/swapping/swapping01.c
index 1a494bf69..3b4f0a61a 100644
--- a/testcases/kernel/mem/swapping/swapping01.c
+++ b/testcases/kernel/mem/swapping/swapping01.c
@@ -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"},
 		{}
-- 
2.35.1


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

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

* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
  2022-02-10 13:38 [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel Bogdan Lezhepekov via ltp
@ 2022-02-10 16:11 ` Cyril Hrubis
  2022-02-10 16:30   ` Bogdan Lezhepekov via ltp
  2022-02-11  0:39   ` Li Wang
  0 siblings, 2 replies; 11+ messages in thread
From: Cyril Hrubis @ 2022-02-10 16:11 UTC (permalink / raw)
  To: Bogdan Lezhepekov; +Cc: ltp

Hi!
Applied, thanks.

I guess that the SAFE_OPEN() caused TBROK on machines without
CONFIG_SWAP, right?


-- 
Cyril Hrubis
chrubis@suse.cz

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

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

* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
  2022-02-10 16:11 ` Cyril Hrubis
@ 2022-02-10 16:30   ` Bogdan Lezhepekov via ltp
  2022-02-11  0:39   ` Li Wang
  1 sibling, 0 replies; 11+ messages in thread
From: Bogdan Lezhepekov via ltp @ 2022-02-10 16:30 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp


[-- Attachment #1.1: Type: text/plain, Size: 509 bytes --]


Absolutely correct 🙂

Thanks for the review!
-Bogdan
________________________________
From: Cyril Hrubis <chrubis@suse.cz>
Sent: Thursday, February 10, 2022 18:11
To: Bogdan Lezhepekov <bogdan.lezhepekov@suse.com>
Cc: ltp@lists.linux.it <ltp@lists.linux.it>
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
chrubis@suse.cz


[-- Attachment #1.2: Type: text/html, Size: 1745 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


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

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

* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
  2022-02-10 16:11 ` Cyril Hrubis
  2022-02-10 16:30   ` Bogdan Lezhepekov via ltp
@ 2022-02-11  0:39   ` Li Wang
  2022-02-11  1:21     ` xuyang2018.jy
  1 sibling, 1 reply; 11+ messages in thread
From: Li Wang @ 2022-02-11  0:39 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 273 bytes --]

On Fri, Feb 11, 2022 at 12:09 AM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> Applied, thanks.
>
> I guess that the SAFE_OPEN() caused TBROK on machines without
> CONFIG_SWAP, right?
>

If so, why not go fix with .needs_config for "CONFIG_SWAP=y" ?

-- 
Regards,
Li Wang

[-- Attachment #1.2: Type: text/html, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


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

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

* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
  2022-02-11  0:39   ` Li Wang
@ 2022-02-11  1:21     ` xuyang2018.jy
  2022-02-11  7:35       ` Bogdan Lezhepekov via ltp
  0 siblings, 1 reply; 11+ messages in thread
From: xuyang2018.jy @ 2022-02-11  1:21 UTC (permalink / raw)
  To: Li Wang; +Cc: LTP List

Hi Li
>
>
> On Fri, Feb 11, 2022 at 12:09 AM Cyril Hrubis <chrubis@suse.cz
> <mailto:chrubis@suse.cz>> wrote:
>
>     Hi!
>     Applied, thanks.
>
>     I guess that the SAFE_OPEN() caused TBROK on machines without
>     CONFIG_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
>
> --
> Regards,
> Li Wang
>
>
>
>

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

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

* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
  2022-02-11  1:21     ` xuyang2018.jy
@ 2022-02-11  7:35       ` Bogdan Lezhepekov via ltp
  2022-02-11  8:30         ` xuyang2018.jy
  0 siblings, 1 reply; 11+ messages in thread
From: Bogdan Lezhepekov via ltp @ 2022-02-11  7:35 UTC (permalink / raw)
  To: xuyang2018.jy, Li Wang; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 1237 bytes --]

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 <ltp-bounces+bogdan.lezhepekov=suse.com@lists.linux.it> on behalf of xuyang2018.jy@fujitsu.com <xuyang2018.jy@fujitsu.com>
Sent: Friday, February 11, 2022 3:21
To: Li Wang <liwang@redhat.com>
Cc: LTP List <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel

Hi Li
>
>
> On Fri, Feb 11, 2022 at 12:09 AM Cyril Hrubis <chrubis@suse.cz
> <mailto:chrubis@suse.cz>> wrote:
>
>     Hi!
>     Applied, thanks.
>
>     I guess that the SAFE_OPEN() caused TBROK on machines without
>     CONFIG_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
>
> --
> Regards,
> Li Wang
>
>
>
>

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


[-- Attachment #1.2: Type: text/html, Size: 3316 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


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

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

* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
  2022-02-11  7:35       ` Bogdan Lezhepekov via ltp
@ 2022-02-11  8:30         ` xuyang2018.jy
  2022-02-11  8:59           ` Petr Vorel
  0 siblings, 1 reply; 11+ messages in thread
From: xuyang2018.jy @ 2022-02-11  8:30 UTC (permalink / raw)
  To: Bogdan Lezhepekov; +Cc: LTP List

Hi Bogdan
> 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?
IMO, yes, but let's listen voice from other maintainers.
@Petr,@Cyril

Best Regards
Yang Xu
>
> Cheers,
> Bogdan
> ------------------------------------------------------------------------
> *From:* ltp <ltp-bounces+bogdan.lezhepekov=suse.com@lists.linux.it> on
> behalf of xuyang2018.jy@fujitsu.com <xuyang2018.jy@fujitsu.com>
> *Sent:* Friday, February 11, 2022 3:21
> *To:* Li Wang <liwang@redhat.com>
> *Cc:* LTP List <ltp@lists.linux.it>
> *Subject:* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is
> supported by kernel
> Hi Li
>>
>>
>>  On Fri, Feb 11, 2022 at 12:09 AM Cyril Hrubis <chrubis@suse.cz
>>  <mailto:chrubis@suse.cz>> wrote:
>>
>>  Hi!
>>  Applied, thanks.
>>
>>  I guess that the SAFE_OPEN() caused TBROK on machines without
>>  CONFIG_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
>>
>>  --
>>  Regards,
>>  Li Wang
>>
>>
>>
>>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>

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

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

* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
  2022-02-11  8:30         ` xuyang2018.jy
@ 2022-02-11  8:59           ` Petr Vorel
  2022-02-11 13:15             ` Cyril Hrubis
  0 siblings, 1 reply; 11+ messages in thread
From: Petr Vorel @ 2022-02-11  8:59 UTC (permalink / raw)
  To: xuyang2018.jy; +Cc: LTP List

Hi all,

> Hi Bogdan
> > 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?
> 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

> Best Regards
> Yang Xu

> > Cheers,
> > Bogdan
> > ------------------------------------------------------------------------
> > *From:* ltp <ltp-bounces+bogdan.lezhepekov=suse.com@lists.linux.it> on
> > behalf of xuyang2018.jy@fujitsu.com <xuyang2018.jy@fujitsu.com>
> > *Sent:* Friday, February 11, 2022 3:21
> > *To:* Li Wang <liwang@redhat.com>
> > *Cc:* LTP List <ltp@lists.linux.it>
> > *Subject:* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is
> > supported by kernel
> > Hi Li


> >>  On Fri, Feb 11, 2022 at 12:09 AM Cyril Hrubis <chrubis@suse.cz
> >>  <mailto:chrubis@suse.cz>> wrote:

> >>  Hi!
> >>  Applied, thanks.

> >>  I guess that the SAFE_OPEN() caused TBROK on machines without
> >>  CONFIG_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

> >>  --
> >>  Regards,
> >>  Li Wang

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

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

* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
  2022-02-11  8:59           ` Petr Vorel
@ 2022-02-11 13:15             ` Cyril Hrubis
  2022-02-11 13:16               ` Bogdan Lezhepekov via ltp
  0 siblings, 1 reply; 11+ messages in thread
From: Cyril Hrubis @ 2022-02-11 13:15 UTC (permalink / raw)
  To: Petr Vorel; +Cc: LTP List

Hi!
> 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.

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
chrubis@suse.cz

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

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

* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
  2022-02-11 13:15             ` Cyril Hrubis
@ 2022-02-11 13:16               ` Bogdan Lezhepekov via ltp
  2022-02-12  2:19                 ` Li Wang
  0 siblings, 1 reply; 11+ messages in thread
From: Bogdan Lezhepekov via ltp @ 2022-02-11 13:16 UTC (permalink / raw)
  To: Cyril Hrubis, Petr Vorel; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 1157 bytes --]

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 <chrubis@suse.cz>
Sent: Friday, February 11, 2022 15:15
To: Petr Vorel <pvorel@suse.cz>
Cc: xuyang2018.jy@fujitsu.com <xuyang2018.jy@fujitsu.com>; Bogdan Lezhepekov <bogdan.lezhepekov@suse.com>; Li Wang <liwang@redhat.com>; LTP List <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel

Hi!
> 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.

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
chrubis@suse.cz


[-- Attachment #1.2: Type: text/html, Size: 2745 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


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

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

* Re: [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel
  2022-02-11 13:16               ` Bogdan Lezhepekov via ltp
@ 2022-02-12  2:19                 ` Li Wang
  0 siblings, 0 replies; 11+ messages in thread
From: Li Wang @ 2022-02-12  2:19 UTC (permalink / raw)
  To: Bogdan Lezhepekov; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 285 bytes --]

On Fri, Feb 11, 2022 at 9:16 PM Bogdan Lezhepekov <
bogdan.lezhepekov@suse.com> wrote:

> Hi,
>
> Ok, I will send out a new patch.
>
> Do I need to update syscalls/swapon/swapon03.c accordingly to make it a
> pattern?
>

Yes, that would be great to have. Thanks~

-- 
Regards,
Li Wang

[-- Attachment #1.2: Type: text/html, Size: 1342 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


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

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

end of thread, other threads:[~2022-02-12  2:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 13:38 [LTP] [PATCH v1] mem/swapping01: Make sure swap is supported by kernel Bogdan Lezhepekov via ltp
2022-02-10 16:11 ` Cyril Hrubis
2022-02-10 16:30   ` Bogdan Lezhepekov via ltp
2022-02-11  0:39   ` Li Wang
2022-02-11  1:21     ` xuyang2018.jy
2022-02-11  7:35       ` Bogdan Lezhepekov via ltp
2022-02-11  8:30         ` xuyang2018.jy
2022-02-11  8:59           ` Petr Vorel
2022-02-11 13:15             ` Cyril Hrubis
2022-02-11 13:16               ` Bogdan Lezhepekov via ltp
2022-02-12  2:19                 ` Li Wang

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.