Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4101135pxf; Tue, 23 Mar 2021 02:42:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytS+DH5jCx9YSh1PuSmgfmTIfYU2scRXdB7lm2agp/uKEezHZ0s6YxnzJHFcfKg6zshqwB X-Received: by 2002:a17:906:4150:: with SMTP id l16mr4119551ejk.90.1616492557936; Tue, 23 Mar 2021 02:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616492557; cv=none; d=google.com; s=arc-20160816; b=dUmBAm5nFgLPZYWAj22g32WIaSHhZG907iYciHSCuP0dcYtZsCec2DZ7GAtLPHMttf xl+zhDxKaSiRElqh41D2QMvPGwFQAR8s6ms+3gzqvEQ36gFGELGiNzyOMpD5zBFDLryL t25/l7vSsLmIUFaHmc1IfCPdCLFy7W4/duIS71JGdS32ITvyPCVhaHceq29hzxzJrMvb Fmvj5yJn0rAvbNU+/ooyuwUWHImHP/Kw4XAJ8/zJyj7Wh3Y4VN797Xe1pJI3MKWuCXRo vmRFo5d4ngGEvc6GPl99OYSkBncZwQZXdHcdezTUFHi8ddRNYSzPXaRPuL6KX4RVmiyH VkNA== 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:organization :from:references:cc:to:subject:dkim-signature; bh=088M8b3j5m89GVK9P+jIPgtOdQ+Cx6zwybuJwCbvRt4=; b=zTqy6uS0VWTT1nSESYGU/yp5UnaY8e5qAjSvhtzl6GZWxwcX8R+aM22G/PabMLknEo JY2Gs1sL+x0RA9CAVwSLhjP1spv2xE9INT0UFADWgCKmCKBd6Ml+v/oXUejEDFn72H/B x55AT4o2lr01mWvf/Yz4o+zVl+EuhbLADh9Nu4ctbJgSCN62uZ4h8ztqe6XuLuBOMdqa WzyhgL7RTAXDGtf1o4RL4nFFcGzigxKxeoR6JL00Qd3QXby7dgtMub+n7cXEw9hw4Jhk cvm89i5YSke6M3hAywZBKG8o1klKNocfoBTsUKW3ljssyWMoJ80SbMQLVOaMJiNMn4n+ hzcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Dzjq25ST; 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 s6si13876314ejq.79.2021.03.23.02.42.15; Tue, 23 Mar 2021 02:42:37 -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=Dzjq25ST; 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 S230156AbhCWJk7 (ORCPT + 99 others); Tue, 23 Mar 2021 05:40:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:46117 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230011AbhCWJkv (ORCPT ); Tue, 23 Mar 2021 05:40:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616492449; 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=088M8b3j5m89GVK9P+jIPgtOdQ+Cx6zwybuJwCbvRt4=; b=Dzjq25STuJxN6FJuVKJ6uqKmiNAR5VRung37rRSocO2UhlFlBdgwGsD3oRkpmpnvn8Fqbx rZ5ll+5vtRUDWL6p3MWaI6t6JujTLOeBZRHL+r08JIir9v7omgztQ6Ym3TA0mqJDhG7Jzr pUsevV9yBHcq03TT3avpIVn4vdtdDXk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-562-zqiZPOvkMqiRdtrS1BNldA-1; Tue, 23 Mar 2021 05:40:45 -0400 X-MC-Unique: zqiZPOvkMqiRdtrS1BNldA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D818D83DD22; Tue, 23 Mar 2021 09:40:42 +0000 (UTC) Received: from [10.36.115.54] (ovpn-115-54.ams2.redhat.com [10.36.115.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id C20152A335; Tue, 23 Mar 2021 09:40:34 +0000 (UTC) Subject: Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Andrew Morton , Greg Kroah-Hartman , Dan Williams , Daniel Vetter , Andy Shevchenko , Mauro Carvalho Chehab , Dave Young , Baoquan He , Vivek Goyal , Dave Hansen , Keith Busch , Michal Hocko , Qian Cai , Oscar Salvador , Eric Biederman , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Tom Lendacky , Brijesh Singh , x86@kernel.org, kexec@lists.infradead.org References: <20210322160200.19633-1-david@redhat.com> <20210322160200.19633-2-david@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Tue, 23 Mar 2021 10:40:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210322160200.19633-2-david@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.03.21 17:01, David Hildenbrand wrote: > It used to be true that we can have busy system RAM only on the first level > in the resourc tree. However, this is no longer holds for driver-managed > system RAM (i.e., added via dax/kmem and virtio-mem), which gets added on > lower levels. > > We have two users of walk_system_ram_res(), which currently only > consideres the first level: > a) kernel/kexec_file.c:kexec_walk_resources() -- We properly skip > IORESOURCE_SYSRAM_DRIVER_MANAGED resources via > locate_mem_hole_callback(), so even after this change, we won't be > placing kexec images onto dax/kmem and virtio-mem added memory. No > change. > b) arch/x86/kernel/crash.c:fill_up_crash_elf_data() -- we're currently > not adding relevant ranges to the crash elf info, resulting in them > not getting dumped via kdump. > > This change fixes loading a crashkernel via kexec_file_load() and including > dax/kmem and virtio-mem added System RAM in the crashdump on x86-64. Note > that e.g,, arm64 relies on memblock data and, therefore, always considers > all added System RAM already. > > Let's find all busy IORESOURCE_SYSTEM_RAM resources, making the function > behave like walk_system_ram_range(). > > Cc: Andrew Morton > Cc: Greg Kroah-Hartman > Cc: Dan Williams > Cc: Daniel Vetter > Cc: Andy Shevchenko > Cc: Mauro Carvalho Chehab > Cc: Signed-off-by: David Hildenbrand ^ My copy-paste action when creating the cc list slipped in a duplicate SO in all 3 patches. I can resend if desired. -- Thanks, David / dhildenb