Whamcloud - gitweb
LU-17525 llite: unaligned DIO interop page alignment 97/53997/38
authorShaun Tancheff <shaun.tancheff@hpe.com>
Fri, 31 May 2024 15:58:30 +0000 (09:58 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Jun 2024 03:23:15 +0000 (03:23 +0000)
commit07a1272233c56ac0191a4e9e20d77234b3fb3d90
treeaadad1a2185e38608ca9692aacdf009660f5584b
parentf539e6fbcaef1eefcc9a365fea23400d132cefb8
LU-17525 llite: unaligned DIO interop page alignment

Correctly size brw/ptlrpc bulk ops I/O between archs with differing
page sizes (ex: 64k client and 4k server).

Since the number of MDs need for a bulk are not stable until all the
pages are added we have two parts to interop calculation.

In the fist step if this is an unaligned dio bulk with a 64k offset
greater than 4k in size calculate the initial MD utilization
as if first partial page is 64k in length.

In the second step after bulk is sized and split across 1 or more
MDs, if the number of MDs:
 - if the number of MDs is 1, clear the interop flag
 - if the number of MDs is 3 or more, keep the interop flag
 - if the number of MDs is 2 and the size with the 64k offset does
   not exceed the LNET_MUT then collapse the extra MD.
This is done by assuming the first page is 64k length.

Additionally fixup OBD_CONNECT2_UNALIGNED_DIO and add a ZFS osd
heuristic check. No unaligned DIO should be performed with older
zfs-osd, however unaligned dio with unpatched ldiskfs servers is
allowed for most cases. Allow I/O that will trigger the page
size interop issue will get fail with -EINVAL, were previously
these i/o would fail sending with an error:

LNetError: 7386:0:(lib-ptl.c:189:lnet_try_match_md()) Matching packet
   from 12345-10.240.22.81@tcp, match 1789613636069888 length 1044481
   too big: 983041 left, 983041 allowed

triggering the MD to be resent, however the size calcuations reamin
unchanged resulting in a hang.

Test-Parameters: testlist=sanity clientarch=aarch64 clientdistro=el9.3
Test-Parameters: testlist=sanity clientarch=ppc64le clientdistro=el8.8 env=SANITY_EXCEPT="398c 411b"
Test-Parameters: testlist=sanity serverversion=2.15.4 serverdistro=el8.9 env=SANITY_EXCEPT="17n 24g 27R 56oc 56wc 162c 230b 230c 230x 230t 273c 300i"
Test-Parameters: testlist=sanity clientarch=aarch64 clientdistro=el9.3 serverversion=2.15.4 serverdistro=el8.9 env=SANITY_EXCEPT="27R 56oc 56wc 160a 160l 162c 230c 230m 230t 230x 273c 300i"
Test-Parameters: testlist=sanity clientarch=aarch64 clientdistro=el9.3 envdefinitions=ONLY="119e 119f 119g 119h 119i"
Test-Parameters: testlist=sanity clientarch=aarch64 clientdistro=el9.3 envdefinitions=ONLY="119m 119m 119n 119o 119p 119q"
Test-Parameters: testlist=sanity clientarch=x86_64 clientdistro=el9.3 envdefinitions=ONLY="119e 119f 119g 119h 119i"
Test-Parameters: testlist=sanity clientarch=x86_64 clientdistro=el9.3 envdefinitions=ONLY="119m 119m 119n 119o 119p 119q"
Fixes: 7194eb6431 ("LU-13805 clio: bounce buffer for unaligned DIO")
Fixes: 0e6e60b123 ("LU-13805 llite: Implement unaligned DIO connect flag")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: Ifb5152b7ebaba696e6f2cef3af43b0ecd5e53d94
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53997
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: xinliang <xinliang.liu@linaro.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Patrick Farrell <patrick.farrell@oracle.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
13 files changed:
lnet/include/uapi/linux/lnet/lnet-types.h
lustre/include/cl_object.h
lustre/include/lustre_export.h
lustre/include/lustre_net.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/ldlm/ldlm_lib.c
lustre/llite/rw26.c
lustre/osc/osc_io.c
lustre/osc/osc_request.c
lustre/ptlrpc/client.c
lustre/ptlrpc/pers.c
lustre/target/tgt_handler.c
lustre/tests/sanity.sh