+ filemap-drop-the-mmap_sem-for-all-blocking-operations-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: filemap-drop-the-mmap_sem-for-all-blocking-operations-fix
has been added to the -mm tree.  Its filename is
     filemap-drop-the-mmap_sem-for-all-blocking-operations-fix.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/filemap-drop-the-mmap_sem-for-all-blocking-operations-fix.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/filemap-drop-the-mmap_sem-for-all-blocking-operations-fix.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx>
Subject: filemap-drop-the-mmap_sem-for-all-blocking-operations-fix

Here's a fixup for "filemap: drop the mmap_sem for all blocking operations".

do_sync_mmap_readahead() drops mmap_sem now, so by the time of
dereferencing vmf->vma for count_memcg_event_mm() the VMA can be gone.

Link: http://lkml.kernel.org/r/20181228235106.okk3oastsnpxusxs@kshutemo-mobl1
Cc: Josef Bacik <josef@xxxxxxxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Dave Chinner <david@xxxxxxxxxxxxx>
Cc: Jan Kara <jack@xxxxxxx>
Cc: Rik van Riel <riel@xxxxxxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---


--- a/mm/filemap.c~filemap-drop-the-mmap_sem-for-all-blocking-operations-fix
+++ a/mm/filemap.c
@@ -2553,10 +2553,10 @@ vm_fault_t filemap_fault(struct vm_fault
 		fpin = do_async_mmap_readahead(vmf, page);
 	} else if (!page) {
 		/* No page in the page cache at all */
-		fpin = do_sync_mmap_readahead(vmf);
 		count_vm_event(PGMAJFAULT);
 		count_memcg_event_mm(vmf->vma->vm_mm, PGMAJFAULT);
 		ret = VM_FAULT_MAJOR;
+		fpin = do_sync_mmap_readahead(vmf);
 retry_find:
 		page = pagecache_get_page(mapping, offset,
 					  FGP_CREAT|FGP_FOR_MMAP,
_

Patches currently in -mm which might be from kirill@xxxxxxxxxxxxx are

filemap-drop-the-mmap_sem-for-all-blocking-operations-fix.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux