Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp580641imm; Tue, 5 Jun 2018 00:39:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJP9/CZ0RDSwmffgST3XiTBbOB2ipEp3kZEYl6h5aao/wOw4LagDy/RKfTpVwM9otFPteDr X-Received: by 2002:a62:2044:: with SMTP id g65-v6mr7595395pfg.40.1528184353390; Tue, 05 Jun 2018 00:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528184353; cv=none; d=google.com; s=arc-20160816; b=WdfwIU4dSjICn2XGWcC755USpx0qsPbM+V+PpWR0eGIIBo8PoOg9mSt21IpfiiL4sQ crdQkCsU8wx4rA+LxV1Xh4eMN+zS/6OmTRg67NSguNRnEhRh5oI9+txwChS2oPLEi+Mi 1QbyHngLrHD+UsRLEnKqRVmb8JhYlPI0MJ5i7uRU8cxKkmEo7EIV5LweVPWpNbzX4mHd KfLWteXlqoeewONjvvDbJnmrCHH26efuZEs1GUHIdUpGaGYZUpmXE8yJ+/FSpqxs8XLn 6IoWMXxHZx6/DE+dzIOXt5bXjsMBA4aXUsmHhKilDI4zQw8qnPZ4YVTQTdlz0TI3+63V ErEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=4057SM3mYPEzPX2kQ0IM4jA0eY9VL5LPgvIdLe3yBoU=; b=QRxZfC47Msu6vqM/7Og7EZUmtKPi2ydVF0F+K7dn0m5MkcmlPIha/KKOPq9RuFY2om 00vEfmzhIze69O7zDPQE8HgSNMKVcnWiMPjfVigujLNZJQ65IoJPHmGdKjAT2U+DDez4 324EXNLveHTfTGGp2qSe2QAgUJrsemACfU5zTAwJ6fMLIog50/oVZ/DHQJNwEcD01tx3 wCwERl2+RKrBb2Rxhmzr9hXf/iQh+0vQtiY4V0NK4CiRRZNY3k1rCqs+rZdTZ/iCXKFk o6cLo5M1et2k424dWH88jm0ekxMPLYVG/7YhVjl+WsDpTzNAL8YCg3mlx52HfdWQWiVG +hiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 189-v6si23336721pfy.293.2018.06.05.00.38.58; Tue, 05 Jun 2018 00:39:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751839AbeFEHiD convert rfc822-to-8bit (ORCPT + 99 others); Tue, 5 Jun 2018 03:38:03 -0400 Received: from tyo162.gate.nec.co.jp ([114.179.232.162]:36968 "EHLO tyo162.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751619AbeFEHiC (ORCPT ); Tue, 5 Jun 2018 03:38:02 -0400 Received: from mailgate01.nec.co.jp ([114.179.233.122]) by tyo162.gate.nec.co.jp (8.15.1/8.15.1) with ESMTPS id w557bT0r022083 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 Jun 2018 16:37:29 +0900 Received: from mailsv01.nec.co.jp (mailgate-v.nec.co.jp [10.204.236.94]) by mailgate01.nec.co.jp (8.15.1/8.15.1) with ESMTP id w557bTbg019883; Tue, 5 Jun 2018 16:37:29 +0900 Received: from mail01b.kamome.nec.co.jp (mail01b.kamome.nec.co.jp [10.25.43.2]) by mailsv01.nec.co.jp (8.15.1/8.15.1) with ESMTP id w557ZLYw015596; Tue, 5 Jun 2018 16:37:29 +0900 Received: from bpxc99gp.gisp.nec.co.jp ([10.38.151.148] [10.38.151.148]) by mail01b.kamome.nec.co.jp with ESMTP id BT-MMP-935544; Tue, 5 Jun 2018 16:35:02 +0900 Received: from BPXM23GP.gisp.nec.co.jp ([10.38.151.215]) by BPXC20GP.gisp.nec.co.jp ([10.38.151.148]) with mapi id 14.03.0319.002; Tue, 5 Jun 2018 16:35:01 +0900 From: Naoya Horiguchi To: Matthew Wilcox CC: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton , Michal Hocko , "mingo@kernel.org" , "dan.j.williams@intel.com" , Huang Ying Subject: Re: kernel panic in reading /proc/kpageflags when enabling RAM-simulated PMEM Thread-Topic: kernel panic in reading /proc/kpageflags when enabling RAM-simulated PMEM Thread-Index: AQHT/GeymmpDVR1XWE69lshFJtmzcqRQRpEAgABpKgA= Date: Tue, 5 Jun 2018 07:35:01 +0000 Message-ID: <20180605073500.GA23766@hori1.linux.bs1.fc.nec.co.jp> References: <20180605005402.GA22975@hori1.linux.bs1.fc.nec.co.jp> <20180605011836.GA32444@bombadil.infradead.org> In-Reply-To: <20180605011836.GA32444@bombadil.infradead.org> Accept-Language: en-US, ja-JP Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.51.8.80] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <6DF55117BC2F334FAC63EA0F79B38338@gisp.nec.co.jp> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 04, 2018 at 06:18:36PM -0700, Matthew Wilcox wrote: > On Tue, Jun 05, 2018 at 12:54:03AM +0000, Naoya Horiguchi wrote: > > Reproduction precedure is like this: > > - enable RAM based PMEM (with a kernel boot parameter like memmap=1G!4G) > > - read /proc/kpageflags (or call tools/vm/page-types with no arguments) > > (- my kernel config is attached) > > > > I spent a few days on this, but didn't reach any solutions. > > So let me report this with some details below ... > > > > In the critial page request, stable_page_flags() is called with an argument > > page whose ->compound_head was somehow filled with '0xffffffffffffffff'. > > And compound_head() returns (struct page *)(head - 1), which explains the > > address 0xfffffffffffffffe in the above message. > > Hm. compound_head shares with: > > struct list_head lru; > struct list_head slab_list; /* uses lru */ > struct { /* Partial pages */ > struct page *next; > unsigned long _compound_pad_1; /* compound_head */ > unsigned long _pt_pad_1; /* compound_head */ > struct dev_pagemap *pgmap; > struct rcu_head rcu_head; > > None of them should be -1. > > > It seems that this kernel panic happens when reading kpageflags of pfn range > > [0xbffd7, 0xc0000), which coresponds to a 'reserved' range. > > > > [ 0.000000] user-defined physical RAM map: > > [ 0.000000] user: [mem 0x0000000000000000-0x000000000009fbff] usable > > [ 0.000000] user: [mem 0x000000000009fc00-0x000000000009ffff] reserved > > [ 0.000000] user: [mem 0x00000000000f0000-0x00000000000fffff] reserved > > [ 0.000000] user: [mem 0x0000000000100000-0x00000000bffd6fff] usable > > [ 0.000000] user: [mem 0x00000000bffd7000-0x00000000bfffffff] reserved > > [ 0.000000] user: [mem 0x00000000feffc000-0x00000000feffffff] reserved > > [ 0.000000] user: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved > > [ 0.000000] user: [mem 0x0000000100000000-0x000000013fffffff] persistent (type 12) > > > > So I guess 'memmap=' parameter might badly affect the memory initialization process. > > > > This problem doesn't reproduce on v4.17, so some pre-released patch introduces it. > > I hope this info helps you find the solution/workaround. > > Can you try bisecting this? It could be one of my patches to reorder struct > page, or it could be one of Pavel's deferred page initialisation patches. > Or something else ;-) Thank you for the comment. I'm trying bisecting now, let you know the result later. And I found that my statement "not reproduce on v4.17" was wrong (I used different kvm guests, which made some different test condition and misguided me), this seems an older (at least < 4.15) bug. Thanks, Naoya Horiguchi