Skip to contentSkip to conversation

mm-dont-bother-dropping-mmap_sem-for-zero-size-readahead.patch removed from -mm tree

merged [email protected] 1 participant 1 message Apr 3, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/filemap.c: don't bother dropping mmap_sem for zero size readahead
has been removed from the -mm tree. Its filename was
mm-dont-bother-dropping-mmap_sem-for-zero-size-readahead.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Jan Kara <[email protected]>
Subject: mm/filemap.c: don't bother dropping mmap_sem for zero size readahead

When handling a page fault, we drop mmap_sem to start async readahead so that we don't block on IO submission with mmap_sem held. However there's no point to drop mmap_sem in case readahead is disabled. Handle that case to avoid pointless dropping of mmap_sem and retrying the fault. This was actually reported to block mlockall(MCL_CURRENT) indefinitely.

---

 mm/filemap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/filemap.c renamed from mm/filemap.c~mm-dont-bother-dropping-mmap_sem-for-zero-size-readahead +1 -1
@@ -2416,7 +2416,7 @@ static struct file *do_async_mmap_readah
 	pgoff_t offset = vmf->pgoff;
 
 	/* If we don't want any read-ahead, don't bother */
-	if (vmf->vma->vm_flags & VM_RAND_READ)
+	if (vmf->vma->vm_flags & VM_RAND_READ || !ra->ra_pages)
 		return fpin;
 	if (ra->mmap_miss > 0)
 		ra->mmap_miss--;

_

Patches currently in -mm which might be from [email protected] are