From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by kanga.kvack.org (Postfix) with ESMTP id 7E02C6B0005 for ; Thu, 12 May 2016 05:29:26 -0400 (EDT) Received: by mail-pa0-f70.google.com with SMTP id xm6so97536247pab.3 for ; Thu, 12 May 2016 02:29:26 -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 q6si10661329pfb.220.2016.05.12.02.29.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 12 May 2016 02:29:25 -0700 (PDT) From: Naoya Horiguchi Subject: Re: [PATCH] mm: fix pfn spans two sections in has_unmovable_pages() Date: Thu, 12 May 2016 09:27:43 +0000 Message-ID: <20160512092743.GA1165@hori1.linux.bs1.fc.nec.co.jp> References: <57304B9A.40504@huawei.com> <57305AD8.9090202@suse.cz> <57306038.1070907@huawei.com> In-Reply-To: <57306038.1070907@huawei.com> Content-Language: ja-JP Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <9A74C2AE01358146B0E52D714334A235@gisp.nec.co.jp> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: Xishi Qiu Cc: Vlastimil Babka , Andrew Morton , Mel Gorman , Michal Hocko , David Rientjes , "'Kirill A . Shutemov'" , Joonsoo Kim , Taku Izumi , Alexander Duyck , Johannes Weiner , Linux MM , LKML On Mon, May 09, 2016 at 06:02:32PM +0800, Xishi Qiu wrote: > On 2016/5/9 17:39, Vlastimil Babka wrote: >=20 > > On 05/09/2016 10:34 AM, Xishi Qiu wrote: > >> If the pfn is not aligned to pageblock, the check pfn may access a nex= t > >> pageblcok, and the next pageblock may belong to a next section. Becaus= e > >> struct page has not been alloced in the next section, so kernel panic. > >> > >> I find the caller of has_unmovable_pages() has passed a aligned pfn, s= o it > >> doesn't have this problem. But the earlier kernel version(e.g. v3.10) = has. > >> e.g. echo xxx > /sys/devices/system/memory/soft_offline_page could tri= gger > >> it. The following log is from RHEL v7.1 > >=20 > > I think has_unmovable_pages() is wrong layer where to fix such problem,= as I'll explain below. > >=20 > >> [14111.611492] Stack: > >> [14111.611494] ffffffff8115d952 0000000000000000 01ff880c393ebe40 ffff= 880c7ffd9000 > >> [14111.611500] ffffea0061ffffc0 ffff880c7ffd9068 0000000000000286 0000= 000000000001 > >> [14111.611505] ffff880c393ebe10 ffffffff811c265a 000000000187ffff 0000= 000000000200 > >> [14111.611511] Call Trace: > >> [14111.611516] [] ? has_unmovable_pages+0xd2/0x130 > >> [14111.611521] [] set_migratetype_isolate+0xda/0x170 > >> [14111.611526] [] soft_offline_page+0x9a/0x590 > >> [14111.611530] [] ? _kstrtoull+0x3b/0xa0 > >> [14111.611535] [] store_soft_offline_page+0xaf/0xf0 > >> [14111.611539] [] dev_attr_store+0x18/0x30 > >> [14111.611544] [] sysfs_write_file+0xc6/0x140 > >> [14111.611548] [] vfs_write+0xbd/0x1e0 > >> [14111.611551] [] SyS_write+0x58/0xb0 > >> [14111.611556] [] system_call_fastpath+0x16/0x1b > >> [14111.611559] Code: 66 66 66 90 48 83 e0 fd 0c a0 5d c3 66 2e 0f 1f 8= 4 00 00 00 00 00 48 89 f8 66 66 66 90 48 83 c8 42 0c a0 5d c3 90 66 66 66 6= 6 90 <8b> 07 25 00 c0 00 00 75 02 f3 c3 48 8b 07 f6 c4 80 75 0f 48 81 > >> [14111.611594] RIP [] PageHuge+0x5/0x40 > >> [14111.611598] RSP > >> [14111.611600] CR2: ffffea0062000000 > >> [14111.611604] ---[ end trace 9f780ed1def334c6 ]--- > >> [14111.678586] Kernel panic - not syncing: Fatal exception > >> > >> Signed-off-by: Xishi Qiu > >=20 > > It's not CC'd stable, so how will this patch fix the older kernels? Als= o you should determine which upstream kernel versions are affected, not a R= HEL derivative. > > Also is the current upstream broken or not? > >=20 >=20 > OK, I'll resend it later. The current upstream has not this problem. This is because soft offline has stopped changing migratetype at commit add05cecef80 ("mm: soft-offline: don't free target page in successful page migration") (or v4.1-3344-gadd05cecef80). # And the fix is available in RHEL7.2, but unfortunately not in RHEL7.1. Thanks, Naoya Horiguchi= -- 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