From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 22 Nov 2017 09:43:34 +0000 From: Andrea Reale To: Zi Yan Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Naoya Horiguchi , =?utf-8?B?SsOpcsO0bWU=?= Glisse , stable@vger.kernel.org Subject: Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page() References: <20171121021855.50525-1-zi.yan@sent.com> <20171121141213.89db86bfbd75c22fc0209990@linux-foundation.org> <73A54AD9-33E0-4C82-8C9F-6E1786ED6132@cs.rutgers.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <73A54AD9-33E0-4C82-8C9F-6E1786ED6132@cs.rutgers.edu> Message-Id: <20171122094333.GA24826@samekh> Sender: owner-linux-mm@kvack.org List-ID: On Tue 21 Nov 2017, 17:35, Zi Yan wrote: > On 21 Nov 2017, at 17:12, Andrew Morton wrote: > > > On Mon, 20 Nov 2017 21:18:55 -0500 Zi Yan wrote: > > > >> This patch fixes it by only calling prep_transhuge_page() when we are > >> certain that the target page is THP. > > > > What are the user-visible effects of the bug? > > By inspecting the code, if called on a non-THP, prep_transhuge_page() will > 1) change the value of the mapping of (page + 2), since it is used for THP deferred list; > 2) change the lru value of (page + 1), since it is used for THP’s dtor. > > Both can lead to data corruption of these two pages. Pragmatically and from the point of view of the memory_hotplug subsys, the effect is a kernel crash when pages are being migrated during a memory hot remove offline and migration target pages are found in a bad state. Best, Andrea -- 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