[LTP] [PATCH] readahead02: create loop device if TMPDIR is tmpfs

Petr Vorel pvorel@suse.cz
Fri Jun 22 11:05:13 CEST 2018


Hi Jan,

> readahead doesn't work on tmpfs. Detect it and create loop
> device if necessary.

> After patch (4.16.0, /tmp if tmpfs):
>   readahead02    0  TINFO  :  TMPFS detected, creating loop device
>   readahead02    0  TINFO  :  Found free device '/dev/loop1'
>   readahead02    0  TINFO  :  Formatting /dev/loop1 with ext2 opts='' extra opts='' mke2fs 1.43.6 (29-Aug-2017)
>   readahead02    0  TINFO  :  creating test file of size: 67108864
>   readahead02    0  TINFO  :  read_testfile(0)
>   readahead02    0  TINFO  :  read_testfile(1)
>   readahead02    0  TINFO  :  max ra estimate: 1118208
>   readahead02    0  TINFO  :  readahead calls made: 61
>   readahead02    1  TPASS  :  offset is still at 0 as expected
>   readahead02    0  TINFO  :  read_testfile(0) took: 25650 usec
>   readahead02    0  TINFO  :  read_testfile(1) took: 17931 usec
>   readahead02    0  TINFO  :  read_testfile(0) read: 67108864 bytes
>   readahead02    0  TINFO  :  read_testfile(1) read: 0 bytes
>   readahead02    2  TPASS  :  readahead saved some I/O
>   readahead02    0  TINFO  :  cache can hold at least: 66516 kB
>   readahead02    0  TINFO  :  read_testfile(0) used cache: 65156 kB
>   readahead02    0  TINFO  :  read_testfile(1) used cache: 65156 kB
>   readahead02    3  TPASS  :  using cache as expected

> Signed-off-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>


Kind regards,
Petr


More information about the ltp mailing list