+ mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read-v4.patch added to -mm tree

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

 



The patch titled
     Subject: mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read-v4
has been added to the -mm tree.  Its filename is
     mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read-v4.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read-v4.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read-v4.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: Mauricio Faria de Oliveira <mfo@xxxxxxxxxxxxx>
Subject: mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read-v4

v4: - fixed Fixes: tag to first support, after tests on v4.5;
      updated commit message/reproducer section with results.
    - tested on v5.17-rc3 and v4.5.
    - shorten comment line; remove inner braces in the check.
      (Thanks: Christoph Hellwig <hch@xxxxxxxxxxxxx>)
    - clarify comment about __remove_mapping()
      (Thanks: Yu Zhao <yuzhao@xxxxxxxxxx>)

Link: https://lkml.kernel.org/r/20220209202659.183418-1-mfo@xxxxxxxxxxxxx
Fixes: 854e9ed09ded ("mm: support madvise(MADV_FREE)")
Signed-off-by: Mauricio Faria de Oliveira <mfo@xxxxxxxxxxxxx>
Reviewed-by: "Huang, Ying" <ying.huang@xxxxxxxxx>
Cc: Dan Hill <daniel.hill@xxxxxxxxxxxxx>
Cc: Dan Streetman <dan.streetman@xxxxxxxxxxxxx>
Cc: Dongdong Tao <dongdong.tao@xxxxxxxxxxxxx>
Cc: Gavin Guo <gavin.guo@xxxxxxxxxxxxx>
Cc: Gerald Yang <gerald.yang@xxxxxxxxxxxxx>
Cc: Heitor Alves de Siqueira <halves@xxxxxxxxxxxxx>
Cc: Ioanna Alifieraki <ioanna-maria.alifieraki@xxxxxxxxxxxxx>
Cc: Jay Vosburgh <jay.vosburgh@xxxxxxxxxxxxx>
Cc: Matthew Ruffell <matthew.ruffell@xxxxxxxxxxxxx>
Cc: Miaohe Lin <linmiaohe@xxxxxxxxxx>
Cc: Minchan Kim <minchan@xxxxxxxxxx>
Cc: Ponnuvel Palaniyappan <ponnuvel.palaniyappan@xxxxxxxxxxxxx>
Cc: Yang Shi <shy828301@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/rmap.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/mm/rmap.c~mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read-v4
+++ a/mm/rmap.c
@@ -1614,16 +1614,16 @@ static bool try_to_unmap_one(struct page
 				map_count = page_mapcount(page);
 
 				/*
-				 * Order reads for page refcount and dirty flag;
-				 * see __remove_mapping().
+				 * Order reads for page refcount and dirty flag
+				 * (see comments in __remove_mapping()).
 				 */
 				smp_rmb();
 
 				/*
-				 * The only page refs must be from the isolation
-				 * plus one or more rmap's (dropped by discard:).
+				 * The only page refs must be one from isolation
+				 * plus the rmap(s) (dropped by discard:).
 				 */
-				if ((ref_count == 1 + map_count) &&
+				if (ref_count == 1 + map_count &&
 				    !PageDirty(page)) {
 					/* Invalidate as we cleared the pte */
 					mmu_notifier_invalidate_range(mm,
_

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

mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read.patch
mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read-v4.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