Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755973AbcK2DHX (ORCPT ); Mon, 28 Nov 2016 22:07:23 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:35873 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751765AbcK2DHP (ORCPT ); Mon, 28 Nov 2016 22:07:15 -0500 MIME-Version: 1.0 In-Reply-To: <977b6c8b-2df3-5f4b-0d6c-fe766cf3fae0@intel.com> References: <026b73f6-ca1d-e7bb-766c-4aaeb7071ce6@intel.com> <20161128083715.GA21738@aaronlu.sh.intel.com> <20161128084012.GC21738@aaronlu.sh.intel.com> <977b6c8b-2df3-5f4b-0d6c-fe766cf3fae0@intel.com> From: Linus Torvalds Date: Mon, 28 Nov 2016 19:06:39 -0800 X-Google-Sender-Auth: zBAai85oBzlakOqZlNcFKGtocPU Message-ID: Subject: Re: [PATCH] mremap: move_ptes: check pte dirty after its removal To: Aaron Lu Cc: Linux Memory Management List , Dave Hansen , Andrew Morton , "Kirill A. Shutemov" , Huang Ying , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 720 Lines: 21 On Mon, Nov 28, 2016 at 6:57 PM, Aaron Lu wrote: > > Here is a fix patch, sorry for the trouble. I don't think you tested this one.. You've now essentially reverted 5d1904204c99 entirely by making the new force_flush logic a no-op. > + pmd = pmdp_huge_get_and_clear(mm, old_addr, old_pmd); > if (pmd_present(*old_pmd) && pmd_dirty(*old_pmd)) > force_flush = true; You need to be testing "pmd", not "*old_pmd". Because now "*old_pmd" will be zeroes. > if (pte_present(*old_pte) && pte_dirty(*old_pte)) > force_flush = true; Similarly here. You need to check "pte", not "*old_pte". Linus