Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932685AbcK2DWY (ORCPT ); Mon, 28 Nov 2016 22:22:24 -0500 Received: from mga06.intel.com ([134.134.136.31]:25988 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754142AbcK2DWQ (ORCPT ); Mon, 28 Nov 2016 22:22:16 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,714,1473145200"; d="scan'208";a="36718950" Date: Tue, 29 Nov 2016 11:22:12 +0800 From: Aaron Lu To: Linus Torvalds Cc: Linux Memory Management List , Dave Hansen , Andrew Morton , "Kirill A. Shutemov" , Huang Ying , Linux Kernel Mailing List Subject: Re: [PATCH] mremap: move_ptes: check pte dirty after its removal Message-ID: <20161129032212.GA1727@aaronlu.sh.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1166 Lines: 35 On Mon, Nov 28, 2016 at 07:06:39PM -0800, Linus Torvalds wrote: > 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. Right, I just did a build test. Now I'm doing more tests, sorry for being careless. Regards, Aaron > > > + 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 > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org