From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls/fork13: Rewrite to new API + add .max_runtime
Date: Thu, 16 Jun 2022 23:43:10 +0200 [thread overview]
Message-ID: <Yquj7iln/+uDUnhV@pevik> (raw)
In-Reply-To: <20220616134919.8248-1-chrubis@suse.cz>
Hi Cyril,
> This fixes a problem we had for years, the test can run for more than
> half an hour on slow systems and it used to timeout quite often.
+1
> This commit introduces a max_runtime with a 10 minute limit which is
> more than enough for the test to complete on a modern hardware but at
> the same time it limits the runtime to a sensible value on older
> hardware and embedded.
+1
Original implementation was quite nicely written (at least some parts were
reused), which clearly demonstrates advantages of new LTP API.
LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
I'd just formatted the doc differently:
/*\
* [Description]
*
* A race in pid generation that causes pids to be reused immediately
*
* From the mainline commit 5fdee8c4a5e1800489ce61963208f8cc55e42ea1:
*
* A program that repeatedly forks and waits is susceptible to having
* the same pid repeated, especially when it competes with another
* instance of the same program. This is really bad for bash
* implementation. Furthermore, many shell scripts assume that pid
* numbers will not be used for some length of time.
*
* [Race Description]
* ---------------------------------------------------------------------
* A B
*
* // pid == offset == n // pid == offset == n + 1
* test_and_set_bit(offset, map->page)
* test_and_set_bit(offset, map->page);
* pid_ns->last_pid = pid;
* pid_ns->last_pid = pid;
* // pid == n + 1 is freed (wait())
*
* // Next fork()...
* last = pid_ns->last_pid; // == n
* pid = last + 1;
* ---------------------------------------------------------------------
*/
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-06-16 21:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-16 13:49 [LTP] [PATCH] syscalls/fork13: Rewrite to new API + add .max_runtime Cyril Hrubis
2022-06-16 21:43 ` Petr Vorel [this message]
2022-06-20 11:21 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yquj7iln/+uDUnhV@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox