Index: uspace/app/perf/perf.c
===================================================================
--- uspace/app/perf/perf.c	(revision d5caf7922353a9ff31141de881200acc494919a3)
+++ uspace/app/perf/perf.c	(revision 980611d5ebb91a5ee7150f0b863cebed3d2a1076)
@@ -107,7 +107,16 @@
 	}
 
-	size_t workload_size = 1;
-
-	while (true) {
+	/*
+	 * Find workload size that is big enough to last few seconds.
+	 * We also check that uint64_t is big enough.
+	 */
+	uint64_t workload_size = 0;
+	for (size_t bits = 0; bits <= 64; bits++) {
+		if (bits == 64) {
+			str_cpy(error_msg, MAX_ERROR_STR_LENGTH, "Workload too small even for 1 << 63");
+			goto leave_error;
+		}
+		workload_size = ((uint64_t) 1) << bits;
+
 		stopwatch_t stopwatch = STOPWATCH_INITIALIZE_STATIC;
 
@@ -123,8 +132,7 @@
 			break;
 		}
-		workload_size *= 2;
-	}
-
-	printf("Workload size set to %zu, measuring %d samples.\n", workload_size, NUM_SAMPLES);
+	}
+
+	printf("Workload size set to %" PRIu64 ", measuring %d samples.\n", workload_size, NUM_SAMPLES);
 
 	stopwatch_t *stopwatch = calloc(NUM_SAMPLES, sizeof(stopwatch_t));
