From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BAABC3279B for ; Mon, 2 Jul 2018 06:18:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 124F125588 for ; Mon, 2 Jul 2018 06:18:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 124F125588 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=users.sourceforge.jp Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753361AbeGBGSz (ORCPT ); Mon, 2 Jul 2018 02:18:55 -0400 Received: from mail01.asahi-net.or.jp ([202.224.55.13]:47793 "EHLO mail01.asahi-net.or.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753247AbeGBGSs (ORCPT ); Mon, 2 Jul 2018 02:18:48 -0400 X-Greylist: delayed 471 seconds by postgrey-1.27 at vger.kernel.org; Mon, 02 Jul 2018 02:18:48 EDT Received: from h61-195-96-97.vps.ablenet.jp (h61-195-96-97.vps.ablenet.jp [61.195.96.97]) (Authenticated sender: PQ4Y-STU) by mail01.asahi-net.or.jp (Postfix) with ESMTPA id 5AA657D85C; Mon, 2 Jul 2018 15:09:42 +0900 (JST) Received: from yo-satoh-debian.ysato.ml (ZM028236.ppp.dion.ne.jp [222.8.28.236]) by h61-195-96-97.vps.ablenet.jp (Postfix) with ESMTPSA id AB5A724006D; Mon, 2 Jul 2018 15:09:41 +0900 (JST) Date: Mon, 02 Jul 2018 15:09:38 +0900 Message-ID: <87o9fqp3rx.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: Mike Rapoport Cc: Rob Herring , mhocko@kernel.org, linux-mm@kvack.org, Johannes Weiner , Andrew Morton , "open list:GENERIC INCLUDE/ASM HEADER FILES" , "linux-kernel@vger.kernel.org" Subject: Re: h8300: BUG: Bad page state in process swapper (was: Re: why do we still need bootmem allocator?) In-Reply-To: <20180701122245.GA28969@rapoport-lnx> References: <20180625140754.GB29102@dhcp22.suse.cz> <20180627112655.GD4291@rapoport-lnx> <20180627160206.GB19182@rapoport-lnx> <20180701122245.GA28969@rapoport-lnx> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 01 Jul 2018 21:22:46 +0900, Mike Rapoport wrote: > > (added Yoshinori Sato, here's the beginning of the discussion: > https://lore.kernel.org/lkml/20180625140754.GB29102@dhcp22.suse.cz/) > > On Wed, Jun 27, 2018 at 07:02:06PM +0300, Mike Rapoport wrote: > > On Wed, Jun 27, 2018 at 07:33:55AM -0600, Rob Herring wrote: > > > On Wed, Jun 27, 2018 at 5:27 AM Mike Rapoport wrote: > > > > > > > > I've tried running the current upstream on h8300 gdb simulator and it > > > > failed: > > > > > > It seems my patch[1] is still not applied. The maintainer said he applied it. > > > > I've applied it manually. Without it unflatten_and_copy_device_tree() fails > > to allocate memory. It indeed can be fixed with moving bootmem_init() > > before, as you've noted in the commit message. > > > > I'll try to dig deeper into it. > > > > > > [ 0.000000] BUG: Bad page state in process swapper pfn:00004 > > > > [ 0.000000] page:007ed080 count:0 mapcount:-128 mapping:00000000 > > > > index:0x0 > > > > [ 0.000000] flags: 0x0() > > > > [ 0.000000] raw: 00000000 0040bdac 0040bdac 00000000 00000000 00000002 > > > > ffffff7f 00000000 > > > > [ 0.000000] page dumped because: nonzero mapcount > > > > ---Type to continue, or q to quit--- > > > > [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.18.0-rc2+ #50 > > > > [ 0.000000] Stack from 00401f2c: > > > > [ 0.000000] 00401f2c 001116cb 007ed080 00401f40 000e20e6 00401f54 > > > > 0004df14 00000000 > > > > [ 0.000000] 007ed080 007ed000 00401f5c 0004df8c 00401f90 0004e982 > > > > 00000044 00401fd1 > > > > [ 0.000000] 007ed000 007ed000 00000000 00000004 00000008 00000000 > > > > 00000003 00000011 > > > > [ 0.000000] > > > > [ 0.000000] Call Trace: > > > > [ 0.000000] [<000e20e6>] [<0004df14>] [<0004df8c>] [<0004e982>] > > > > [ 0.000000] [<00051a28>] [<00001000>] [<00000100>] > > > > [ 0.000000] Disabling lock debugging due to kernel taint > > > > > > > > With v4.13 I was able to get to "no valid init found". > > > > > > > > I had a quick look at h8300 memory initialization and it seems it has > > > > starting pfn set to 0 while fdt defines memory start at 4M. > > > > > > Perhaps there's another issue. > > In my setup this is caused by __ffs() clobbering start pfn in > nobootmem.c::__free_pages_memory(). > > If I change the __ffs() implementation from the inline assembly to generic > bitops everything is fine. OK. Current bitops.h implementations have some dependencies on gcc's behavior. I think that it is necessary to modify it generically so that it can correspond to the new gcc. Please wait until it gets fixed. > I'm using gcc 8.1.0 from [1] and gdb 8.1.0.20180625-git > > [1] http://cdn.kernel.org/pub/tools/crosstool/files/bin/x86_64/ > > > -- > Sincerely yours, > -- Yosinori Sato