[LTP] [PATCH v2 1/1] swapoff01: Define max_runtime 45s

Petr Vorel pvorel@suse.cz
Wed Sep 4 07:31:57 CEST 2024


> Hi!
> > Test run mostly below 1 sec per filesystem, only NTFS is very slow
> > ~ 10-15 sec depending on architecture.

> If part of the slowdown is caused by the fact that we format the
> filesystems the real question is if all the tests that format and mount
> a device should have a max_runtime defined. It may make sense to
> increment the max_runtime in the test library to compensate for the
> mkfs, but it looks that it's not the mkfs that is slow.

> I did some measurements for the swapoff01 case and the whole testrun
> runs for about 10 seconds for me. If I change the test to do
> tst_brk(TCONF, ...) as the first thing in the test setup its 1s. So
> writing out the 1MB of swapfile and running mkswap and swapon() on that
> takes about 90% of the runtime.

Thanks for your investigation.

> So yes it looks like the actual test needs some runtime defined,
> although I'm not sure how long it should be. We probably need a
> reference machine to callibrate this on. I would avoid any emulated CPU
> and choose a real hardware. I guess one of the RPis e.g. Pi Zero would
> be a good choice since they are widely available and slow by any modern
> standards.

This makes sense.

Kind regards,
Petr

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > Changes v1->v2:
> > * 60 => 45

> >  testcases/kernel/syscalls/swapoff/swapoff01.c | 1 +
> >  1 file changed, 1 insertion(+)

> > diff --git a/testcases/kernel/syscalls/swapoff/swapoff01.c b/testcases/kernel/syscalls/swapoff/swapoff01.c
> > index 314630267d..ef75c92de0 100644
> > --- a/testcases/kernel/syscalls/swapoff/swapoff01.c
> > +++ b/testcases/kernel/syscalls/swapoff/swapoff01.c
> > @@ -53,5 +53,6 @@ static struct tst_test test = {
> >  	.all_filesystems = 1,
> >  	.needs_root = 1,
> >  	.test_all = verify_swapoff,
> > +	.max_runtime = 45,
> >  	.setup = setup
> >  };
> > -- 
> > 2.45.2


More information about the ltp mailing list