The patch titled Subject: mm-thp-fix-madv_dontneed-vs-migrate_misplaced_transhuge_page-race-condition-fix has been added to the -mm tree. Its filename is mm-thp-fix-madv_dontneed-vs-migrate_misplaced_transhuge_page-race-condition-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-thp-fix-madv_dontneed-vs-migrate_misplaced_transhuge_page-race-condition-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-thp-fix-madv_dontneed-vs-migrate_misplaced_transhuge_page-race-condition-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: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Subject: mm-thp-fix-madv_dontneed-vs-migrate_misplaced_transhuge_page-race-condition-fix reflow comment to 80 cols, fix grammar and typo (beacuse) Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/migrate.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) --- a/mm/migrate.c~mm-thp-fix-madv_dontneed-vs-migrate_misplaced_transhuge_page-race-condition-fix +++ a/mm/migrate.c @@ -2041,16 +2041,15 @@ int migrate_misplaced_transhuge_page(str flush_cache_range(vma, mmun_start, mmun_end); page_add_anon_rmap(new_page, vma, mmun_start, true); /* - * At this point the pmd is numa/protnone (i.e. non present) - * and the TLB has already been flushed globally. So no TLB - * can be currently caching this non present pmd mapping. - * There's no need of clearing the pmd before doing - * set_pmd_at(), nor to flush the TLB after - * set_pmd_at(). Clearing the pmd here would introduce a race - * condition against MADV_DONTNEED, beacuse MADV_DONTNEED only - * holds the mmap_sem for reading. If the pmd is set to NULL - * at any given time, MADV_DONTNEED won't wait on the pmd lock - * and it'll skip clearing this pmd. + * At this point the pmd is numa/protnone (i.e. non present) and the TLB + * has already been flushed globally. So no TLB can be currently + * caching this non present pmd mapping. There's no need to clear the + * pmd before doing set_pmd_at(), nor to flush the TLB after + * set_pmd_at(). Clearing the pmd here would introduce a race + * condition against MADV_DONTNEED, because MADV_DONTNEED only holds the + * mmap_sem for reading. If the pmd is set to NULL at any given time, + * MADV_DONTNEED won't wait on the pmd lock and it'll skip clearing this + * pmd. */ set_pmd_at(mm, mmun_start, pmd, entry); update_mmu_cache_pmd(vma, address, &entry); _ Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are arm-arch-arm-include-asm-pageh-needs-personalityh.patch fix-clusters-leak-in-ocfs2_defrag_extent-fix.patch mm.patch mmpage_alloc-pf_wq_worker-threads-must-sleep-at-should_reclaim_retry-fix.patch sched-loadavg-consolidate-load_int-load_frac-calc_load-fix.patch mm-workingset-add-vmstat-counter-for-shadow-nodes-fix.patch mm-workingset-add-vmstat-counter-for-shadow-nodes-fix-fix.patch mm-mremap-downgrade-mmap_sem-to-read-when-shrinking-fix.patch mm-brk-downgrade-mmap_sem-to-read-when-shrinking-fix.patch memory_hotplug-free-pages-as-higher-order-fix.patch mm-calculate-deferred-pages-after-skipping-mirrored-memory-fix.patch mm-gup_benchmark-time-put_page-fix.patch tools-gup_benchmark-allow-user-specified-file-fix.patch mm-thp-fix-madv_dontneed-vs-migrate_misplaced_transhuge_page-race-condition-fix.patch list_lru-prefetch-neighboring-list-entries-before-acquiring-lock-fix.patch lib-bitmapc-fix-remaining-space-computation-in-bitmap_print_to_pagebuf-fix.patch lib-bitmapc-fix-remaining-space-computation-in-bitmap_print_to_pagebuf-fix-fix.patch ipc-allow-boot-time-extension-of-ipcmni-from-32k-to-8m-checkpatch-fixes.patch linux-next-rejects.patch memblock-stop-using-implicit-alignement-to-smp_cache_bytes-checkpatch-fixes.patch kernel-forkc-export-kernel_thread-to-modules.patch slab-leaks3-default-y.patch