[LU-16665] Check whether the page is currently under I/O in ->releasepage Created: 24/Mar/23  Updated: 27/Mar/23

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

Type: Bug Priority: Minor
Reporter: Qian Yingjin Assignee: Qian Yingjin
Resolution: Unresolved Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

We use seqlock to check if a page has been deleted on this inode during the fault process, allowing us to catch an erroneous short read or EIO.

But after the newer kernels (such as Ubuntu 2204) introduces mapping->invalidate_lock, we could get rid of all these seqlock checks (which may have impact on the performance) for the newer kernel.
One blocking is that invalidate_mapping_pages() is called in the kernel without holding this invalidate_lock. The reason is that the newer kernel thought that this function only release pages that are not in use or under I/O.

Thus we need to check whether the current page trying to release is under I/O or not.
we can use LCC ((ll_cl_context) to check in ->releasepage() that whether the current page is under I/O (read path) and belong one read context of a process. we can release the page only when the page is not under I/O or in use.
Or a more coarse grain solution, we can account for an inode the number of processes doing read() and fault(): increase this value when call ll_lcc_add and decrease it when remove the LCC. if this count is larger than 1, we could not release the page...



 Comments   
Comment by Gerrit Updater [ 24/Mar/23 ]

"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50407
Subject: LU-16665 llite: check whether page under I/O in releasepage()
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 889f5797e1a51859ad922eeca52c2905144d263b

Comment by Gerrit Updater [ 27/Mar/23 ]

"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50423
Subject: LU-16665 llite: remove lli_page_inv_lock in newer kernel
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 386f68d03565c58e2cfc67971698892cbd81612e

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