Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2773630imm; Sun, 1 Jul 2018 05:25:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfO1nO96BE+JD1vmkZtWA+OyFaJoQTOYx5YJxC4EJa0ZlNdy5kz3AOZACLKChzAlSRfKpsj X-Received: by 2002:a65:6102:: with SMTP id z2-v6mr5110619pgu.46.1530447933061; Sun, 01 Jul 2018 05:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530447933; cv=none; d=google.com; s=arc-20160816; b=gdWydgkVTVFBSJ9qaeujktdOXiae60wz1hYjp5IesEvpIrxkcgOoVE24kD9rMSZadK K6SdbJaScGkc56S4hi6B1NGflU/RL5IfX6SpLRlIEZm5lk1ebDfeEmvb9VJ6HznXsr8O w/+PsvNkEcKbLo5dx8oW0RRCGzaKaMnAdbRkCB75rN3/YGSf8W9BlyoCui4SHCz9qPm5 wXzzbMiLbKTI9pQNS04xGU5NgFcv112/MyAAHPIUROwJXrs3Z3WfKABT5NSURzTXpjUm LQvRGUHNpEDZH5G2YSyTEN2m/TdquqkCYWmMUA5jUtv3aEkbR2j4t/JsmntIyVruaso+ 9g/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date :arc-authentication-results; bh=6d7VMjnx48GGBIG+pNggOvjeutNCejzLCpRgvZ2end4=; b=cci8TNQ9ypvyvXlTXV/bHes02dTtMo2zKjHlH2s2Dep66NDVSxjo9TfoWi2IrhmIVp VYbNzRaCPJsmbRutGWzJZxmv7qm7X1iCNQ8+DskcOHfBXOPXXL4udEYJM9WUkRFuTPJX VTFICxwEMwYJqzmnAH5Ze2sIHGmvRdlBHJPj1EN/e1G9VcxOzcnsFl5B7z3ayYUlbzPa TI50cLKC9LurCZ3UyzrS5FL60pjyPBx+Wxeyi8Xd3H7CDcueKflg4KEW/bS1LfOih35S 6QjpC6pIExMTpkAt7izg41PRZyeXaM5l4eUqHCLoXo96OAY6tR8vNkZQ/zwHJ16spxYR o+lg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y4-v6si12499579pge.356.2018.07.01.05.25.17; Sun, 01 Jul 2018 05:25:33 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752296AbeGAMW7 (ORCPT + 99 others); Sun, 1 Jul 2018 08:22:59 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59808 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752124AbeGAMWz (ORCPT ); Sun, 1 Jul 2018 08:22:55 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w61CIrc0142471 for ; Sun, 1 Jul 2018 08:22:55 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jxpyttg3k-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 01 Jul 2018 08:22:55 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 1 Jul 2018 13:22:52 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sun, 1 Jul 2018 13:22:49 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w61CMm6336765838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 1 Jul 2018 12:22:48 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1A6D442041; Sun, 1 Jul 2018 13:22:34 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6DF0D4203F; Sun, 1 Jul 2018 13:22:33 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.245]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Sun, 1 Jul 2018 13:22:33 +0100 (BST) Date: Sun, 1 Jul 2018 15:22:46 +0300 From: Mike Rapoport To: Rob Herring Cc: mhocko@kernel.org, linux-mm@kvack.org, Johannes Weiner , Andrew Morton , "open list:GENERIC INCLUDE/ASM HEADER FILES" , "linux-kernel@vger.kernel.org" , Yoshinori Sato Subject: h8300: BUG: Bad page state in process swapper (was: Re: why do we still need bootmem allocator?) References: <20180625140754.GB29102@dhcp22.suse.cz> <20180627112655.GD4291@rapoport-lnx> <20180627160206.GB19182@rapoport-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180627160206.GB19182@rapoport-lnx> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18070112-4275-0000-0000-00000293E49D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070112-4276-0000-0000-0000379B5AC3 Message-Id: <20180701122245.GA28969@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-01_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807010146 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (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. 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,