From patchwork Fri Apr 7 13:46:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 748288 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w01923VVcz9s7s for ; Fri, 7 Apr 2017 23:47:18 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3w01922WVfzDqM0 for ; Fri, 7 Apr 2017 23:47:18 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3w017y1y1mzDqGv for ; Fri, 7 Apr 2017 23:46:22 +1000 (AEST) Received: by ozlabs.org (Postfix) id 3w017y1B0pz9s7y; Fri, 7 Apr 2017 23:46:22 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 3w017x6mSSz9s7s; Fri, 7 Apr 2017 23:46:21 +1000 (AEST) From: Michael Ellerman To: Hari Bathini Subject: Re: [PATCH v2 1/2] fadump: reduce memory consumption for capture kernel In-Reply-To: References: <148647105867.9464.16492047069430229118.stgit@hbathini.in.ibm.com> <878tnd7zim.fsf@concordia.ellerman.id.au> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Fri, 07 Apr 2017 23:46:21 +1000 Message-ID: <87efx4gwk2.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev , Mahesh J Salgaonkar Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hari Bathini writes: > On Friday 07 April 2017 07:24 AM, Michael Ellerman wrote: >> My preference would be that the fadump kernel "just works". If it's >> using too much memory then the fadump kernel should do whatever it needs >> to use less memory, eg. shrinking nr_cpu_ids etc. > >> Do we actually know *why* the fadump kernel is running out of memory? >> Obviously large numbers of CPUs is one of the main drivers (lots of >> stacks required). But other than that what is causing the memory >> pressure? I would like some data on that before we proceed. > > Almost the same amount of memory in comparison with the memory > required to boot the production kernel but that is unwarranted for fadump > (dump capture) kernel. That's not data! :) The dump kernel is booted with *much* less memory than the production kernel (that's the whole issue!) and so it doesn't need to create struct pages for all that memory, which means it should need less memory. The vfs caches are also sized based on the available memory, so they should also shrink in the dump kernel. I want some actual numbers on what's driving the memory usage. I tried some of these parameters to see how much memory they would save: > So, if parameters like > cgroup_disable=memory, 0 bytes saved. > transparent_hugepages=never, 0 bytes saved. > numa=off, 64KB saved. > nr_cpus=1, 3MB saved (vs 16 CPUs) Now maybe on your system those do save memory for some reason, but please prove it to me. Otherwise I'm inclined to merge: cheers diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 8ff0dd4e77a7..03f1f253c372 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -79,8 +79,10 @@ int __init early_init_dt_scan_fw_dump(unsigned long node, * dump data waiting for us. */ fdm_active = of_get_flat_dt_prop(node, "ibm,kernel-dump", NULL); - if (fdm_active) + if (fdm_active) { fw_dump.dump_active = 1; + nr_cpu_ids = 1; + } /* Get the sizes required to store dump data for the firmware provided * dump sections.