Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbcDUXo4 (ORCPT ); Thu, 21 Apr 2016 19:44:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35104 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751846AbcDUXo4 (ORCPT ); Thu, 21 Apr 2016 19:44:56 -0400 Date: Thu, 21 Apr 2016 16:44:54 -0700 From: Andrew Morton To: Naoya Horiguchi Cc: Konstantin Khlebnikov , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "Kirill A. Shutemov" Subject: Re: [PATCH] mm/memory-failure: fix race with compound page split/merge Message-Id: <20160421164454.3da1afe01cc4f5adb6b9772c@linux-foundation.org> In-Reply-To: <20160418231551.GA18493@hori1.linux.bs1.fc.nec.co.jp> References: <146097982568.15733.13924990169211134049.stgit@buzz> <20160418231551.GA18493@hori1.linux.bs1.fc.nec.co.jp> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1044 Lines: 30 On Mon, 18 Apr 2016 23:15:52 +0000 Naoya Horiguchi wrote: > # CCed Andrew, Thanks. > On Mon, Apr 18, 2016 at 02:43:45PM +0300, Konstantin Khlebnikov wrote: > > Get_hwpoison_page() must recheck relation between head and tail pages. > > > > Signed-off-by: Konstantin Khlebnikov > > Looks good to me. Without this recheck, the race causes kernel to pin > an irrelevant page, and finally makes kernel crash for refcount mismcach... Thanks. I'll add the above (important!) info to the changelog and cc:stable. > > - return get_page_unless_zero(head); > > + if (get_page_unless_zero(head)) { > > + if (head == compound_head(page)) > > + return 1; > > + > > + pr_info("MCE: %#lx cannot catch tail\n", page_to_pfn(page)); > > Recently Chen Yucong replaced the label "MCE:" with "Memory failure:", > but the resolution is trivial, I think. Yup, that patch is in my (large) backlog. Away at conferences for seven days, receiving 100 actionable emails per day. Give me a few days ;)