[LTP] [PATCH 2/3] zram/zram_lib.sh: Skip test if zram module can not be removed

Petr Vorel pvorel@suse.cz
Wed Dec 15 12:56:14 CET 2021


Hi Xu,

> Hi Petr
> > Hi Xu,

> > [ Cc Naresh Kamboju who added zram support to kconfig ]
> Oh, I don't know kernel selftest also have these two zram tests.

> >> Hi Petr
> >>> Hi Xu,

> >>> ...
> >>>>>> ps: zram01 need to rmmod and modprobe zram. So if kernel built with
> >>>>>> CONFIG_ZRAM=y, we also need to TCONF. But it is another story.
> >>>>> +1

> >>> We already have v3, but I got confused here in v1, thus asking.

> >>>> Since zram_lib.sh uses tst_needs_driver to search module in
> >>>> modules.dep/modules.builtin. Maybe we can introduce a new macro
> >>>> TST_NEEDS_MODULES (like TST_NEEDS_DIRVERS)?
> >>> I got lost here, did you suggest zram_lib.sh to switch to use $TST_NEEDS_MODULE?
> >> Sorry, I don't know ltp shell api already have this TST_NEEDS_MODULE
> >> macro and so suggest to add a new macro wrongly.

> >> Yes, I want to use TST_NEEDS_MODULE instead of TST_NEEDS_DIRVERS because
> >> the former is more accurate.

> >> But it seems  our TST_NEEDS_MODULE only can check custom kernel module
> >> but can't check system kernel module(like ext4.ko.xz, xfs.ext4.ko.xz).
> > Good catch, tst_require_module() in tst_test.sh should be fixed.
> > Also, if I look correctly, there is no TST_NEEDS_MODULE equivalent for C API
> > (probably not needed).
> Maybe add a issue for this, so we or others can do it in the future.
And is it needed to be added to C API?

> >> ps: kconfig shell api can also do the thing by using "config_zram=m". So
> >> I may use kconfig shell api in here in the feature.
> > FYI When Naresh Kamboju put LTP zram tests into kselftest back in 2015,
> > he modified it to support also zram built-in (CONFIG_ZRAM=y).

> > We don't support it, thus CONFIG_ZRAM=m is OK now, but we should consider to add
> > at least some minimal support for CONFIG_ZRAM=y.
> Yes, kernel selftest supports CONFIG_ZRAM=y. Because zram01.sh in kernel 
> selftest only used one zram device(It only supports ext4 filesystem but 
> ltp supports all possible filesystem).

> Since most distribution should use CONFIG_ZRAM=m, I guess we don't need 
> to support CONFIG_ZRAM=y and ltp can support more filesystems.
> Maybe can add a note that user can use kernel selftest when his kernel 
> config is CONFIG_ZRAM=y.
Not sure.

> Also, It seems kernel selftest zram case is old
> 1) should remove zram_max_streams
> 2) should use mm_stat instead of free -m to calcaute ratio
> 3) should consider the situation that /dev/zram0 is being used
Yes it's old. As some people run only kselftest it might be worth to update it.

Kind regards,
Petr


More information about the ltp mailing list