| 01dabed2 | 27-Jan-2022 |
Yang Xu <[email protected]> |
selftests/zram: Adapt the situation that /dev/zram0 is being used
If zram-generator package is installed and works, then we can not remove zram module because zram swap is being used. This case need
selftests/zram: Adapt the situation that /dev/zram0 is being used
If zram-generator package is installed and works, then we can not remove zram module because zram swap is being used. This case needs a clean zram environment, change this test by using hot_add/hot_remove interface. So even zram device is being used, we still can add zram device and remove them in cleanup.
The two interface was introduced since kernel commit 6566d1a32bf7("zram: add dynamic device add/remove functionality") in v4.2-rc1. If kernel supports these two interface, we use hot_add/hot_remove to slove this problem, if not, just check whether zram is being used or built in, then skip it on old kernel.
Signed-off-by: Yang Xu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| d18da7ec | 27-Jan-2022 |
Yang Xu <[email protected]> |
selftests/zram01.sh: Fix compression ratio calculation
zram01 uses `free -m` to measure zram memory usage. The results are no sense because they are polluted by all running processes on the system.
selftests/zram01.sh: Fix compression ratio calculation
zram01 uses `free -m` to measure zram memory usage. The results are no sense because they are polluted by all running processes on the system.
We Should only calculate the free memory delta for the current process. So use the third field of /sys/block/zram<id>/mm_stat to measure memory usage instead. The file is available since kernel 4.1.
orig_data_size(first): uncompressed size of data stored in this disk. compr_data_size(second): compressed size of data stored in this disk mem_used_total(third): the amount of memory allocated for this disk
Also remove useless zram cleanup call in zram_fill_fs and so we don't need to cleanup zram twice if fails.
Signed-off-by: Yang Xu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 7eba7d90 | 31-Aug-2015 |
Naresh Kamboju <[email protected]> |
selftests/zram: Makefile fix
Do not override run_tests, The default rule will just run TEST_PROGS
Signed-off-by: Naresh Kamboju <[email protected]> Acked-by: Michael Ellerman <mpe@ellerman.
selftests/zram: Makefile fix
Do not override run_tests, The default rule will just run TEST_PROGS
Signed-off-by: Naresh Kamboju <[email protected]> Acked-by: Michael Ellerman <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|