[LU-15829] DIO small reads fails Created: 06/May/22  Updated: 31/Oct/22  Resolved: 12/Sep/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.15.0
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Major
Reporter: Shaun Tancheff Assignee: Shaun Tancheff
Resolution: Fixed Votes: 0
Labels: None

Attachments: File dio_test.c    
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

On Lustre there is one strange quirk:

DIO writing now works, assuming you are writing from an aligned buffer, you are not restricted to the 512 byte limit.

However DIO reading of a single byte is broken, reading for more than 1 byte is okay.

Attached test source: dio_test.c

[shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -w -d -b 1 /mnt/lustre/tmp/dio_w3.dat
/mnt/lustre/tmp/dio_w3.dat - DIRECT WRITE 1/1 bytes
[shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
read: 0 (EOF)

If the block you are reading 1 byte from is in the PAGE_CACHE then the 1 byte read will succeed.

[shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -b 1 /mnt/lustre/tmp/dio_w3.dat
read: 1, x'33  '
/mnt/lustre/tmp/dio_w3.dat - BUFFER READ 1/1 bytes
[shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
read: 1, x'33  '
/mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/1 bytes
[shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
3
[shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
read: 0 (EOF)

So what happens when doing a DIO read of 2 or more bytes and the block is NOT in the PAGE_CACHE?

[shaun@alma8 dio]$ echo 3 | sudo tee /proc/sys/vm/drop_caches
3
[shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 1 /mnt/lustre/tmp/dio_w3.dat
read: 0 (EOF)
[shaun@alma8 dio]$ /home/shaun/tools/dio/dio_test -d -b 2 /mnt/lustre/tmp/dio_w3.dat
read: 1, x'33  '
read: 0 (EOF)
/mnt/lustre/tmp/dio_w3.dat - DIRECT READ 1/2 bytes
[shaun@alma8 dio]$ 


 Comments   
Comment by Gerrit Updater [ 06/May/22 ]

"Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/47225
Subject: LU-15829 clio: Force buffered I/O on small reads
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 57f500ecaada808af3a2fb5f5dd5d895d5a6aa3b

Comment by Gerrit Updater [ 19/May/22 ]

"Alexey Lyashkov <alexey.lyashkov@hpe.com>" uploaded a new patch: https://review.whamcloud.com/47395
Subject: LU-15829 llite: don't use a kms if it invalid.
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: b96430385b93e30f0bea1e147e0b17f28577bdcd

Comment by Peter Jones [ 12/Sep/22 ]

Landed for 2.16

Generated at Sat Feb 10 03:21:39 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.