summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 175683a5..ce628699 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -60,7 +60,7 @@ static void set_err(int);
#define SIZE_16KB 0x4000
#define SIZE_128KB 0x20000
-#define MAX_RETRY_READ 200
+#define MAX_RETRY_READ 30
#define items(x) (sizeof((x)) / sizeof((x)[0]))
@@ -446,6 +446,9 @@ check_read_or_die(const char *rpath, ssize_t rval, size_t rsize,
err(EINTR, "%s: max retries exceeded on file: %s",
readtype, rpath);
+ /* Prevent CPU hog when on spin-locked reads. */
+ usleep(1);
+
/*
* Bad read, with errno EINTR (syscall interrupted).
* Reset the error state and try again.