Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp284533pxb; Wed, 8 Sep 2021 00:47:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw00DsL2pfyX46cMJdP7prlG6sKih5IufVeSliaIqGABnncYFdAcZjBhqd5QddSjWOcOvof X-Received: by 2002:a50:ba84:: with SMTP id x4mr1487835ede.376.1631087259104; Wed, 08 Sep 2021 00:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631087259; cv=none; d=google.com; s=arc-20160816; b=ISgkGF/9VKoARfvAUl6hzMP+LRyWVMqNhU1DBttLjAYEds0gHS1IppJ0qVLyOri15A eQWQ6jUc05PzEwEp+WGB+GE5Jg28yYhwxg0JrdIW4JtouFTbVosrhDxaaqrtpwAfVbuY 9Y0Ko877nyPlVquX8Ybpdl8j/nATNjeIbto+K4DUu3N2RDjjCQZrdu0V8J1izlY8VKfP hPhJTPggzQ4JPXd2hSwMtiHY2NliHPwPGSiWwyhie+wDkuZyNfzt/poYADvKii1K9xk2 ql/5l2jzmnB62c07WjHJBZEFMfpaJJ2OuZ2lyomr0vTiUCQ5Abn5Bqj0shMlSvl2mmq1 qFAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject :organization:from:references:cc:to:dkim-signature; bh=z34UVAiI8Q78/349kHm5g+91ow7Iz9fZ37lSWz6rrwY=; b=EiMRMIV7UNivaUVzAwRSqd9OtkyS3HjL+exCPPJTN6aaJW38eG5ZCE8+RZlrXpB1uy bHVUjVAug0D3nwcGCF3iio8onotC0sS+WmOQtwhKibFRYoLWXi1d6tOECnIuAzsqfn22 3vv/3+f6XcClgNKGMnAgGl5k9Zu7yI/0rbaeGov4vePovCNPnenSS9fqohbSSzq3fexc LqGvuFJGTdw/00L7AQ6ugj0hJGCS21YNt1lYsfbws0EtjKOMS3eixQtRO7NisD0wu7ef WJBEheI+Xjom40GUPnWGwESIVJlaPiU683pPGNlyhL/vABOYKcoLshCFrq1bMNprxTSj MHKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bQ+v6Dmb; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nc22si1718391ejc.494.2021.09.08.00.47.15; Wed, 08 Sep 2021 00:47:39 -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=@redhat.com header.s=mimecast20190719 header.b=bQ+v6Dmb; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347731AbhIHGWr (ORCPT + 99 others); Wed, 8 Sep 2021 02:22:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44284 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347710AbhIHGWp (ORCPT ); Wed, 8 Sep 2021 02:22:45 -0400 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-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-9OJHwEhJPAO1KBo1V_TMVQ-1; Wed, 08 Sep 2021 02:21:36 -0400 X-MC-Unique: 9OJHwEhJPAO1KBo1V_TMVQ-1 Received: by mail-wm1-f69.google.com with SMTP id k5-20020a7bc3050000b02901e081f69d80so522936wmj.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=dC01gkhLlug8y10YqOSjRA2rnBlahrUemkkhh85IGuMzSuKR3uAbBt489e7FJTX8O2 LVVwSZmzrRojI7Oxq5c4fQLV1tkE0lFeDSvO9oz3FtW3eggiL5gWqLfAgl9XQ3BHxq0v RQT5vX8z44l2WHPMQTOop/B6+CGtw18NYMz3fsyNRNB7zBKGSwMLrEmw6hAkxQL53Ajj +qnOcTYwQNpqbBYrBhdyA8e2sO15Pe99b1YpBKqciNV9+D5gAJY/U7H2XSSjuy9WvWny gmJZOQtCiLTdhTWL7+nxfRS8qi0bhpFZN5Kng7ei67Yc3K8u0TkFSROFFHYNo6BxtX8y 5/ZQ== X-Gm-Message-State: AOAM533RpiVHd0pij34GQuCubCo8F7+TcLOiIBXgv894KnCIAzM2UYJn 3t6+bBj+fYSkStc6PoIysGwW8y85aBdktBRlJ4VYHI7Qn2vbtElVyb8YiRNoF+pJtG+5T0t6HCU KncxP9lnCX8JPhGmiNuUU8DNJ X-Received: by 2002:adf:9bdb:: with SMTP id e27mr1991897wrc.162.1631082094805; Tue, 07 Sep 2021 23:21:34 -0700 (PDT) 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08.09.21 00:40, Sean Anderson wrote: > Hi David, > > This patch breaks booting on my custom Xilinx ZynqMP board. Booting > fails just after/during GIC initialization: > > [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034] > [ 0.000000] Linux version 5.14.0 (sean@plantagenet) (aarch64-linux-gnu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 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 '115200n8') > [ 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-0x000000087fffffff] > [ 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: 1033987 > [ 0.000000] Kernel command line: earlycon clk_ignore_unused root=/dev/mmcblk0p2 rootwait rw cma=1000M > [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear) > [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) > [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off > [ 0.000000] software IO TLB: mapped [mem 0x000000003d400000-0x0000000041400000] (64MB) > [ 0.000000] Memory: 3023384K/4193280K available (4288K kernel code, 514K rwdata, 1200K rodata, 896K init, 187K bss, 145896K reserved, 1024000K 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 > > 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 another latent BUG in your setup. Some memory that shouldn't be handed to the buddy as free memory is 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 buddy, resulting in severe performance degradation such that the system 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 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 memory although it's still in use. [4] d) Hypervisor BUGs The last report (heavy performance degradation) was due to a BUG in dpdk. [2] What the exact symptoms you're experiencing? Really slow boot/stall? Then it could be a) and kstream might help. [1] https://github.com/davidhildenbrand/kstream [2] https://lore.kernel.org/dpdk-dev/20210827161231.579968-1-eperezma@redhat.com/T/#u [3] https://lore.kernel.org/r/MW3PR12MB4537C3C6EFD9CA3A4B32084DF36B9@MW3PR12MB4537.namprd12.prod.outlook.com [4] https://lkml.kernel.org/r/4650320.31r3eYUQgx@kreacher [5] https://lkml.kernel.org/r/87361onphy.fsf_-_@codeaurora.org [6] https://lore.kernel.org/r/20201213225517.3838501-1-linus.walleij@linaro.org -- Thanks, David / dhildenb