summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/vm/compaction_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/vm/compaction_test.c')
-rw-r--r--tools/testing/selftests/vm/compaction_test.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
index 6d1437f895b8..298f69e2834c 100644
--- a/tools/testing/selftests/vm/compaction_test.c
+++ b/tools/testing/selftests/vm/compaction_test.c
@@ -136,6 +136,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
printf("No of huge pages allocated = %d\n",
(atoi(nr_hugepages)));
+ lseek(fd, 0, SEEK_SET);
+
if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages))
!= strlen(initial_nr_hugepages)) {
perror("Failed to write value to /proc/sys/vm/nr_hugepages\n");