+ mm-remove-redundant-test-from-find_get_pages_contig.patch added to -mm tree

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

 



The patch titled
     Subject: mm/filemap.c: remove redundant test from find_get_pages_contig
has been added to the -mm tree.  Its filename is
     mm-remove-redundant-test-from-find_get_pages_contig.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-remove-redundant-test-from-find_get_pages_contig.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-remove-redundant-test-from-find_get_pages_contig.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: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Subject: mm/filemap.c: remove redundant test from find_get_pages_contig

After we establish a reference on the page, we check the pointer continues
to be in the correct position in i_pages.  There's no need to check the
page->mapping or page->index afterwards; if those can change after we've
got the reference, they can change after we return the page to the caller.

Link: http://lkml.kernel.org/r/20190107200224.13260-1-willy@xxxxxxxxxxxxx
Signed-off-by: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Cc: Hugh Dickins <hughd@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/filemap.c |   10 ----------
 1 file changed, 10 deletions(-)

--- a/mm/filemap.c~mm-remove-redundant-test-from-find_get_pages_contig
+++ a/mm/filemap.c
@@ -1837,16 +1837,6 @@ unsigned find_get_pages_contig(struct ad
 		if (unlikely(page != xas_reload(&xas)))
 			goto put_page;
 
-		/*
-		 * must check mapping and index after taking the ref.
-		 * otherwise we can get both false positives and false
-		 * negatives, which is just confusing to the caller.
-		 */
-		if (!page->mapping || page_to_pgoff(page) != xas.xa_index) {
-			put_page(page);
-			break;
-		}
-
 		pages[ret] = page;
 		if (++ret == nr_pages)
 			break;
_

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

initialise-mmu_notifier_range-correctly.patch
mm-remove-sysctl_extfrag_handler.patch
mm-remove-redundant-test-from-find_get_pages_contig.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