[LU-16964] I/O Path: Auto switch from BIO to DIO Created: 14/Jul/23  Updated: 03/Aug/23  Resolved: 03/Aug/23

Status: Closed
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Qian Yingjin Assignee: Qian Yingjin
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates LU-13802 New i/o path: Buffered i/o as DIO Open
Related
is related to LU-13805 i/o path: Unaligned direct i/o Open
is related to LU-12550 automatic lockahead Open
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

We design a hybrid I/O path engine to perform buffered I/O as direct I/O. It can switch from the default buffered I/O to direct I/O path and allow the buffered I/O which meets the requirements and conditions to perform I/O in direct mode appropirately.

It is completely implemented inside the file system, and there is no need any changes for applications. In the user space the application does simple read() or write() calls. The filesystem decides internally to do buffered I/O via page cache, or switch to unligned (or aligned if possible) direct I/O accordingly.

i.e. to obtain better performance, the client can use buffered I/O for samll I/O size and direct I/O for large I/O size. For the sequential write, it can perform buffer I/O when the file is in small size at the beginning, and switch to high efficient direct I/O when the file is gradually growing large or the system memory is under pressure.

Switching to use direct I/O may provide some performance benefits in the following cases:

  • There is no access locality;
  • The system is under memory pressure or high CPU usage;
  • A file is shared access under high contention from many clients;

This ticket tracks this feature to automatically switch from BIO to DIO path.



 Comments   
Comment by Gerrit Updater [ 14/Jul/23 ]

"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51679
Subject: LU-16964 llite: auto switch from BIO to DIO
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: e3e07e129ca55585af5831fd25cc07fa96d5394d

Comment by Andreas Dilger [ 14/Jul/23 ]

This seems a lot like LU-13802. Why duplicate the ticket and patch instead of starting with that patch?

Comment by Andreas Dilger [ 14/Jul/23 ]

Yingjin, how does this handle unaligned input pages from userspace? That was the problem that Patrick hit in LU-13802, which is why he is working on the DIO bounce buffer patch https://review.whamcloud.com/45616 "LU-13805 clio: bounce buffer for unaligned DIO".

It would be good to discuss such CLIO changes with Patrick in advance rather than jumping in and developing a large patch that is conflicting with the work that Patrick is already doing. I'm happy to see improvements to IO performance, but we don't have enough developers to have two of them duplicating their efforts.

Comment by Patrick Farrell [ 14/Jul/23 ]

The patch here handles the unaligned case by skipping it, so it only does aligned stuff.  That's not going to be very useful, but it can be a stepping stone.  The LU is kind of a duplicate of LU-13802.

Mostly I think this is not very useful until LU-13805 is done.  But it's not terrible to get started on this part of things.

What would be most helpful now is to review the patch series starting with:
https://review.whamcloud.com/c/fs/lustre-release/+/45616

Which still has a bunch of supporting patches that need to land before getting to the main patch(es).  (There are still some bugs with the main patches as well, but we need to get all of the supporting patches in first anyway.)

Comment by Patrick Farrell [ 03/Aug/23 ]

This is a duplicate of LU-13802, and exactly what was discussed in my LUG presentation in May 2023.  It's a good writeup, so maybe we can copy this to that ticket, but this is not a new feature suggestion.  The ability to do LU-13802 is why LU-13805 is being worked on, so let's put the work on those tickets.

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