Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Oct 22

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 4767beef328a257c4300358ffa2901f3e0f1dc68:

Merge branch 'write_zeries' of https://github.com/panky-codes/fio (2026-10-19 11:57:14 -0400)

are available in the Git repository at:

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

for you to fetch changes up to 80eb2516037c627d77cd7e8a428cb534b830f9b6:

Merge branch 'configure-libatomic' of https://github.com/kraj/fio (2026-10-21 10:47:54 -0400)

----------------------------------------------------------------
Avri Altman (1):
fio: reduce scope of multi_range_trim

Khem Raj (1):
configure: Link with libatomic when 64-bit atomics need it

Vincent Fu (2):
Merge branch 'multi-range-trim-upstream' of https://github.com/avri-altman-sndk/fio
Merge branch 'configure-libatomic' of https://github.com/kraj/fio

 configure | 23 +++++++++++++++++++++++
 fio.h     |  8 --------
 io_u.c    |  8 ++++++++
 3 files changed, 31 insertions(+), 8 deletions(-)

---

Diff of recent changes:

configure +23 -0
index 9dfc9b6d..cb602482 100755
@@ -667,6 +667,29 @@ if ! compile_prog "" "" "C11 atomics"; then
   fatal "C11 atomics support not found"
 fi
 
+##########################################
+# check if 64-bit atomics need libatomic
+# The variable is global and the stored value depends on argc so that the
+# compiler cannot optimize the atomic operations away.
+cat > $TMPC <<EOF
+#include <stdatomic.h>
+#include <stdint.h>
+_Atomic uint64_t v;
+int main(int argc, char **argv)
+{
+  atomic_store_explicit(&v, (uint64_t)argc, memory_order_release);
+  return (int)atomic_load_explicit(&v, memory_order_acquire);
+}
+EOF
+libatomic="no"
+if ! compile_prog "" "" "64-bit atomics"; then
+  if compile_prog "" "-latomic" "64-bit atomics with libatomic"; then
+    libatomic="yes"
+    LIBS="-latomic $LIBS"
+  fi
+fi
+print_config "libatomic for 64-bit atomics" "$libatomic"
+
 
 ##########################################
 # check for wordsize
fio.h +0 -8
index 84d46414..2be348b5 100644
@@ -646,14 +646,6 @@ static inline void fio_ro_check(const struct thread_data *td, struct io_u *io_u)
 	 */
 }
 
-static inline bool multi_range_trim(struct thread_data *td, struct io_u *io_u)
-{
-	if (io_u->ddir == DDIR_TRIM && td->o.num_range > 1)
-		return true;
-
-	return false;
-}
-
 static inline bool should_fsync(struct thread_data *td)
 {
 	if (ddir_sync(td->last_ddir_issued))
io_u.c +8 -0
index 9a7422bb..7be78d18 100644
@@ -21,6 +21,14 @@ struct io_completion_data {
 	struct timespec time;		/* output */
 };
 
+static bool multi_range_trim(struct thread_data *td, struct io_u *io_u)
+{
+	if (io_u->ddir == DDIR_TRIM && td->o.num_range > 1)
+		return true;
+
+	return false;
+}
+
 /*
  * The ->io_axmap contains a map of blocks we have or have not done io
  * to yet. Used to make sure we cover the entire range in a fair fashion.