2

In an HPC environment, we have 2 nodes family, one running 7.1.1503 (kernel 3.10.0-229.el7.x86_64) and the other, newer, running 7.7.1908 (kernel 3.10.0-1062.12.1.el7.x86_64). Both mount an NFS/RDMA server with the following, vendor (Mellanox) documented flags:

10.0.0.1:/pool0/home on /mnt/rdma type nfs (rw,relatime,sync,vers=3,rsize=262144,wsize=262144,namlen=255,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,hard,nocto,noac,proto=rdma,port=20049,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.1,mountvers=3,mountproto=tcp,local_lock=none,addr=10.0.0.1)

On the 7.1 node, I can do the following:

7.1$ dd if=/dev/zero of=/mnt/rdma/test bs=1 count=701

And on the 7.7 node I would receive exactly the expected file

7.2$ hexdump /mnt/rdma/test
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
00002b0 0000 0000 0000 0000 0000 0000 0000     
00002bd

Now if I do the same test with 700 bytes or less, the file is corrupted:

7.1$ dd if=/dev/zero of=/mnt/rdma/test bs=1 count=700
7.2$ hexdump /mnt/rdma/test | head -10
0000000 9dfe a757 0000 0100 0000 0000 0000 0000
0000010 0000 0000 0000 0000 0000 0000 0000 0100
0000020 0000 0100 0000 a401 0000 0100 0000 0000
0000030 0000 0000 0000 0000 0000 bc02 0000 0000
0000040 0000 0002 0000 0000 0000 0000 168c 0083
0000050 4a0f c612 0000 0000 b000 5a5b 1262 1e75
0000060 9d04 bc90 1262 1a75 c233 50e9 1262 1a75
0000070 c233 50e9 0000 bc02 0000 0100 0000 bc02
0000080 0000 0000 000a 5b5a 00b0 0000 0f9d 030c
0000090 0000 2d00 0000 0000 0000 0000 0000 0000

When trying the same commands with NFS over TCP instead of RDMA, the file is not corrupted.

We have tried many, many mount options, tuningrsize and wsize among them and are running out of ideas and would be very glad to have some new ones...
Yes upgrading to a more recent kernel is obviously on the table but I'm not yet sure it would be feasible on a short timing.
Note the ancient nodes don't work with 7.7, and newer nodes don't work with 7.1.

Update

Like suggested I've upgraded to the latest CentOS 7 version and, well, the bug still exists.

node1# dd if=/dev/zero of=/mnt/rdma/1160 bs=1 count=700
node2# uname -mr
3.10.0-1160.53.1.el7.x86_64 x86_64
node2# lsb_release -d
Description:    CentOS Linux release 7.9.2009 (Core)
node2# hexdump /mnt/rdma/1160|head -5
0000000 376b 1728 0000 0100 0000 0000 0000 0000
0000010 0000 0000 0000 0000 0000 0000 0000 0100
0000020 0000 0100 0000 a401 0000 0100 0000 0000
0000030 0000 0000 0000 0000 0000 bc02 0000 0000
0000040 0000 0002 0000 0000 0000 0000 168c 0083

Update 2

I just did a test on the same node, the most recent one, upgraded to CentOS 7.9, and it actually fails when writing and reading from the same node.
Moreover, tweaking with /proc/sys/sunrpc/rdma_memreg_strategy produces very strange results, for example with rdma_memreg_strategy == 6 the noise looks like that:

0000120 8898 123d 4506 c0f8 b0d6 3940 44b9 c0f8
0000130 bc92 ba64 4491 c0f8 165c 0ae4 448e c0f8
0000140 c82e 19e7 44a9 c0f8 2ddc 11f2 44dc c0f8
0000150 ad84 79aa 4520 c0f8 b4af 68ca 4571 c0f8
0000160 b752 b3ef 45cb c0f8 b04a 97b8 462d c0f8
0000170 7543 d694 4695 c0f8 d5dd 2cdc 4702 c0f8
0000180 a9bb f717 476e c0f8 4a78 13d9 47d7 c0f8
0000190 2a26 a9e4 4834 c0f8 71c8 3d91 4882 c0f8
00001a0 fcae 8d55 48bb c0f8 2b04 bcf8 48dd c0f8
00001b0 b04c a4be 48e8 c0f8 79d3 db6c 48dc c0f8
00001c0 9f84 c912 48bb c0f8 096c b285 4886 c0f8
00001d0 f0ff ee8e 483e c0f8 d171 e773 47e4 c0f8
00001e0 8e7b f3d1 4779 c0f8 4bbd d26f 46ff c0f8

Update 3

I installed Mellanox's official drivers. Now the corruption occurs with file < 640 bytes...

Update 4

Well it's actually worse than I thought. The files are not just "corrupted", they are actual memory leaks:

# cat 20220222-1
0000000: b449 1fc1 0000 0001 0000 0000 0000 0000  .I..............
0000010: 0000 0000 0000 0000 0000 0000 0000 0001  ................
0000020: 0000 0001 0000 01a4 0000 0001 0000 0000  ................
0000030: 0000 0000 0000 0000 0000 0258 0000 0000  ...........X....
0000040: 0000 0200 0000 0000 0000 0000 8c16 8300  ................
0000050: 0f4a 12c6 0000 0000 00b0 5fd3 6214 a09b  .J........_.b...
0000060: 0c5f 0ffa 6214 a088 0f67 27e3 6214 a088  ._..b....g'.b...
0000070: 0f67 27e3 0000 0258 0000 0001 0000 0258  .g'....X.......X
0000080: 0000 5c9a 0000 0000 0000 0000 0000 0020  ..\............ 
0000090: 0100 0601 c612 4a0f 0083 168c 0000 0000  ......J.........
00000a0: 0000 0000 0a00 fd56 b000 0000 6d9c 0903  .......V....m...
00000b0: 0000 0000 3d33 8000 0000 011a 0000 0002  ....=3..........
00000c0: 0000 011a 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d  ....------------
00000d0: 0a0a 0a0a 0a2d 2d2d 2d2d 2d2d 2d2d 2d2d  .....-----------
00000e0: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d  ----------------
00000f0: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2049  -------------- I
0000100: 7465 7261 7469 6f6e 2038 3438 3928 2020  teration 8489(  
0000110: 2035 2920 202d 2d2d 2d2d 2d2d 2d2d 2d2d   5)  -----------
0000120: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d  ----------------
0000130: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 0a0a 0a20  ------------... 
0000140: 2020 2050 4f54 4c4f 4b3a 2020 6370 7520     POTLOK:  cpu 
0000150: 7469 6d65 2020 2020 302e 3033 3532 3a20  time    0.0352: 
0000160: 7265 616c 2074 696d 6520 2020 2030 2e30  real time    0.0
0000170: 3334 390a 2020 2020 5345 5444 494a 3a20  349.    SETDIJ: 
0000180: 2063 7075 2074 696d 6520 2020 2030 2e30   cpu time    0.0
0000190: 3332 383a 2072 6561 6c20 7469 6d65 2020  328: real time  
00001a0: 2020 302e 3033 3239 0a20 2020 2045 4444    0.0329.    EDD
00001b0: 4941 473a 2020 6370 7520 7469 6d65 2020  IAG:  cpu time  
00001c0: 2020 332e 3139 3638 3a20 7265 616c 2074    3.1968: real t
00001d0: 696d 6520 2020 2033 2e31 3938 310a 0000  ime    3.1981...
00001e0: 3131 3238 2020 2020 0a48 4352 2020 2020  1128    .HCR    
00001f0: 2020 2020 2020 2020 2038 320a 2020 2020           82.    
0000200: 2031 322e 3934 3834 3732 3233 2020 2020   12.94847223    
0000210: 2020 2020 2d34 2e31 3938 3830 3635 3138      -4.198806518
0000220: 2020 2020 2020 2020 302e 3933 3536 3336          0.935636
0000230: 3039 3935 2020 2020 0a20 2020 3133 2e33  0995    .   13.3
0000240: 3837 3634 3434 3334 3120 2020 2020 2020  876444341       
0000250: 322e 3732 3939 3339                      2.729939
3
  • There have been a lot of bug fixes in the nfs code, both in the kernel as well as in the nfs-utils package. Why can’t you upgrade these hosts to version of CentOS that is actually supported?
    – jsbillings
    Feb 21 at 2:28
  • I've just upgraded to latest CentOS release and kernel and unfortunately the issue is still there.
    – iMil
    Feb 21 at 9:45
  • 1
    I've hit the same issue after upgrading my workstation to the latest Ubuntu version. Thanks for posting the root-cause, I would still be searching for the cause if I hadn't found your posting. Thanks a lot!
    – Marcel Noe
    May 16 at 19:32

2 Answers 2

1

So, after a week of hunting down the bug, I came out with a very simple patch.
There is definitely a bug in the rpcrdma kernel module, which, when data is less or equal than a certain size, doesn't split it into chunks and process it inline. This processing has a bug I couldn't find, but a trivial fix is to process all files as chunks, by simply always returning 0 from the rpcrdma_results_inline() function. I have contacted the driver's author and opened a security bug at RedHat's Bugzilla.

0

Running CentOS-7.9, I can not reproduce your issue.

[tru@gpulab00 ~]$ uname -r
3.10.0-1160.45.1.el7.x86_64
[tru@gpulab00 ~]$ mount|grep tru
10.0.1.2:/master/home/tru on /master/home/tru type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=rdma,port=20049,timeo=600,retrans=2,sec=sys,local_lock=none,addr=10.0.1.2)
[tru@gpulab00 ~]$ dd if=/dev/zero of=test bs=1 count=700
700+0 records in
700+0 records out
700 bytes (700 B) copied, 0.00286438 s, 244 kB/s
[tru@gpulab00 ~]$ hexdump test
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
00002b0 0000 0000 0000 0000 0000 0000          
00002bc

reading the same file on another client:

[tru@gpulab03 ~]$ uname -r
3.10.0-1160.45.1.el7.x86_64
[tru@gpulab03 ~]$  hexdump test
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
00002b0 0000 0000 0000 0000 0000 0000          
00002bc
[tru@gpulab03 ~]$ 
4
  • It's hard for me to read this as an answer. The first interpretation I get is "I (Tru) don't have the problem", which is not an answer. The second interpretation could be "Change to CentOS 7.9 (where the problem is fixed)", except the question (now) says: "I just did a test on the same node, the most recent one, upgraded to CentOS 7.9, and it actually fails when writing and reading from the same node." Is there anything else you can say about the differences in your environments that might point to the solution? I would also bring your attention to the accepted answer.
    – Jeff Schaller
    Mar 1 at 17:49
  • My comment was posted before any updates were added, to convey the upgrade to a "supported" kernel version. Trying to bug fix on an obsolete kernel is just wasting energy, imho as no one else can benefit from the fix as the code involved might have changed in later kernel revisions.
    – Tru Huynh
    Mar 2 at 19:03
  • Understood; thank you for clarifying! In the future, I would recommend clarifying your intention in the post -- something like "perhaps a newer release with a newer kernel would help; I don't see the issue in CentOS 7.9" would be clearer? Thanks!
    – Jeff Schaller
    Mar 2 at 19:05
  • The bug and the mitigation fix are both against the master branch of the kernel, so apply to recent kernels too.
    – Dereckson
    Mar 14 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.