* [LTP] [RFC] Limit the tmpfs size on mounting
@ 2021-06-30 8:08 Li Wang
2021-06-30 9:20 ` Cyril Hrubis
0 siblings, 1 reply; 3+ messages in thread
From: Li Wang @ 2021-06-30 8:08 UTC (permalink / raw)
To: ltp
Hi all,
LTP mount and make use of the whole tmpfs of the test system,
generally, it's fine. But if a test (e.g fallocate06) try to fill full in
the
filesystem, it takes too long to complete testing on a large memory
system.
I'm thinking whether we should limit the mount tmpfs size for the
LTP test, maybe only give 512MB? but the tricky part for me is to
add options like "-o size=512M" to prepare_device(), or do some
additional work for tmpfs mounting.
and any else way can speed up is also welcome. I'd like to hear
more advice. Thanks!
120 tst_test.c:1379: TINFO: Testing on tmpfs
121 tst_test.c:889: TINFO: Skipping mkfs for TMPFS filesystem
122 tst_test.c:1313: TINFO: Timeout per run is 0h 05m 00s
123 fallocate06.c:126: TINFO: Copy-on-write is not supported
124 fallocate06.c:177: TINFO: Case 1. Fill FS: no; Use copy on write: no
125 fallocate06.c:166: TPASS: write() successful
126 fallocate06.c:210: TPASS: Misaligned allocation works as expected
127 fallocate06.c:166: TPASS: fallocate(FALLOC_FL_PUNCH_HOLE |
FALLOC_FL_KEEP_SIZE) successful
128 fallocate06.c:246: TPASS: fallocate(FALLOC_FL_PUNCH_HOLE |
FALLOC_FL_KEEP_SIZE) cleared the correct file range
129 fallocate06.c:177: TINFO: Case 2. Fill FS: yes; Use copy on write: no
130 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file0 size 21710183
131 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file1 size 8070086
132 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file2 size 3971177
133 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file3 size 36915315
134 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file4 size 70310993
135 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file5 size 4807935
136 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file6 size 90739786
137 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file7 size 76896492
...
2382 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file2252 size
57793556
2383 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file2253 size
44128200
2384 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file2254 size
31600129
2385 tst_fill_fs.c:32: TINFO: Creating file mntpoint/file2255 size 1865251
<------- create too many files
2386 tst_fill_fs.c:59: TINFO: write(): ENOSPC (28)
2387 fallocate06.c:166: TPASS: write() successful
2388 fallocate06.c:210: TPASS: Misaligned allocation works as expected
2389 fallocate06.c:166: TPASS: fallocate(FALLOC_FL_PUNCH_HOLE |
FALLOC_FL_KEEP_SIZE) successful
2390 fallocate06.c:246: TPASS: fallocate(FALLOC_FL_PUNCH_HOLE |
FALLOC_FL_KEEP_SIZE) cleared the correct file range
2391 Test timeouted, sending SIGKILL! <------- looks like takes too
much time on purge dirs
# df -Th | grep tmpfs
Filesystem Type Size Used Avail Use%
Mounted on
devtmpfs devtmpfs 126G 0 126G 0% /dev
tmpfs tmpfs 126G 4.0K 126G 1%
/dev/shm
tmpfs tmpfs 126G 18M 126G 1% /run
tmpfs tmpfs 126G 0 126G 0%
/sys/fs/cgroup
/dev/loop0 tmpfs 126G 23G 104G 18%
/tmp/falywSTkc/mntpoint
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210630/4c277cb1/attachment.htm>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LTP] [RFC] Limit the tmpfs size on mounting
2021-06-30 8:08 [LTP] [RFC] Limit the tmpfs size on mounting Li Wang
@ 2021-06-30 9:20 ` Cyril Hrubis
2021-07-01 5:58 ` Li Wang
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2021-06-30 9:20 UTC (permalink / raw)
To: ltp
Hi!
> LTP mount and make use of the whole tmpfs of the test system,
> generally, it's fine. But if a test (e.g fallocate06) try to fill full in
> the
> filesystem, it takes too long to complete testing on a large memory
> system.
>
> I'm thinking whether we should limit the mount tmpfs size for the
> LTP test, maybe only give 512MB? but the tricky part for me is to
> add options like "-o size=512M" to prepare_device(), or do some
> additional work for tmpfs mounting.
>
> and any else way can speed up is also welcome. I'd like to hear
> more advice. Thanks!
I guess that appending '-o size ...' to the mount flags in prepare_device()
is reasonable, but instead of hardcoing the value we should do the same
as we do with the loop devices and the size should be
MAX(tst_test->dev_min_size, DEV_SIZE_MB).
For tmpfs we will do something as:
...
const char *mnt_data = tst_test->mnt_data;
if (!strcmp(dev.fs_type, "tmpfs")) {
unsigned int dev_size = MAX(tst_test->dev_min_size, DEV_SIZE_MB);
if (tst_test->mnt_data) {
snprintf(buf, sizeof(buf), "%s,-o size %uMB",
tst_test->mnt_data, dev_size);
} else {
snprintf(buf, sizeof(buf), "-o size=%uMB", dev_size);
}
tst_res(TINFO, "Limiting tmpfs size to %uMB", dev_size);
mnt_data = buf;
}
> # df -Th | grep tmpfs
> Filesystem Type Size Used Avail Use%
> Mounted on
> devtmpfs devtmpfs 126G 0 126G 0% /dev
> tmpfs tmpfs 126G 4.0K 126G 1%
> /dev/shm
> tmpfs tmpfs 126G 18M 126G 1% /run
> tmpfs tmpfs 126G 0 126G 0%
> /sys/fs/cgroup
> /dev/loop0 tmpfs 126G 23G 104G 18%
Also it looks like should pass something as "ltp-tmpfs" instead of the
"/dev/loopX" string in a case of "tmpfs" filesystem in order not to
confuse people...
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LTP] [RFC] Limit the tmpfs size on mounting
2021-06-30 9:20 ` Cyril Hrubis
@ 2021-07-01 5:58 ` Li Wang
0 siblings, 0 replies; 3+ messages in thread
From: Li Wang @ 2021-07-01 5:58 UTC (permalink / raw)
To: ltp
Cyril Hrubis <chrubis@suse.cz> wrote:
> I guess that appending '-o size ...' to the mount flags in prepare_device()
> is reasonable, but instead of hardcoing the value we should do the same
> as we do with the loop devices and the size should be
> MAX(tst_test->dev_min_size, DEV_SIZE_MB).
>
Yes, dynamically setting the size is better.
> > /dev/loop0 tmpfs 126G 23G 104G 18%
>
> Also it looks like should pass something as "ltp-tmpfs" instead of the
> "/dev/loopX" string in a case of "tmpfs" filesystem in order not to
> confuse people...
>
Quite good proposals, I have sent two patches for achieving the ideas.
Thanks!
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210701/c31bf5ad/attachment.htm>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-01 5:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-30 8:08 [LTP] [RFC] Limit the tmpfs size on mounting Li Wang
2021-06-30 9:20 ` Cyril Hrubis
2021-07-01 5:58 ` Li Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox