@@ -418,15 +418,22 @@ static vm_fault_t ll_fault(struct vm_fault *vmf)
!(result & (VM_FAULT_RETRY | VM_FAULT_ERROR | VM_FAULT_LOCKED))) {
struct page *vmpage = vmf->page;
- /* check if this page has been truncated */
+ /* lock the page, then check if this page has been truncated
+ * or deleted from Lustre and retry if so
+ */
lock_page(vmpage);
- if (unlikely(!vmpage->mapping)) { /* unlucky */
+ if (unlikely(vmpage->mapping == NULL) ||
+ vmpage->private == 0) { /* unlucky */
unlock_page(vmpage);
put_page(vmpage);
vmf->page = NULL;
if (!printed && ++count > 16) {
- CWARN("the page is under heavy contention, maybe your app(%s) needs revising :-)\n",
+ struct inode *inode = file_inode(vma->vm_file);
+
+ CWARN("%s: FID "DFID" under heavy mmap contention by '%s', consider revising IO pattern\n",
+ ll_i2sbi(inode)->ll_fsname,
+ PFID(&ll_i2info(inode)->lli_fid),
current->comm);
printed = true;
}