Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3552825pxf; Mon, 22 Mar 2021 09:04:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlaRHpO+VpsIhXF8IK/mTe7pItRoK0FIVBZB0mMO8AHrXp3ZPbVrm6AvQTazwc30IIUwaB X-Received: by 2002:a17:906:1155:: with SMTP id i21mr521254eja.218.1616429060730; Mon, 22 Mar 2021 09:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616429060; cv=none; d=google.com; s=arc-20160816; b=dAb0KRz+kRebsfkRDSag2+0NADPKr2bnp4QwtYzkcVLohUB/OUpf6oqf1XPxYExmMr n/cEdkH7J1NkJ7uR3kJkHR/JiNDp02WEiWW+EPFYzlLuI316/a4y2g9C72J0xtagjfsN gt71FR5e4C042fLjrVhya25HMkG1sN3sLNgTq1+Ht/96YrmDC1FMl9Qr0IalU+u6caLE xpM6V9ppeqXBaHehlhCDyhmF8iqRxpGlgIYpW6xP5K+PZNwJ+g37K1efFbJiQg8mnYv+ dcYJYrm9oL8umCFjbAadYTMDAuHU59ULGTXSvrzRn4bA0tYa+2+JshXKw987W24cHDpm wFLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=W0IDIfX6AJuXdpUONxZchTMRUur8djK38Sbs7ocWmH4=; b=KmfY+KVqTHihcL8pRT4igYzwU/tqGL8Dk5TT+6KHbBaflyN3fZuJp1+vCEWkmW0WIj Hk5vq9KhV67crhLzzTpkCLLuNcLQEkw0X0X9qmZe01G7Ovy+/Rbjn64Nc7mtwJiGOUiR VUAJS0kKUVGbGrwqTYPKa958e63N1lKs6MIydVPIihLe81Qmh9T/87JtkZdiistb+JmZ loN11UG2ZlUazy8BBxtXbA/FrTKVTvnW921bIRBs/6hAt9bN7f5HnDutkLZNacEsV35d FnNex64zaZYD0730QLUjAdsTbeWiY4poZqSqLhvsr5qL5hDbe5AN4LjEYAotC5W9O5Ra vwfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="EA/xubv4"; 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 t5si12182691edd.272.2021.03.22.09.03.57; Mon, 22 Mar 2021 09:04:20 -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="EA/xubv4"; 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 S230439AbhCVQCz (ORCPT + 99 others); Mon, 22 Mar 2021 12:02:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36277 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230293AbhCVQCZ (ORCPT ); Mon, 22 Mar 2021 12:02:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616428944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=W0IDIfX6AJuXdpUONxZchTMRUur8djK38Sbs7ocWmH4=; b=EA/xubv4Abk7uDEXB7xrmHgLVH3WtnVQt6U9j0qOxeF/kyGEIsJf3N/sNBzz04AD9zs/9Q ukqAdaj6QHf1naaPf/Qg2NFpr3aWTpLnb3DYZ8i71dYW3mlUTOxfTh0ScvuDKqyoALmrdO /VI+gr8sgGheRo+kBGElr7An7duQ/5A= 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-319-voatCJxPPuOKF6jAy4Xecw-1; Mon, 22 Mar 2021 12:02:20 -0400 X-MC-Unique: voatCJxPPuOKF6jAy4Xecw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6725C81746C; Mon, 22 Mar 2021 16:02:16 +0000 (UTC) Received: from t480s.redhat.com (ovpn-115-54.ams2.redhat.com [10.36.115.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E5752C15A; Mon, 22 Mar 2021 16:02:01 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Andy Shevchenko , Baoquan He , Borislav Petkov , Brijesh Singh , Daniel Vetter , Dan Williams , Dave Hansen , Dave Young , Eric Biederman , Greg Kroah-Hartman , "H. Peter Anvin" , Ingo Molnar , Keith Busch , Mauro Carvalho Chehab , Michal Hocko , Oscar Salvador , Qian Cai , Thomas Gleixner , Tom Lendacky , Vivek Goyal Subject: [PATCH v1 0/3] kernel/resource: make walk_system_ram_res() and walk_mem_res() search the whole tree Date: Mon, 22 Mar 2021 17:01:57 +0100 Message-Id: <20210322160200.19633-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Playing with kdump+virtio-mem I noticed that kexec_file_load() does not consider System RAM added via dax/kmem and virtio-mem when preparing the elf header for kdump. Looking into the details, the logic used in walk_system_ram_res() and walk_mem_res() seems to be outdated. walk_system_ram_range() already does the right thing, let's change walk_system_ram_res() and walk_mem_res(), and clean up. Loading a kdump kernel via "kexec -p -s" ... will result in the kdump kernel to also dump dax/kmem and virtio-mem added System RAM now. Note: kexec-tools on x86-64 also have to be updated to consider this memory in the kexec_load() case when processing /proc/iomem. Against next-20210322. David Hildenbrand (3): kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources kernel/resource: make walk_mem_res() find all busy IORESOURCE_MEM resources kernel/resource: remove first_lvl / siblings_only logic kernel/resource.c | 45 ++++++++++++--------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) -- 2.29.2