Get rid of O_ATOMIC
authorJens Axboe <axboe@kernel.dk>
Fri, 17 Feb 2023 18:14:47 +0000 (11:14 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 17 Feb 2023 18:14:47 +0000 (11:14 -0700)
This feature never went upstream on the Linux kernel side, let's just
get rid of it.

The option is left for now, but we can deprecate that or even probably
remove it as it will never had had any effect.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
HOWTO.rst
backend.c
engines/ime.c
engines/libzbc.c
filesetup.c
fio.1
init.c
memory.c
os/os-linux.h
os/os.h

index 158c5d897e520c5d075d201cee8b10bf6fc81386..26a3c039a5976ee7bdd360f747be3f1fb86ded87 100644 (file)
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -1110,12 +1110,6 @@ I/O type
        OpenBSD and ZFS on Solaris don't support direct I/O.  On Windows the synchronous
        ioengines don't support direct I/O.  Default: false.
 
-.. option:: atomic=bool
-
-       If value is true, attempt to use atomic direct I/O. Atomic writes are
-       guaranteed to be stable once acknowledged by the operating system. Only
-       Linux supports O_ATOMIC right now.
-
 .. option:: buffered=bool
 
        If value is true, use buffered I/O. This is the opposite of the
index 0ccc7c2b72aaaf9c1924ea63824e74f911e4c02c..9e981bf408016aadb40f30dd5ca06db87febd0c6 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1333,7 +1333,7 @@ int init_io_u_buffers(struct thread_data *td)
         * overflow later. this adjustment may be too much if we get
         * lucky and the allocator gives us an aligned address.
         */
-       if (td->o.odirect || td->o.mem_align || td->o.oatomic ||
+       if (td->o.odirect || td->o.mem_align ||
            td_ioengine_flagged(td, FIO_RAWIO))
                td->orig_buffer_size += page_mask + td->o.mem_align;
 
@@ -1352,7 +1352,7 @@ int init_io_u_buffers(struct thread_data *td)
        if (data_xfer && allocate_io_mem(td))
                return 1;
 
-       if (td->o.odirect || td->o.mem_align || td->o.oatomic ||
+       if (td->o.odirect || td->o.mem_align ||
            td_ioengine_flagged(td, FIO_RAWIO))
                p = PTR_ALIGN(td->orig_buffer, page_mask) + td->o.mem_align;
        else
index f6690cc16c302c81378105165eea708d8cb179aa..037b8419e253c2340587eadd207a8296c18f8581 100644 (file)
@@ -188,10 +188,6 @@ static int fio_ime_open_file(struct thread_data *td, struct fio_file *f)
                return 1;
        }
 
-       if (td->o.oatomic) {
-               td_verror(td, EINVAL, "IME does not support atomic IO");
-               return 1;
-       }
        if (td->o.odirect)
                flags |= O_DIRECT;
        flags |= td->o.sync_io;
index cb3e9ca5458e3488a113ad3b5adfaac20da5d457..1bf1e8c8d838c4b7a954bf92d62ea21cf2b2b811 100644 (file)
@@ -71,12 +71,6 @@ static int libzbc_open_dev(struct thread_data *td, struct fio_file *f,
                        flags |= O_RDONLY;
        }
 
-       if (td->o.oatomic) {
-               td_verror(td, EINVAL, "libzbc does not support O_ATOMIC");
-               log_err("%s: libzbc does not support O_ATOMIC\n", f->file_name);
-               return -EINVAL;
-       }
-
        ld = calloc(1, sizeof(*ld));
        if (!ld)
                return -ENOMEM;
index cb7047c5afe58019809802a0a8cb77e6e400f507..1836d7e2a10540014947a6a8df5b935306af1ee4 100644 (file)
@@ -741,13 +741,6 @@ int generic_open_file(struct thread_data *td, struct fio_file *f)
                goto skip_flags;
        if (td->o.odirect)
                flags |= OS_O_DIRECT;
-       if (td->o.oatomic) {
-               if (!FIO_O_ATOMIC) {
-                       td_verror(td, EINVAL, "OS does not support atomic IO");
-                       return 1;
-               }
-               flags |= OS_O_DIRECT | FIO_O_ATOMIC;
-       }
        flags |= td->o.sync_io;
        if (td->o.create_on_open && td->o.allow_create)
                flags |= O_CREAT;
diff --git a/fio.1 b/fio.1
index 00a09353900f14980c511ad2048e5671ee902169..9ec90133ae165d88d6f55b56cd75e13d0414fad4 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -873,11 +873,6 @@ If value is true, use non-buffered I/O. This is usually O_DIRECT. Note that
 OpenBSD and ZFS on Solaris don't support direct I/O. On Windows the synchronous
 ioengines don't support direct I/O. Default: false.
 .TP
-.BI atomic \fR=\fPbool
-If value is true, attempt to use atomic direct I/O. Atomic writes are
-guaranteed to be stable once acknowledged by the operating system. Only
-Linux supports O_ATOMIC right now.
-.TP
 .BI buffered \fR=\fPbool
 If value is true, use buffered I/O. This is the opposite of the
 \fBdirect\fR option. Defaults to true.
diff --git a/init.c b/init.c
index f6a8056a2d0791b60b9ddc1d3b6f9968e1eb0c16..78c6c803513b76fc5e861a31901140f9deed873e 100644 (file)
--- a/init.c
+++ b/init.c
@@ -916,12 +916,6 @@ static int fixup_options(struct thread_data *td)
                ret |= 1;
        }
 
-       /*
-        * O_ATOMIC implies O_DIRECT
-        */
-       if (o->oatomic)
-               o->odirect = 1;
-
        /*
         * If randseed is set, that overrides randrepeat
         */
index 577d3dd5afd80d2a3dd1cdd4183b797b276f0f04..2fdca65768b91b9967011f7778ad59c9dbd4e4e5 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -295,7 +295,7 @@ int allocate_io_mem(struct thread_data *td)
 
        total_mem = td->orig_buffer_size;
 
-       if (td->o.odirect || td->o.mem_align || td->o.oatomic ||
+       if (td->o.odirect || td->o.mem_align ||
            td_ioengine_flagged(td, FIO_MEMALIGN)) {
                total_mem += page_mask;
                if (td->o.mem_align && td->o.mem_align > page_size)
@@ -341,7 +341,7 @@ void free_io_mem(struct thread_data *td)
        unsigned int total_mem;
 
        total_mem = td->orig_buffer_size;
-       if (td->o.odirect || td->o.oatomic)
+       if (td->o.odirect)
                total_mem += page_mask;
 
        if (td->io_ops->iomem_alloc && !fio_option_is_set(&td->o, mem_type)) {
index bbb1f27c8234465ab06e9aec1abeb77318defe8d..7a78b42d4d1066d7fc274f78e7cfb444555b3765 100644 (file)
@@ -205,12 +205,6 @@ static inline unsigned long long os_phys_mem(void)
 #define FIO_O_NOATIME  0
 #endif
 
-#ifdef O_ATOMIC
-#define OS_O_ATOMIC    O_ATOMIC
-#else
-#define OS_O_ATOMIC    040000000
-#endif
-
 #ifdef MADV_REMOVE
 #define FIO_MADV_FREE  MADV_REMOVE
 #endif
diff --git a/os/os.h b/os/os.h
index c428260ca4b80132da47f4ab26f84d21dd3409f6..ebaf8af5e2f3f683dabd15249df6dcbd662bae5e 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -133,12 +133,6 @@ extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu);
 #define OS_O_DIRECT                    O_DIRECT
 #endif
 
-#ifdef OS_O_ATOMIC
-#define FIO_O_ATOMIC                   OS_O_ATOMIC
-#else
-#define FIO_O_ATOMIC                   0
-#endif
-
 #ifndef FIO_HAVE_HUGETLB
 #define SHM_HUGETLB                    0
 #define MAP_HUGETLB                    0