The patch titled Subject: mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read-v4 has been removed from the -mm tree. Its filename was mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read-v4.patch This patch was dropped because it was folded into mm-fix-race-between-madv_free-reclaim-and-blkdev-direct-io-read.patch ------------------------------------------------------ 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 @@ -1645,16 +1645,16 @@ static bool try_to_unmap_one(struct foli map_count = folio_mapcount(folio); /* - * 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 && !folio_test_dirty(folio)) { /* 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