* [LTP] [PATCH] lib/tst_device: Fill a file in megabyte sized chunks
@ 2018-05-14 16:03 Punit Agrawal
2018-05-16 8:51 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Punit Agrawal @ 2018-05-14 16:03 UTC (permalink / raw)
To: ltp
A zero-filled file is used as backing store when creating a loopback
device. The zero-fill operations is done in 1KB sized chunks for
file-size specified in megabytes. This leads to a large number of
write calls which take long time during test setup phase in certain
environments.
Move to using 1MB sized chunks to reduce the number of write syscalls
by a few order of magnitude.
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
---
lib/tst_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/tst_device.c b/lib/tst_device.c
index edfacbdc7..463743443 100644
--- a/lib/tst_device.c
+++ b/lib/tst_device.c
@@ -268,7 +268,7 @@ const char *tst_acquire_device__(unsigned int size)
ltp_dev_size, acq_dev_size);
}
- if (tst_fill_file(DEV_FILE, 0, 1024, 1024 * acq_dev_size)) {
+ if (tst_fill_file(DEV_FILE, 0, 1024 * 1024, acq_dev_size)) {
tst_resm(TWARN | TERRNO, "Failed to create " DEV_FILE);
return NULL;
}
--
2.17.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [LTP] [PATCH] lib/tst_device: Fill a file in megabyte sized chunks
2018-05-14 16:03 [LTP] [PATCH] lib/tst_device: Fill a file in megabyte sized chunks Punit Agrawal
@ 2018-05-16 8:51 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2018-05-16 8:51 UTC (permalink / raw)
To: ltp
Hi!
Pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-16 8:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14 16:03 [LTP] [PATCH] lib/tst_device: Fill a file in megabyte sized chunks Punit Agrawal
2018-05-16 8:51 ` Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.