* [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant tst_reap_children()
@ 2022-09-05 6:14 Luo xiaoyu via ltp
2022-09-13 6:42 ` Petr Vorel
0 siblings, 1 reply; 6+ messages in thread
From: Luo xiaoyu via ltp @ 2022-09-05 6:14 UTC (permalink / raw)
To: ltp
Drop redundant calling of tst_reap_children() in cleanup() since
it has been called in the API (run_tests()).
Signed-off-by: Luo xiaoyu <luoxiaoyu9@huawei.com>
---
testcases/kernel/pty/pty04.c | 2 --
.../kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c | 1 -
2 files changed, 3 deletions(-)
diff --git a/testcases/kernel/pty/pty04.c b/testcases/kernel/pty/pty04.c
index 8c7b1bf92..efd5bd364 100644
--- a/testcases/kernel/pty/pty04.c
+++ b/testcases/kernel/pty/pty04.c
@@ -462,8 +462,6 @@ static void cleanup(void)
if (sk >= 0)
close(sk);
-
- tst_reap_children();
}
static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
index 20d96b118..5bc5c4d81 100644
--- a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
+++ b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
@@ -128,7 +128,6 @@ static void setup(void)
static void cleanup(void)
{
- tst_reap_children();
if (new_pidfd > 0)
SAFE_CLOSE(new_pidfd);
if (pidfd > 0)
--
2.17.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant tst_reap_children()
2022-09-05 6:14 [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant tst_reap_children() Luo xiaoyu via ltp
@ 2022-09-13 6:42 ` Petr Vorel
2022-09-13 7:33 ` Li Wang
0 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2022-09-13 6:42 UTC (permalink / raw)
To: Luo xiaoyu; +Cc: ltp
Hi Luo,
> Drop redundant calling of tst_reap_children() in cleanup() since
> it has been called in the API (run_tests()).
LGTM, I suppose that was a mistake.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
NOTE: this patch is broken:
patch: **** malformed patch at line 100:
Please be careful next time.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant tst_reap_children()
2022-09-13 6:42 ` Petr Vorel
@ 2022-09-13 7:33 ` Li Wang
2022-09-13 8:29 ` Petr Vorel
0 siblings, 1 reply; 6+ messages in thread
From: Li Wang @ 2022-09-13 7:33 UTC (permalink / raw)
To: Petr Vorel; +Cc: LTP List
[-- Attachment #1.1: Type: text/plain, Size: 487 bytes --]
On Tue, Sep 13, 2022 at 2:42 PM Petr Vorel <pvorel@suse.cz> wrote:
> Hi Luo,
>
> > Drop redundant calling of tst_reap_children() in cleanup() since
> > it has been called in the API (run_tests()).
>
> LGTM, I suppose that was a mistake.
>
Hmm, I slightly think that reflact a cautious thought from the author,
in case of test hit tst_brk unexpectly with invoke cleanup it can also
do reap children.
So, it's probably no harmful to keep tst_reap_children there.
--
Regards,
Li Wang
[-- Attachment #1.2: Type: text/html, Size: 1386 bytes --]
[-- Attachment #2: Type: text/plain, Size: 60 bytes --]
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant tst_reap_children()
2022-09-13 7:33 ` Li Wang
@ 2022-09-13 8:29 ` Petr Vorel
0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2022-09-13 8:29 UTC (permalink / raw)
To: Li Wang; +Cc: LTP List
> On Tue, Sep 13, 2022 at 2:42 PM Petr Vorel <pvorel@suse.cz> wrote:
> > Hi Luo,
> > > Drop redundant calling of tst_reap_children() in cleanup() since
> > > it has been called in the API (run_tests()).
> > LGTM, I suppose that was a mistake.
> Hmm, I slightly think that reflact a cautious thought from the author,
> in case of test hit tst_brk unexpectly with invoke cleanup it can also
> do reap children.
> So, it's probably no harmful to keep tst_reap_children there.
Ah, thx for info. I set status rejected in patchwork.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant tst_reap_children()
2022-09-13 9:14 luoxiaoyu (C) via ltp
@ 2022-09-13 10:10 ` Li Wang
0 siblings, 0 replies; 6+ messages in thread
From: Li Wang @ 2022-09-13 10:10 UTC (permalink / raw)
To: luoxiaoyu (C); +Cc: LTP List
[-- Attachment #1.1: Type: text/plain, Size: 1428 bytes --]
On Tue, Sep 13, 2022 at 5:34 PM luoxiaoyu (C) <luoxiaoyu9@huawei.com> wrote:
> Maybe I have a question to ask for.
> As my understand, tst_reap_children() has been called in API even test hit
> tst_brk, right?
>
To precisely, when hitting a tst_brk, the main process will invoke
do_test_cleanup()
and finally call tst_test->cleanup function from the specific testcase, to
recover the
original environment as much as they can.
In pidfd_send_signal03, the tst_reap_children will be invoked in that break
situation.
But we shouldn't say "it has been called in API", they're totally
different concepts.
see:
https://github.com/linux-test-project/ltp/blob/master/lib/tst_test.c#L339
>
> Regards,
> Luo
> -----origin mail-----
> Re: [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant
> tst_reap_children()
>
> > On Tue, Sep 13, 2022 at 2:42 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> > > Hi Luo,
>
> > > > Drop redundant calling of tst_reap_children() in cleanup() since
> > > > it has been called in the API (run_tests()).
>
> > > LGTM, I suppose that was a mistake.
>
>
> > Hmm, I slightly think that reflact a cautious thought from the author,
> > in case of test hit tst_brk unexpectly with invoke cleanup it can also
> > do reap children.
>
> > So, it's probably no harmful to keep tst_reap_children there.
> Ah, thx for info. I set status rejected in patchwork.
>
> Kind regards,
> Petr
>
>
--
Regards,
Li Wang
[-- Attachment #1.2: Type: text/html, Size: 2858 bytes --]
[-- Attachment #2: Type: text/plain, Size: 60 bytes --]
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant tst_reap_children()
@ 2022-09-13 9:14 luoxiaoyu (C) via ltp
2022-09-13 10:10 ` Li Wang
0 siblings, 1 reply; 6+ messages in thread
From: luoxiaoyu (C) via ltp @ 2022-09-13 9:14 UTC (permalink / raw)
To: Petr Vorel, Li Wang; +Cc: LTP List
Maybe I have a question to ask for.
As my understand, tst_reap_children() has been called in API even test hit tst_brk, right?
Regards,
Luo
-----origin mail-----
Re: [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant tst_reap_children()
> On Tue, Sep 13, 2022 at 2:42 PM Petr Vorel <pvorel@suse.cz> wrote:
> > Hi Luo,
> > > Drop redundant calling of tst_reap_children() in cleanup() since
> > > it has been called in the API (run_tests()).
> > LGTM, I suppose that was a mistake.
> Hmm, I slightly think that reflact a cautious thought from the author,
> in case of test hit tst_brk unexpectly with invoke cleanup it can also
> do reap children.
> So, it's probably no harmful to keep tst_reap_children there.
Ah, thx for info. I set status rejected in patchwork.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-09-13 10:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 6:14 [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant tst_reap_children() Luo xiaoyu via ltp
2022-09-13 6:42 ` Petr Vorel
2022-09-13 7:33 ` Li Wang
2022-09-13 8:29 ` Petr Vorel
2022-09-13 9:14 luoxiaoyu (C) via ltp
2022-09-13 10:10 ` 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.