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=-12.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 9BF2EC4332F for ; Wed, 8 Sep 2021 06:21:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2165061167 for ; Wed, 8 Sep 2021 06:21:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2165061167 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5355C900002; Wed, 8 Sep 2021 02:21:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4EDBC6B0071; Wed, 8 Sep 2021 02:21:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D46A900002; Wed, 8 Sep 2021 02:21:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 2F3596B006C for ; Wed, 8 Sep 2021 02:21:39 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C174B8249980 for ; Wed, 8 Sep 2021 06:21:38 +0000 (UTC) X-FDA: 78563409876.02.1A9EEFB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 60529801A8A7 for ; Wed, 8 Sep 2021 06:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631082097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z34UVAiI8Q78/349kHm5g+91ow7Iz9fZ37lSWz6rrwY=; b=bQ+v6Dmb9xgb+z3DHjD3DMEsbh2QIDLkPy3f9f2yVLq334PqaP2pfykVbRq9qSatOcfgSF Nb2kvAoWhKkRH2m3BRy9Kz8cVohv61VvjFf2Aucuvu+RyqmC+13STp6gV2jvlD9pdp8SWE tAS7wk/ADA7j5ALCZ8QYfHEW9nomRSg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-327-5RVJGGFxNbCASgbxi39ohw-1; Wed, 08 Sep 2021 02:21:35 -0400 X-MC-Unique: 5RVJGGFxNbCASgbxi39ohw-1 Received: by mail-wm1-f72.google.com with SMTP id h1-20020a05600c350100b002e751bf6733so455876wmq.8 for ; Tue, 07 Sep 2021 23:21:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=z34UVAiI8Q78/349kHm5g+91ow7Iz9fZ37lSWz6rrwY=; b=Nl6XrkXcx7hdaQ5YliH5TtfdfneaRaP1K+sOdno2hELJ9jWxwGImfpIfPze+V4oocn I8D4U9E1Y6wnXtzhUBkLo+GERvn/GQSKquBZTH03mc5F0e1+0HA/6jG9RkpQnohZSKNH cseZrMsgBtsQ6qfDA2lIczd5N8Hx9OA9SwInmPx6sVyVEGTUaxFqu31weEujOHUSchEz uWwHSdv3iGbdU+JU6MvmrHDeqI551R320lVP2OCuAASjFuwqe7Tv3263A+QSUFQBxUS2 VzA9gCwJDB0xUzU3NJOE+hCicNr2lCNYhW9D5tYYV+OE68jnhN5eA2zDQUR1w0JkVCdV DCpQ== X-Gm-Message-State: AOAM53332B6YAhijExIuDuEzy+vBcZOn+5Tuu9pyRc7nsj3gpFryINrf qT8RKTo8zWvwWiXOXEyrhznhmy6Q19uGrU4jAAUpX6XhoqMrsJwpSGBKLJmtg2N4zteea9pL8UM mBOVlXE+74T8= X-Received: by 2002:adf:9bdb:: with SMTP id e27mr1991888wrc.162.1631082094805; Tue, 07 Sep 2021 23:21:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVePYl3oJzEgmfpZnrDZETUp0uOCSKVg5L73nfFg5SJFFaAVj5u3fATe4qqvZ9JKp+koI50g== X-Received: by 2002:adf:9bdb:: with SMTP id e27mr1991865wrc.162.1631082094550; Tue, 07 Sep 2021 23:21:34 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6125.dip0.t-ipconnect.de. [91.12.97.37]) by smtp.gmail.com with ESMTPSA id l21sm1014143wmh.31.2021.09.07.23.21.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Sep 2021 23:21:34 -0700 (PDT) To: Sean Anderson Cc: akpm@linux-foundation.org, alexander.h.duyck@linux.intel.com, dave.hansen@intel.com, haiyangz@microsoft.com, kys@microsoft.com, linux-acpi@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mgorman@techsingularity.net, mhocko@kernel.org, mhocko@suse.com, osalvador@suse.de, pankaj.gupta.linux@gmail.com, richard.weiyang@linux.alibaba.com, rppt@kernel.org, sthemmin@microsoft.com, vbabka@suse.cz, wei.liu@kernel.org, willy@infradead.org, xen-devel@lists.xenproject.org References: <20201005121534.15649-5-david@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v2 4/5] mm/page_alloc: place pages to tail in __free_pages_core() Message-ID: <528e8d9c-b148-30ec-d8cc-3dd072eaa7f2@redhat.com> Date: Wed, 8 Sep 2021 08:21:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bQ+v6Dmb; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf06.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 60529801A8A7 X-Stat-Signature: oxdggmkokbxxiq4mfm5gxfrkm87j4qp8 X-HE-Tag: 1631082098-569806 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 08.09.21 00:40, Sean Anderson wrote: > Hi David, >=20 > This patch breaks booting on my custom Xilinx ZynqMP board. Booting > fails just after/during GIC initialization: >=20 > [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034] > [ 0.000000] Linux version 5.14.0 (sean@plantagenet) (aarch64-linux-g= nu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubu= ntu) 2.34) #251 SMP Tue Sep 7 18:11:50 EDT 2021 > [ 0.000000] Machine model: xlnx,zynqmp > [ 0.000000] earlycon: cdns0 at MMIO 0x00000000ff010000 (options '115= 200n8') > [ 0.000000] printk: bootconsole [cdns0] enabled > [ 0.000000] efi: UEFI not found. > [ 0.000000] Zone ranges: > [ 0.000000] DMA32 [mem 0x0000000000000000-0x00000000ffffffff] > [ 0.000000] Normal [mem 0x0000000100000000-0x000000087fffffff] > [ 0.000000] Movable zone start for each node > [ 0.000000] Early memory node ranges > [ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fefffff] > [ 0.000000] node 0: [mem 0x0000000800000000-0x000000087fffffff] > [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000087= fffffff] > [ 0.000000] On node 0, zone Normal: 256 pages in unavailable ranges > [ 0.000000] cma: Reserved 1000 MiB at 0x0000000041400000 > [ 0.000000] psci: probing for conduit method from DT. > [ 0.000000] psci: PSCIv1.1 detected in firmware. > [ 0.000000] psci: Using standard PSCI v0.2 function IDs > [ 0.000000] psci: MIGRATE_INFO_TYPE not supported. > [ 0.000000] psci: SMC Calling Convention v1.1 > [ 0.000000] percpu: Embedded 19 pages/cpu s46752 r0 d31072 u77824 > [ 0.000000] Detected VIPT I-cache on CPU0 > [ 0.000000] CPU features: detected: ARM erratum 845719 > [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 1= 033987 > [ 0.000000] Kernel command line: earlycon clk_ignore_unused root=3D/= dev/mmcblk0p2 rootwait rw cma=3D1000M > [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194= 304 bytes, linear) > [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 209715= 2 bytes, linear) > [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off > [ 0.000000] software IO TLB: mapped [mem 0x000000003d400000-0x000000= 0041400000] (64MB) > [ 0.000000] Memory: 3023384K/4193280K available (4288K kernel code, = 514K rwdata, 1200K rodata, 896K init, 187K bss, 145896K reserved, 1024000= K cma-reserved) > [ 0.000000] rcu: Hierarchical RCU implementation. > [ 0.000000] rcu: RCU event tracing is enabled. > [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay = is 25 jiffies. > [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 > [ 0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000 > [ 0.000000] Root IRQ handler: gic_handle_irq > [ 0.000000] GIC: Using split EOI/Deactivate mode >=20 > and I bisected it to this patch. Applying the following patch (for 5.14= ) > fixes booting again: Hi Sean, unfortunately that patch most likely (with 99.9999% confidence) revealed=20 another latent BUG in your setup. Some memory that shouldn't be handed to the buddy as free memory is=20 getting now allocated earlier than later, resulting in that issue. I had all different kinds of reports, but they were mostly a) Firmware bugs that result in uncached memory getting exposed to the=20 buddy, resulting in severe performance degradation such that the system=20 will no longer boot. [3] I wrote kstream [1] to be run under the old kernel, to identify these. b) BUGs that result in unsuitable memory getting exposed to either the=20 buddy or devices, resulting in errors during device initialization. [6] c) Use after free BUGs. Exposing memory, such as used for ACPI tables, to the buddy as free=20 memory although it's still in use. [4] d) Hypervisor BUGs The last report (heavy performance degradation) was due to a BUG in=20 dpdk. [2] What the exact symptoms you're experiencing? Really slow boot/stall?=20 Then it could be a) and kstream might help. [1] https://github.com/davidhildenbrand/kstream [2]=20 https://lore.kernel.org/dpdk-dev/20210827161231.579968-1-eperezma@redhat.= com/T/#u [3]=20 https://lore.kernel.org/r/MW3PR12MB4537C3C6EFD9CA3A4B32084DF36B9@MW3PR12M= B4537.namprd12.prod.outlook.com [4] https://lkml.kernel.org/r/4650320.31r3eYUQgx@kreacher [5] https://lkml.kernel.org/r/87361onphy.fsf_-_@codeaurora.org [6]=20 https://lore.kernel.org/r/20201213225517.3838501-1-linus.walleij@linaro.o= rg --=20 Thanks, David / dhildenb