Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Aug 31, 2022

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit b68ba328173f5a4714d888f6ce80fd24a4e4c504:

test: get 32-bit Ubuntu 22.04 build working (2022-08-29 16:42:18 -0400)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to c9be6f0007ab79e3f83952c650af8e7a0c324953:

Merge branch 'master' of https://github.com/bvanassche/fio (2022-08-30 18:19:30 -0600)

----------------------------------------------------------------
Bart Van Assche (4):
Remove two casts from os-linux.h
Linux: Use the byte order functions from <asm/byteorder.h> Split os-android.h
Merge os-android.h into os-linux.h

Jens Axboe (3):
backend: revert bad memory leak fix
Fio 3.32
Merge branch 'master' of https://github.com/bvanassche/fio

Vincent Fu (1):
test: add tests for lfsr and norandommap

 FIO-VERSION-GEN    |   2 +-
 backend.c          |   5 -
 os/os-android.h    | 342 -----------------------------------------------------
 os/os-ashmem.h     |  84 +++++++++++++
 os/os-linux.h      |  14 ++-
 os/os.h            |   4 +-
 t/jobs/t0021.fio   |  15 +++
 t/jobs/t0022.fio   |  13 ++
 t/run-fio-tests.py |  55 ++++++++-
 9 files changed, 180 insertions(+), 354 deletions(-)
 delete mode 100644 os/os-android.h
 create mode 100644 os/os-ashmem.h
 create mode 100644 t/jobs/t0021.fio
 create mode 100644 t/jobs/t0022.fio

---

Diff of recent changes:

FIO-VERSION-GEN +1 -1
index 72630dd0..db073818 100755
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=FIO-VERSION-FILE
-DEF_VER=fio-3.31
+DEF_VER=fio-3.32
 
 LF='
 '
backend.c +0 -5
index 375a23e4..fe614f6e 100644
@@ -2451,10 +2451,8 @@ reap:
 							strerror(ret));
 			} else {
 				pid_t pid;
-				struct fio_file **files;
 				void *eo;
 				dprint(FD_PROCESS, "will fork\n");
-				files = td->files;
 				eo = td->eo;
 				read_barrier();
 				pid = fork();
@@ -2465,9 +2463,6 @@ reap:
 					_exit(ret);
 				} else if (i == fio_debug_jobno)
 					*fio_debug_jobp = pid;
-				// freeing previously allocated memory for files
-				// this memory freed MUST NOT be shared between processes, only the pointer itself may be shared within TD
-				free(files);
 				free(eo);
 				free(fd);
 				fd = NULL;
os/os-android.h deleted +0 -342

342 lines not on this page · raw message

os/os-ashmem.h new file +84 -0

84 lines not on this page · raw message

os/os-linux.h +12 -2
index 3001140c..831f0ad0 100644
@@ -1,7 +1,11 @@
 #ifndef FIO_OS_LINUX_H
 #define FIO_OS_LINUX_H
 
+#ifdef __ANDROID__
+#define FIO_OS  os_android
+#else
 #define	FIO_OS	os_linux
+#endif
 
 #include <sys/ioctl.h>
 #include <sys/uio.h>
@@ -17,6 +21,11 @@
 #include <linux/major.h>
 #include <linux/fs.h>
 #include <scsi/sg.h>
+#include <asm/byteorder.h>
+#ifdef __ANDROID__
+#include "os-ashmem.h"
+#define FIO_NO_HAVE_SHM_H
+#endif
 
 #ifdef ARCH_HAVE_CRC_CRYPTO
 #include <sys/auxv.h>
@@ -50,6 +59,7 @@
 #define FIO_HAVE_TRIM
 #define FIO_HAVE_GETTID
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
+#define FIO_HAVE_BYTEORDER_FUNCS
 #define FIO_HAVE_PWRITEV2
 #define FIO_HAVE_SHM_ATTACH_REMOVED
 
@@ -81,8 +91,8 @@ typedef cpu_set_t os_cpu_mask_t;
 	pthread_getaffinity_np(pthread_self(), sizeof(mask), &(mask))
 #endif
 
-#define fio_cpu_clear(mask, cpu)	(void) CPU_CLR((cpu), (mask))
-#define fio_cpu_set(mask, cpu)		(void) CPU_SET((cpu), (mask))
+#define fio_cpu_clear(mask, cpu)	CPU_CLR((cpu), (mask))
+#define fio_cpu_set(mask, cpu)		CPU_SET((cpu), (mask))
 #define fio_cpu_isset(mask, cpu)	(CPU_ISSET((cpu), (mask)) != 0)
 #define fio_cpu_count(mask)		CPU_COUNT((mask))
 
os/os.h +1 -3
index 810e6166..aba6813f 100644
@@ -33,9 +33,7 @@ typedef enum {
 } cpu_features;
 
 /* IWYU pragma: begin_exports */
-#if defined(__ANDROID__)
-#include "os-android.h"
-#elif defined(__linux__)
+#if defined(__linux__)
 #include "os-linux.h"
 #elif defined(__FreeBSD__)
 #include "os-freebsd.h"
t/jobs/t0021.fio new file +15 -0
new file mode 100644
index 00000000..47fbae71
@@ -0,0 +1,15 @@
+# make sure the lfsr random generator actually does touch all the offsets
+#
+# Expected result: offsets are not accessed sequentially and all offsets are touched
+# Buggy result: offsets are accessed sequentially and one or more offsets are missed
+# run with --debug=io or logging to see which offsets are read
+
+[test]
+ioengine=null
+filesize=1M
+rw=randread
+write_bw_log=test
+per_job_logs=0
+log_offset=1
+norandommap=1
+random_generator=lfsr
t/jobs/t0022.fio new file +13 -0
new file mode 100644
index 00000000..2324571e
@@ -0,0 +1,13 @@
+# make sure that when we enable norandommap we touch some offsets more than once
+#
+# Expected result: at least one offset is touched more than once
+# Buggy result: each offset is touched only once
+
+[test]
+ioengine=null
+filesize=1M
+rw=randread
+write_bw_log=test
+per_job_logs=0
+log_offset=1
+norandommap=1
t/run-fio-tests.py +54 -1

73 lines not on this page · raw message