On Sun, Apr 13, 2014 at 7:51 PM, Minchan Kim <minchan@xxxxxxxxxx> wrote: > On Fri, Apr 11, 2014 at 01:15:40PM -0700, John Stultz wrote: >> @@ -3643,6 +3644,8 @@ static int handle_pte_fault(struct mm_struct *mm, >> >> entry = *pte; >> if (!pte_present(entry)) { >> + swp_entry_t mvolatile_entry; >> + >> if (pte_none(entry)) { >> if (vma->vm_ops) { >> if (likely(vma->vm_ops->fault)) >> @@ -3652,6 +3655,11 @@ static int handle_pte_fault(struct mm_struct *mm, >> return do_anonymous_page(mm, vma, address, >> pte, pmd, flags); >> } >> + >> + mvolatile_entry = pte_to_swp_entry(entry); >> + if (unlikely(is_purged_entry(mvolatile_entry))) >> + return VM_FAULT_SIGBUS; >> + > > There is no pte lock so that is_purged_entry isn't safe so if race happens, > do_swap_page could have a problem so it would be better to handle it > do_swap_page with pte lock because we used swp_pte to indicate purged pte. > > I tried to solve it while we were in Napa(you could remember I sent > crap patchset to you privately but failed to fix and I still didn't get > a time to fix it :( ) but I'd like to inform this problem. Thanks for the review and the reminder! I'll move the check appropriately. thanks -john -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>