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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_RED 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 2375EC433DB for ; Tue, 23 Mar 2021 11:07:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A1258619BF for ; Tue, 23 Mar 2021 11:07:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1258619BF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 22A596B0152; Tue, 23 Mar 2021 07:07:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 200866B0154; Tue, 23 Mar 2021 07:07:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C9176B0155; Tue, 23 Mar 2021 07:07:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id E6F066B0152 for ; Tue, 23 Mar 2021 07:07:42 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id AC5E4180AD82F for ; Tue, 23 Mar 2021 11:07:42 +0000 (UTC) X-FDA: 77950863564.26.0FCD2C9 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf28.hostedemail.com (Postfix) with ESMTP id 01EA42000253 for ; Tue, 23 Mar 2021 11:07:40 +0000 (UTC) IronPort-SDR: e3mZlEev22wd5EFUqOo0/QlOSGaSWBvd8XQJoHDijlujrgSOsk8euRlKEk6NDoHEW3nWGoJ1cq bBLr4ijKkuUQ== X-IronPort-AV: E=McAfee;i="6000,8403,9931"; a="190549473" X-IronPort-AV: E=Sophos;i="5.81,271,1610438400"; d="scan'208";a="190549473" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 04:07:40 -0700 IronPort-SDR: 414qVntEfxbN+cn7Mq/J1eIWwY4ihjJKpuPpfO7rHNtVCipnB/6DDCMp9T5eomjtuPBEtY4MTs CGgN+0IWwUxA== X-IronPort-AV: E=Sophos;i="5.81,271,1610438400"; d="scan'208";a="607685015" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2021 04:07:34 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lOesk-00EzjH-AE; Tue, 23 Mar 2021 13:07:30 +0200 Date: Tue, 23 Mar 2021 13:07:30 +0200 From: Andy Shevchenko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Greg Kroah-Hartman , Dan Williams , Daniel Vetter , 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 Subject: Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources Message-ID: References: <20210322160200.19633-1-david@redhat.com> <20210322160200.19633-2-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Stat-Signature: enqpbx8p9bcnq9xycue4d5gynru6bizr X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 01EA42000253 Received-SPF: none (linux.intel.com>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from=""; helo=mga09.intel.com; client-ip=134.134.136.24 X-HE-DKIM-Result: none/none X-HE-Tag: 1616497660-664354 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 Tue, Mar 23, 2021 at 10:40:33AM +0100, David Hildenbrand wrote: > 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. I think to address my comments you will need to resend anyway (as v2). -- With Best Regards, Andy Shevchenko