[LU-15516] Simplify mmap readahead logic & remove clustered reads Created: 03/Feb/22  Updated: 04/Feb/22

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

Type: Improvement Priority: Minor
Reporter: Patrick Farrell Assignee: Patrick Farrell
Resolution: Unresolved Votes: 0
Labels: None

Rank (Obsolete): 9223372036854775807

 Description   

The addition of clustered reads created a huge amount of mmap specific readahead logic, most of which doesn't work well.  mmap readahead should not be a separate consideration from regular readahead logic.

The clustered readahead code is particularly problematic:

Here's what the clustered code actually does.

It does 'blobs' of reading around the point of a read.
Ideally, we'd do this when we couldn't detect a pattern, but the clustered reads code just does this, effectively disabling normal readahead for mmap.

This means if there isn't any pattern, it can speed things up a lot

But if there's any pattern, this is worse than following it.  And there is almost always a pattern.

It's based on a weird idea about 'clustered reads', but there's zero reason to think those exist - databases don't work like that and there's no justification offered.
Databases do sequential forward, sequential back, semi-random forward, semi-random back, and full random.  There's no clustered behavior as described, ie, 'read randomly in an area for a bit then move to another area'.

It makes sense, when we can't detect a pattern, to consider this 'just read some pages' approach, since reading a few more pages is a great idea in most cases.

But this is a separate thing and a very poor excuse for breaking mmap reads so badly.

It also shouldn't be separate logic - if this makes sense for mmap, it makes sense for regular reads.

LU-14917 tries to hack around this by creating an even more complicated logic path to keep this clustered reads.  We're better off removing them and considering adding them back in a future patch, when they can be used for both regular and mmap reads.

This LU will do that, and will also standardize/unify the readahead invocations for mmap reads and regular reads.



 Comments   
Comment by Gerrit Updater [ 04/Feb/22 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46457
Subject: LU-15516 llite: Remove clustered read code
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 88f970ab2e192d1190391609110b0d84f297b86e

Comment by Gerrit Updater [ 04/Feb/22 ]

"Patrick Farrell <pfarrell@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46458
Subject: LU-15516 llite: unify readahead logic
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 0f6931ba354df61971c18ffeeca165de92869206

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