Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3491452imm; Sun, 1 Jul 2018 23:22:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLXS5/wJQW5TeF0mRISltljm2lcUykQyYCAhCaD+9chycVetOpYuFHXRvelawAAZLnRK8GA X-Received: by 2002:a17:902:2864:: with SMTP id e91-v6mr23995366plb.240.1530512524359; Sun, 01 Jul 2018 23:22:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530512524; cv=none; d=google.com; s=arc-20160816; b=qWdvIyKKqmZmrnT3Gh0mWo6BLMgMVbMCOsCYq9ajZoOeSV5kv4NZ31o8deZ5KBHWBH adffBJ+vf0Qio0X7kokulHoKRru7Xa3M+ifxRSa9a1O8FGEBspoO/tbUY4Ik5MU+WPoX Byc8EfYcLpKjCxxIsmFfPXIDfUfoBRD1FtbLpM606EyDmt4KO9bPTS4nxx5is5t4+LCk rClu1We7jXkZTLkoOpfvj6H7/SpqdUCPTLNGMk7PMKoaAv/S12HlkO10PpxNS8w3amVP dChvI6KRCo/XwL0dWDlETQSI7xuV2HZnHhzm9iqowYZOXlJlQy87FGcA9otya86HnS7U /VgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date :arc-authentication-results; bh=0vzMRVqxHBa6FXiq6aQalzOZNDJi80kPLQuAyuku4ho=; b=tCWc4sWDfnVGO4A/H9dbNRWlV7S8wkgvQJAO8kvzCUHIZz3D9OL4EclftxP2pn87Le iGUlrefWwgGXWXZ0L7xAnhOdbJrjnj0o02ObdvTLmlhLbwvjrnPvbvW7XVr9qJaxbRDK ZEHxoPc0UELkqQzYCu0uxj1fSqkMs1ShLwXRbJTko2dbdGs8d+4FiWP5hUjbU+1hZ57M l6cqR1gBhAHbQaj8yeafIhBNqY2V6JHTpBIzHfDGXij7/BbHMhj00nkkhVeh2KAlsRJl 8OP42Fg0djCazWqgMsNMFjk+33935mepcoyIBla1M/2QvMhgQuaeyPsc+H1mW3SUCFEq KaQQ== 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 x128-v6si14427931pgx.156.2018.07.01.23.21.38; Sun, 01 Jul 2018 23:22:04 -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 S1753356AbeGBGSx (ORCPT + 99 others); Mon, 2 Jul 2018 02:18:53 -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