Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4641293pxv; Tue, 27 Jul 2021 12:25:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9TuGCPBSt9DNzjHfAdRbOSOR7NwsmDw+1LZIQuOHg4d/FiKI1XPDmd85brk8PnmnxQixU X-Received: by 2002:a5e:a818:: with SMTP id c24mr19665743ioa.180.1627413932285; Tue, 27 Jul 2021 12:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627413932; cv=none; d=google.com; s=arc-20160816; b=pCO+2KuWJjIQKxy4XCAUOTWbj28K4s8w/+OGR3ZkK01Nqm8+TkKZxLYhKiF3LwiaQA 7lLGaGC8hqer9skudM/BNuj3DHljNsMCMCzLOqehtj1lmwIjKZ+oP4CdWWS0y0hMsKrS EEdBNw6NHD/UxZG8vOzGS0FEPWpAOd6T9rtiZBjIh0hInQD9gnrv4TJxI7fZG5ZMy6HJ gSiy6lyeaupF9EkAiXvnKDB9i8wZuJyyw07G50C5GQx1jp7gKCwqiRRupTPorMrOMHqg QFk/e7qhZwBQQ37DOGETROw6+7cBhXYCWctlfdi6D2+YGDEpOYxfy6e2YwWKpraGWq75 Jicw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Kwv/dzUFIVlUEF2u5j3qMikddidTR3I0tTI9oPy2vyY=; b=Aapl+YGpCv7hk1efs2sUXbRF66mzrMa/XSDtNWbHwfYbzhz8wgP7xAfH1CT1JMoQIX 9aVb0aLVWsqYEOP7PhWZv+TcU/IS9hj8Faac4RD3g4niGpvEUExg8IzuZTiSQ0jbpuTr 3BJn4p6s2fsX+33AbZaGDrTe6Uwt957F/8MwruuPE2C1r6G0qFaSVfVVa8FEPY7dkBao hkto3BzRdFsMLKrLdQBS3eQxd/MpoXTssxpKLk/4aXsRuFDFGtuqMIj7uSD+CaaPQ/Je ZIjOIbhZnq6QY2KeUvcA2xAowf/ZqtYCM3l1w/4+rkVtnyOFx6u0K9w2aCE/Zw/xSPfh UX1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fHRBYJ9A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q21si4240967jat.69.2021.07.27.12.25.20; Tue, 27 Jul 2021 12:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fHRBYJ9A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230387AbhG0TYk (ORCPT + 99 others); Tue, 27 Jul 2021 15:24:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbhG0TYj (ORCPT ); Tue, 27 Jul 2021 15:24:39 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F410C061757; Tue, 27 Jul 2021 12:24:38 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id l11so362633iln.4; Tue, 27 Jul 2021 12:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Kwv/dzUFIVlUEF2u5j3qMikddidTR3I0tTI9oPy2vyY=; b=fHRBYJ9AcLwM4Plh8pN5stLPQ1MG0OW9GcNSIVod4HdgQbGGP4g529FssVeGTF5TBH upYZNU/YyFQl30E6rfPQJUULQrBPrh89GbftSQk7BoEfvvY5nGNX/04+AROqcuCa5vW3 Fgf5SnxF6rKwHNdLvift796/q10rW2EgKv68zLUDkpHX3RhJyJqNU/g5qfT0tIZK5lJo CGQavnKG3/w1eTk6t3H5AbrxMin4ZDQaIQ6esd6CzE1m/DFjrGe+XzzzkqEnyEYmJiWl KDfc6IyTih45J4/cbpJGqimgC7bk/OndavyAcriOazKyQRqhRTVs19WiKoyuuqvNitfl cg7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Kwv/dzUFIVlUEF2u5j3qMikddidTR3I0tTI9oPy2vyY=; b=PjquuW27jCLTDeBb5GkGDetvfaHSBo6HMk6MVgl1pYXwSdBYYdA3gywhdtpnaInZOY ClH5ui7W8AuEO7ugdDAYV7P+nizFTiNV3mkHvJUsc9EHBSGCk4reVU8Ksy2AuQq416A3 fe2z+q52ODh4wiaoTG2Mh89wJjYMBUAF3htuCtD8njShFBpYFBS1fk+h1346mJIH1wvz nnzpf6JU2BfbyDGgYVYvfbMYRlYJ9jxamN2JGueblXoUMlVF43ttR03ciahI9pxLMHu7 TRHkUpIXeLSGo9zSq5VKrgVFt9muMZknHg9EoYEZGItQDRefeWLb6Uo+cvVwm2wwZzD8 pA/A== X-Gm-Message-State: AOAM531gBf7m0MsXZj0rmKjtLt9hyVOWO3A2ZKUiwZGJqMteMF2VRFRL 9PlCjtWnb68x65UAljFJwi/3PtPvYsa96GnK3CnZG8UcAbUnTg== X-Received: by 2002:a92:c989:: with SMTP id y9mr17987249iln.183.1627413878093; Tue, 27 Jul 2021 12:24:38 -0700 (PDT) MIME-Version: 1.0 References: <20210726192311.uffqnanxw3ac5wwi@ivybridge> In-Reply-To: From: Matt Turner Date: Tue, 27 Jul 2021 12:24:26 -0700 Message-ID: Subject: Re: Regression bisected to fa3354e4ea39 (mm: free_area_init: use maximal zone PFNs rather than zone sizes) To: Mike Rapoport Cc: Michael Cree , linux-mm@kvack.org, linux-alpha , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 26, 2021 at 11:43 PM Mike Rapoport wrote: > > On Mon, Jul 26, 2021 at 02:23:20PM -0700, Matt Turner wrote: > > On Mon, Jul 26, 2021 at 1:06 PM Mike Rapoport wrote: > > > > > > Hi Matt, > > > > > > On Mon, Jul 26, 2021 at 12:27:50PM -0700, Matt Turner wrote: > > > > Reply-To: > > > > > > > > Hi Mike! > > > > > > > > Since commit fa3354e4ea39 (mm: free_area_init: use maximal zone PFNs rather > > > > than zone sizes), I get the following BUG on Alpha (an AlphaServer ES47 Marvel) > > > > and loading userspace leads to a segfault: > > > > > > > > (I didn't notice this for a long time because of other unrelated regressions, > > > > the pandemic, changing jobs, ...) > > > > > > I suspect there will be more surprises down the road :) > > > > > > > BUG: Bad page state in process swapper pfn:2ffc53 > > > > page:fffffc000ecf14c0 refcount:0 mapcount:1 mapping:0000000000000000 index:0x0 > > > > flags: 0x0() > > > > raw: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 > > > > raw: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 > > > > page dumped because: nonzero mapcount Modules linked in: > > > > CPU: 0 PID: 0 Comm: swapper Not tainted 5.7.0-03841-gfa3354e4ea39-dirty #26 > > > > fffffc0001b5bd68 fffffc0001b5be80 fffffc00011cd148 fffffc000ecf14c0 > > > > fffffc00019803df fffffc0001b5be80 fffffc00011ce340 fffffc000ecf14c0 > > > > 0000000000000000 fffffc0001b5be80 fffffc0001b482c0 fffffc00027d6618 > > > > fffffc00027da7d0 00000000002ff97a 0000000000000000 fffffc0001b5be80 > > > > fffffc00011d1abc fffffc000ecf14c0 fffffc0002d00000 fffffc0001b5be80 > > > > fffffc0001b2350c 0000000000300000 fffffc0001b48298 fffffc0001b482c0 > > > > Trace: > > > > [] bad_page+0x168/0x1b0 > > > > [] free_pcp_prepare+0x1e0/0x290 > > > > [] free_unref_page+0x2c/0xa0 > > > > [] cmp_ex_sort+0x0/0x30 > > > > [] cmp_ex_sort+0x0/0x30 > > > > [] _stext+0x1c/0x20 > > > > > > > > I haven't tried reproducing this on other machines or QEMU, but I'd be glad to > > > > if that helps. > > > > > > If it's reproducible on QEMU I can debug it locally. > > > > > > > Any ideas? > > > > > > It seems like memory map is not properly initialized. Can you enable > > > CONFIG_DEBUG_MEMORY_INIT and add mminit_debug=4 to the command line. The > > > interesting part of the log would be before "Memory: xK/yK available ..." > > > line. > > > > > > Hopefully it'll give some clues. > > > > Sure thing. Please find attached. > > > aboot: loading uncompressed vmlinuz-5.7.0-03841-gfa3354e4ea39-dirty... > > aboot: loading compressed vmlinuz-5.7.0-03841-gfa3354e4ea39-dirty... > > aboot: PHDR 0 vaddr 0xfffffc0001010000 offset 0xc0 size 0x17c5ae0 > > aboot: bss at 0xfffffc00027d5ae0, size 0xe4ea0 > > aboot: zero-filling 937632 bytes at 0xfffffc00027d5ae0 > > aboot: loading initrd (5965252 bytes/5825 blocks) at 0xfffffc05ff2cc000 > > aboot: starting kernel vmlinuz-5.7.0-03841-gfa3354e4ea39-dirty with arguments ro panic=5 domdadm root=/dev/md1 console=srm mminit_debug=4 > > Linux version 5.7.0-03841-gfa3354e4ea39-dirty (mattst88@ivybridge) (gcc version 11.1.0 (Gentoo 11.1.0-r2 p3), GNU ld (Gentoo 2.36.1 p3) 2.36.1) #26 SMP Sun Jul 25 18:20:06 PDT 2021 > > printk: bootconsole [srm0] enabled > > Booting on Marvel variation Marvel/EV7 using machine vector MARVEL/EV7 from SRM > > Major Options: SMP EV67 VERBOSE_MCHECK DEBUG_SPINLOCK MAGIC_SYSRQ > > Command line: ro panic=5 domdadm root=/dev/md1 console=srm mminit_debug=4 > > memcluster 0, usage 1, start 0, end 1984 > > memcluster 1, usage 0, start 1984, end 1048576 > > memcluster 2, usage 1, start 2097152, end 2097224 > > memcluster 3, usage 0, start 2097224, end 3145728 > > Initial ramdisk at: 0x(____ptrval____) (5965252 bytes) > > Found an IO7 at PID 0 > > Initializing IO7 at PID 0 > > FIXME: disabling master aborts > > FIXME: disabling master aborts > > FIXME: disabling master aborts > > FIXME: disabling master aborts > > SMP: 2 CPUs probed -- cpu_present_mask = 3 > > Zone ranges: > > DMA [mem 0x0000000000f80000-0x00000fffffffdfff] > > Normal empty > > Movable zone start for each node > > Early memory node ranges > > node 0: [mem 0x0000000000f80000-0x00000001ffffffff] > > node 0: [mem 0x0000000400090000-0x00000005ffffffff] > > I think that the issue is that memory marked as used in memcluster is never > added to memblock and it skews node/zone sizing calculations. Thanks, this patch fixes it. With the patch applied, I see Zone ranges: DMA [mem 0x0000000000000000-0x00000fffffffdfff] Normal empty Movable zone start for each node Early memory node ranges node 0: [mem 0x0000000000000000-0x00000001ffffffff] node 0: [mem 0x0000000400000000-0x00000005ffffffff] Initmem setup node 0 [mem 0x0000000000000000-0x00000005ffffffff] If you want to send me this patch with your S-o-b I'll take it through my alpha git tree. Thanks Mike! Matt