All of lore.kernel.org
 help / color / mirror / Atom feed
From: Punit Agrawal <punit.agrawal@arm.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib/tst_device: Fill a file in megabyte sized chunks
Date: Mon, 14 May 2018 17:03:54 +0100	[thread overview]
Message-ID: <20180514160354.13281-1-punit.agrawal@arm.com> (raw)

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


             reply	other threads:[~2018-05-14 16:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 16:03 Punit Agrawal [this message]
2018-05-16  8:51 ` [LTP] [PATCH] lib/tst_device: Fill a file in megabyte sized chunks Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180514160354.13281-1-punit.agrawal@arm.com \
    --to=punit.agrawal@arm.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.