Whamcloud - gitweb
LU-18032 llite: disable unaligned AIO 16/55716/5
authorPatrick Farrell <paf0187@gmail.com>
Fri, 12 Jul 2024 15:33:34 +0000 (11:33 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Aug 2024 21:58:38 +0000 (21:58 +0000)
Parallel copy for unaligned DIO has an unpleasant
interaction with AIO - Since AIO is async, we must do the
copying first.

This shows up as rare failures in 119i, which tests
unaligned AIO.

Handling this correctly for AIO introduces some complexity,
so instead we disable unaligned AIO.  This is a very small
use case and the complexity is not worth the benefit.

Signed-off-by: Patrick Farrell <patrick.farrell@oracle.com>
Change-Id: I81781da841b83130c9a7b5855abd88ae048f1908
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55716
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
lustre/include/cl_object.h
lustre/llite/rw26.c
lustre/obdclass/cl_io.c
lustre/tests/sanity.sh

index afe3dd8..85c4513 100644 (file)
@@ -2541,7 +2541,8 @@ struct cl_dio_aio {
        ssize_t                 cda_bytes;
        struct mm_struct        *cda_mm;
        unsigned                cda_no_aio_complete:1,
-                               cda_creator_free:1;
+                               cda_creator_free:1,
+                               cda_is_aio:1;
 };
 
 struct cl_iter_dup {
index 262cc5a..6b0d341 100644 (file)
@@ -575,6 +575,10 @@ ll_direct_IO_impl(struct kiocb *iocb, struct iov_iter *iter, int rw)
        LASSERT(ll_dio_aio);
        LASSERT(ll_dio_aio->cda_iocb == iocb);
 
+       /* unaligned AIO is not supported - see LU-18032 */
+       if (unaligned && ll_dio_aio->cda_is_aio)
+               RETURN(-EINVAL);
+
        /* We cannot do parallel submission of sub-I/Os - for AIO or regular
         * DIO - unless lockless because it causes us to release the lock
         * early.
index 1fb6d8c..4fa5f3f 100644 (file)
@@ -1251,6 +1251,7 @@ struct cl_dio_aio *cl_dio_aio_alloc(struct kiocb *iocb, struct cl_object *obj,
                 */
                cl_sync_io_init_notify(&aio->cda_sync, 1, aio, cl_dio_aio_end);
                aio->cda_iocb = iocb;
+               aio->cda_is_aio = is_aio;
                aio->cda_no_aio_complete = !is_aio;
                /* if this is true AIO, the memory is freed by the last call
                 * to cl_sync_io_note (when all the I/O is complete), because
index d293085..05af821 100755 (executable)
@@ -42,6 +42,7 @@ always_except LU-6493  42b
 always_except LU-16515 118c 118d
 always_except LU-8411  407
 always_except LU-17525 56x 56xa 56xb
+always_except LU-18032 119i
 
 if $SHARED_KEY; then
        always_except LU-14181 64e 64f
@@ -14719,6 +14720,8 @@ test_119h()
 }
 run_test 119h "basic tests of memory unaligned dio"
 
+# Unaligned AIO is disabled and may not be reenabled
+# See LU-18032
 # aiocp with the '-a' option makes testing memory unaligned aio trivial
 test_119i()
 {
@@ -28715,9 +28718,10 @@ test_398d() { #  LU-13846
        diff $DIR/$tfile $aio_file || error "file diff after aiocp"
 
        # test memory unaligned aio
-       aiocp -a 512 -b 64M -s 64M -f O_DIRECT $DIR/$tfile $aio_file ||
-               error "unaligned aio failed"
-       diff $DIR/$tfile $aio_file || error "file diff after aiocp"
+       # LU-18032 - unaligned AIO is disabled
+       #aiocp -a 512 -b 64M -s 64M -f O_DIRECT $DIR/$tfile $aio_file ||
+       #       error "unaligned aio failed"
+       #diff $DIR/$tfile $aio_file || error "file diff after aiocp"
 
        rm -f $DIR/$tfile $aio_file
 }