From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932768AbbELJsK (ORCPT ); Tue, 12 May 2015 05:48:10 -0400 Received: from TYO201.gate.nec.co.jp ([210.143.35.51]:33302 "EHLO tyo201.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932265AbbELJsD convert rfc822-to-8bit (ORCPT ); Tue, 12 May 2015 05:48:03 -0400 From: Naoya Horiguchi To: Andrew Morton , Andi Kleen CC: Tony Luck , "Kirill A. Shutemov" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "Naoya Horiguchi" Subject: [PATCH 4/4] mm/memory-failure: me_huge_page() does nothing for thp Thread-Topic: [PATCH 4/4] mm/memory-failure: me_huge_page() does nothing for thp Thread-Index: AQHQjJiQigA819mYykan/Nnf1GfC3A== Date: Tue, 12 May 2015 09:46:47 +0000 Message-ID: <1431423998-1939-5-git-send-email-n-horiguchi@ah.jp.nec.com> References: <1431423998-1939-1-git-send-email-n-horiguchi@ah.jp.nec.com> In-Reply-To: <1431423998-1939-1-git-send-email-n-horiguchi@ah.jp.nec.com> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.128.101.5] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org memory_failure() is supposed not to handle thp itself, but to split it. But if something were wrong and page_action() were called on thp, me_huge_page() (action routine for hugepages) should be better to take no action, rather than to take wrong action prepared for hugetlb (which triggers BUG_ON().) This change is for potential problems, but makes sense to me because thp is an actively developing feature and this code path can be open in the future. Signed-off-by: Naoya Horiguchi --- mm/memory-failure.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git v4.1-rc3.orig/mm/memory-failure.c v4.1-rc3/mm/memory-failure.c index 918256de15bf..6b5bdc575496 100644 --- v4.1-rc3.orig/mm/memory-failure.c +++ v4.1-rc3/mm/memory-failure.c @@ -743,6 +743,10 @@ static int me_huge_page(struct page *p, unsigned long pfn) { int res = 0; struct page *hpage = compound_head(p); + + if (!PageHuge(hpage)) + return MF_DELAYED; + /* * We can safely recover from error on free or reserved (i.e. * not in-use) hugepage by dequeuing it from freelist. -- 2.1.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com [209.85.214.174]) by kanga.kvack.org (Postfix) with ESMTP id F2D1A6B006C for ; Tue, 12 May 2015 05:47:58 -0400 (EDT) Received: by obbkp3 with SMTP id kp3so1161500obb.3 for ; Tue, 12 May 2015 02:47:58 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp. [210.143.35.51]) by mx.google.com with ESMTPS id wd5si8570693obc.21.2015.05.12.02.47.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 12 May 2015 02:47:58 -0700 (PDT) From: Naoya Horiguchi Subject: [PATCH 4/4] mm/memory-failure: me_huge_page() does nothing for thp Date: Tue, 12 May 2015 09:46:47 +0000 Message-ID: <1431423998-1939-5-git-send-email-n-horiguchi@ah.jp.nec.com> References: <1431423998-1939-1-git-send-email-n-horiguchi@ah.jp.nec.com> In-Reply-To: <1431423998-1939-1-git-send-email-n-horiguchi@ah.jp.nec.com> Content-Language: ja-JP Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Andi Kleen Cc: Tony Luck , "Kirill A. Shutemov" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Naoya Horiguchi memory_failure() is supposed not to handle thp itself, but to split it. But if something were wrong and page_action() were called on thp, me_huge_page(= ) (action routine for hugepages) should be better to take no action, rather than to take wrong action prepared for hugetlb (which triggers BUG_ON().) This change is for potential problems, but makes sense to me because thp is an actively developing feature and this code path can be open in the future= . Signed-off-by: Naoya Horiguchi --- mm/memory-failure.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git v4.1-rc3.orig/mm/memory-failure.c v4.1-rc3/mm/memory-failure.c index 918256de15bf..6b5bdc575496 100644 --- v4.1-rc3.orig/mm/memory-failure.c +++ v4.1-rc3/mm/memory-failure.c @@ -743,6 +743,10 @@ static int me_huge_page(struct page *p, unsigned long = pfn) { int res =3D 0; struct page *hpage =3D compound_head(p); + + if (!PageHuge(hpage)) + return MF_DELAYED; + /* * We can safely recover from error on free or reserved (i.e. * not in-use) hugepage by dequeuing it from freelist. --=20 2.1.0 -- 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