All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] msgget03: Set custom queue limit
@ 2022-07-04 11:45 Martin Doucha
  2022-07-06  9:14 ` xuyang2018.jy
  2022-10-10 11:57 ` Richard Palethorpe
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Doucha @ 2022-07-04 11:45 UTC (permalink / raw)
  To: ltp

The runtime limit patchset has reduced default test timeout to 30 seconds
which is not enough for msgget03 on some archs. Set custom queue count
limit to make the test faster.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/kernel/syscalls/ipc/msgget/msgget03.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget03.c b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
index 711886e17..2257ae0f9 100644
--- a/testcases/kernel/syscalls/ipc/msgget/msgget03.c
+++ b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
@@ -41,7 +41,8 @@ static void setup(void)
 	tst_res(TINFO, "Current environment %d message queues are already in use",
 		used_cnt);
 
-	SAFE_FILE_SCANF("/proc/sys/kernel/msgmni", "%i", &maxmsgs);
+	maxmsgs = used_cnt + 32;
+	SAFE_FILE_PRINTF("/proc/sys/kernel/msgmni", "%i", maxmsgs);
 
 	queues = SAFE_MALLOC((maxmsgs - used_cnt) * sizeof(int));
 
@@ -73,5 +74,9 @@ static struct tst_test test = {
 	.needs_tmpdir = 1,
 	.setup = setup,
 	.cleanup = cleanup,
-	.test_all = verify_msgget
+	.test_all = verify_msgget,
+	.save_restore = (const struct tst_path_val[]){
+		{"/proc/sys/kernel/msgmni", NULL},
+		{}
+	}
 };
-- 
2.36.1


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

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

* Re: [LTP] [PATCH] msgget03: Set custom queue limit
  2022-07-04 11:45 [LTP] [PATCH] msgget03: Set custom queue limit Martin Doucha
@ 2022-07-06  9:14 ` xuyang2018.jy
  2022-09-20 14:04   ` Martin Doucha
  2022-10-10 11:57 ` Richard Palethorpe
  1 sibling, 1 reply; 4+ messages in thread
From: xuyang2018.jy @ 2022-07-06  9:14 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi Martin

I don't have objection for this patch.

But I think using system custom max value is more meaningful. How about
setting timeout to 5min, I think it is enough.

Also shmget03 uses same logic, so I guess we need to modify it too.

Best Regards
Yang Xu
> The runtime limit patchset has reduced default test timeout to 30 seconds
> which is not enough for msgget03 on some archs. Set custom queue count
> limit to make the test faster.
>
> Signed-off-by: Martin Doucha<mdoucha@suse.cz>
> ---
>   testcases/kernel/syscalls/ipc/msgget/msgget03.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget03.c b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
> index 711886e17..2257ae0f9 100644
> --- a/testcases/kernel/syscalls/ipc/msgget/msgget03.c
> +++ b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
> @@ -41,7 +41,8 @@ static void setup(void)
>   	tst_res(TINFO, "Current environment %d message queues are already in use",
>   		used_cnt);
>
> -	SAFE_FILE_SCANF("/proc/sys/kernel/msgmni", "%i",&maxmsgs);
> +	maxmsgs = used_cnt + 32;
> +	SAFE_FILE_PRINTF("/proc/sys/kernel/msgmni", "%i", maxmsgs);
>
>   	queues = SAFE_MALLOC((maxmsgs - used_cnt) * sizeof(int));
>
> @@ -73,5 +74,9 @@ static struct tst_test test = {
>   	.needs_tmpdir = 1,
>   	.setup = setup,
>   	.cleanup = cleanup,
> -	.test_all = verify_msgget
> +	.test_all = verify_msgget,
> +	.save_restore = (const struct tst_path_val[]){
> +		{"/proc/sys/kernel/msgmni", NULL},
> +		{}
> +	}
>   };

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

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

* Re: [LTP] [PATCH] msgget03: Set custom queue limit
  2022-07-06  9:14 ` xuyang2018.jy
@ 2022-09-20 14:04   ` Martin Doucha
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Doucha @ 2022-09-20 14:04 UTC (permalink / raw)
  To: xuyang2018.jy; +Cc: ltp

On 06. 07. 22 11:14, xuyang2018.jy@fujitsu.com wrote:
> Hi Martin
> 
> I don't have objection for this patch.
> 
> But I think using system custom max value is more meaningful. How about
> setting timeout to 5min, I think it is enough.

The system max value is an arbitrary number that can be increased up to 
complete memory exhaustion. There's not much difference between checking 
the ENOSPC error quickly with low custom limit and running the test for 
2 minutes with the default limit.

> Also shmget03 uses same logic, so I guess we need to modify it too.

shmget03 is significantly faster on all archs, there's no risk of 
timeout at the moment.

-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


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

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

* Re: [LTP] [PATCH] msgget03: Set custom queue limit
  2022-07-04 11:45 [LTP] [PATCH] msgget03: Set custom queue limit Martin Doucha
  2022-07-06  9:14 ` xuyang2018.jy
@ 2022-10-10 11:57 ` Richard Palethorpe
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Palethorpe @ 2022-10-10 11:57 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hello,

Merged!

Martin Doucha <mdoucha@suse.cz> writes:

> The runtime limit patchset has reduced default test timeout to 30 seconds
> which is not enough for msgget03 on some archs. Set custom queue count
> limit to make the test faster.
>
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  testcases/kernel/syscalls/ipc/msgget/msgget03.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget03.c b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
> index 711886e17..2257ae0f9 100644
> --- a/testcases/kernel/syscalls/ipc/msgget/msgget03.c
> +++ b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
> @@ -41,7 +41,8 @@ static void setup(void)
>  	tst_res(TINFO, "Current environment %d message queues are already in use",
>  		used_cnt);
>  
> -	SAFE_FILE_SCANF("/proc/sys/kernel/msgmni", "%i", &maxmsgs);
> +	maxmsgs = used_cnt + 32;
> +	SAFE_FILE_PRINTF("/proc/sys/kernel/msgmni", "%i", maxmsgs);
>  
>  	queues = SAFE_MALLOC((maxmsgs - used_cnt) * sizeof(int));
>  
> @@ -73,5 +74,9 @@ static struct tst_test test = {
>  	.needs_tmpdir = 1,
>  	.setup = setup,
>  	.cleanup = cleanup,
> -	.test_all = verify_msgget
> +	.test_all = verify_msgget,
> +	.save_restore = (const struct tst_path_val[]){
> +		{"/proc/sys/kernel/msgmni", NULL},
> +		{}
> +	}
>  };
> -- 
> 2.36.1


-- 
Thank you,
Richard.

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

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

end of thread, other threads:[~2022-10-10 11:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 11:45 [LTP] [PATCH] msgget03: Set custom queue limit Martin Doucha
2022-07-06  9:14 ` xuyang2018.jy
2022-09-20 14:04   ` Martin Doucha
2022-10-10 11:57 ` Richard Palethorpe

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.