All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [LTP] [PATCH] lib/tst_test.c: add *cleanup() before exit
@ 2021-11-09 11:28 zhaogongyi
  0 siblings, 0 replies; 7+ messages in thread
From: zhaogongyi @ 2021-11-09 11:28 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,

It sounds pretty good and we would select a suitable oom_score value for library process(It seems that the child process will inherit the settings of the parent process).

And, in some stress test scenes, we might run LTP testcases with other testcases concurrently since the other testcases(for example: testcases in open_posix_testsuite) have no timeout limit or have no flexible timeout mechanism,

The stress test's main process would kill the testcase which is timeout.

> 
> Hi!
> > If we run the LTP testcases Concurrently, this might trigger the oom
> > killer to kill the library process before the main process exit, and
> > it might fill up the tmpfs through a long time running.
> 
> Then I guess we may as well adjust the oom_score for the test library
> process so that it's less likely to end up being killed.
> 
> --
> 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] lib/tst_test.c: add *cleanup() before exit
  2021-11-09 10:33 ` Cyril Hrubis
@ 2021-11-09 12:02   ` Li Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Li Wang @ 2021-11-09 12:02 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp


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

On Tue, Nov 9, 2021 at 6:32 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > If we run the LTP testcases Concurrently, this might trigger the oom
> > killer to kill the library process before the main process exit, and
> > it might fill up the tmpfs through a long time running.
>
> Then I guess we may as well adjust the oom_score for the test library
> process so that it's less likely to end up being killed.
>

+1

And we have to guarantee that oom_score doesn't be
inherited by any test case. Otherwise, it will break our
OOM tests.

-- 
Regards,
Li Wang

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

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


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

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

* Re: [LTP] [PATCH] lib/tst_test.c: add *cleanup() before exit
  2021-11-09  1:38 zhaogongyi
@ 2021-11-09 10:33 ` Cyril Hrubis
  2021-11-09 12:02   ` Li Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Cyril Hrubis @ 2021-11-09 10:33 UTC (permalink / raw)
  To: zhaogongyi; +Cc: ltp

Hi!
> If we run the LTP testcases Concurrently, this might trigger the oom
> killer to kill the library process before the main process exit, and
> it might fill up the tmpfs through a long time running.

Then I guess we may as well adjust the oom_score for the test library
process so that it's less likely to end up being killed.

-- 
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] lib/tst_test.c: add *cleanup() before exit
@ 2021-11-09  1:38 zhaogongyi
  2021-11-09 10:33 ` Cyril Hrubis
  0 siblings, 1 reply; 7+ messages in thread
From: zhaogongyi @ 2021-11-09  1:38 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,

If we run the LTP testcases Concurrently, this might trigger the oom killer to kill the library process before the main process exit, and it might fill up the tmpfs through a long time running.


Thanks so much!
Gongyi

> 
> Hi!
> > If the main process exit without *cleanup() and when the lib process
> > has exit, the test environment would not be reset when the testcase
> > needs resource of device or tmpfs.
> 
> This looks like working around the real problem. The test library process is
> supposed to outlive the child in all circumstances.
> 
> What exactly happens in your case that this code gets triggered?
> 
> --
> 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] lib/tst_test.c: add *cleanup() before exit
  2021-11-08  7:38 Zhao Gongyi
  2021-11-08  9:08 ` Li Wang
@ 2021-11-08 13:12 ` Cyril Hrubis
  1 sibling, 0 replies; 7+ messages in thread
From: Cyril Hrubis @ 2021-11-08 13:12 UTC (permalink / raw)
  To: Zhao Gongyi; +Cc: ltp

Hi!
> If the main process exit without *cleanup() and when the lib process
> has exit, the test environment would not be reset when the testcase
> needs resource of device or tmpfs.

This looks like working around the real problem. The test library
process is supposed to outlive the child in all circumstances.

What exactly happens in your case that this code gets triggered?

-- 
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] lib/tst_test.c: add *cleanup() before exit
  2021-11-08  7:38 Zhao Gongyi
@ 2021-11-08  9:08 ` Li Wang
  2021-11-08 13:12 ` Cyril Hrubis
  1 sibling, 0 replies; 7+ messages in thread
From: Li Wang @ 2021-11-08  9:08 UTC (permalink / raw)
  To: Zhao Gongyi; +Cc: LTP List


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

On Mon, Nov 8, 2021 at 3:37 PM Zhao Gongyi <zhaogongyi@huawei.com> wrote:

> If the main process exit without *cleanup() and when the lib process
> has exit, the test environment would not be reset when the testcase
> needs resource of device or tmpfs.
>
> Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
>

Reviewed-by: Li Wang <liwang@redhat.com>


> ---
>  lib/tst_test.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 02ae28335..4c7e3a97b 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -1226,6 +1226,8 @@ static void heartbeat(void)
>                  * We need kill the task group immediately since the
>                  * main process has exit.
>                  */
> +               do_test_cleanup();
> +               do_cleanup();
>                 kill(0, SIGKILL);
>                 exit(TBROK);
>         }
> --
> 2.17.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
>

-- 
Regards,
Li Wang

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

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


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

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

* [LTP] [PATCH] lib/tst_test.c: add *cleanup() before exit
@ 2021-11-08  7:38 Zhao Gongyi
  2021-11-08  9:08 ` Li Wang
  2021-11-08 13:12 ` Cyril Hrubis
  0 siblings, 2 replies; 7+ messages in thread
From: Zhao Gongyi @ 2021-11-08  7:38 UTC (permalink / raw)
  To: ltp

If the main process exit without *cleanup() and when the lib process
has exit, the test environment would not be reset when the testcase
needs resource of device or tmpfs.

Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---
 lib/tst_test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 02ae28335..4c7e3a97b 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1226,6 +1226,8 @@ static void heartbeat(void)
 		 * We need kill the task group immediately since the
 		 * main process has exit.
 		 */
+		do_test_cleanup();
+		do_cleanup();
 		kill(0, SIGKILL);
 		exit(TBROK);
 	}
--
2.17.1


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

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

end of thread, other threads:[~2021-11-09 12:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 11:28 [LTP] [PATCH] lib/tst_test.c: add *cleanup() before exit zhaogongyi
  -- strict thread matches above, loose matches on Subject: below --
2021-11-09  1:38 zhaogongyi
2021-11-09 10:33 ` Cyril Hrubis
2021-11-09 12:02   ` Li Wang
2021-11-08  7:38 Zhao Gongyi
2021-11-08  9:08 ` Li Wang
2021-11-08 13:12 ` Cyril Hrubis

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.