[LTP] [v2 2/2] lib/tst_pid.c: Increase PIDS_RESERVED to avoid fork failure.

Leo Liang ycliang@andestech.com
Tue Feb 14 15:14:17 CET 2023


Hi Petr,

On Tue, Feb 14, 2023 at 02:37:14PM +0100, Petr Vorel wrote:
> Hi Leo,
> 
> > After Adjusting how we count used pid, we increase
> > the number of PIDS_RESERVED to void fork failure.
> nit: in this case I'd actually keep changes in single commit
> (otherwise first commit alone would break tests),
> 

That makes sense!
Then we could probably drop this v2 patch
and stay with the v1?

Best regards,
Leo

> Kind regards,
> Petr
> 
> > Suggested-by: Petr Vorel <pvorel@suse.cz>
> > Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > Changes v1 -> v2
> > * Split into two patches
> > ---
> >  lib/tst_pid.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> > diff --git a/lib/tst_pid.c b/lib/tst_pid.c
> > index a282f8cc9..7582e4828 100644
> > --- a/lib/tst_pid.c
> > +++ b/lib/tst_pid.c
> > @@ -36,7 +36,7 @@
> >  #define CGROUPS_V1_SLICE_FMT "/sys/fs/cgroup/pids/user.slice/user-%d.slice/pids.max"
> >  #define CGROUPS_V2_SLICE_FMT "/sys/fs/cgroup/user.slice/user-%d.slice/pids.max"
> >  /* Leave some available processes for the OS */
> > -#define PIDS_RESERVE 50
> > +#define PIDS_RESERVE 200
> 
> >  pid_t tst_get_unused_pid_(void (*cleanup_fn) (void))
> >  {


More information about the ltp mailing list