Received: by 10.213.65.68 with SMTP id h4csp1248672imn; Thu, 22 Mar 2018 20:11:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELvcaUZ2VkF7RGlqO3qU3hmmNRbTy6pF8+hpYQo1lFsHaWPiNWL54vxu2U+4WKgwNEkP9LKi X-Received: by 10.99.183.67 with SMTP id w3mr19697390pgt.153.1521774700955; Thu, 22 Mar 2018 20:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521774700; cv=none; d=google.com; s=arc-20160816; b=RzIWMZFFZOFJGk8oEJPwK9pGttgDd5PkxWGFlMCB4Sg4TkeZgLLctkHWnIuoNNMuvk 1sfbNtN01zo5H6KH78cyUdgR4wQuxUP5qEWyHZ2KUrNjSm3lcT3SWnI/EOzPVDvhA4NV CAP+BNkL+BSXf3R9C/WjnpX8NctW8oHBxMXMGWOdqZJICY12Vloj+jH7rmJg16GS227z RTSoMKUjdqMEwkqksvEgKSp+2RFL/nVHOv7Su1IfZl0tx8CrvS9lJDZw65HRW0cHn0AN zbBBvD694/s/0pCNkg3IKX16Kl6AGiVsx6QVa6sj+HHd13LxsAFKBIHePCzLtK2Ymjtb Vsxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=fz5orqx0d4dvRLm6/ZBpEroz3370rnCH6TNnv4DeZCg=; b=HjvTfFrSeorJtLB3KYabsxiMwp5rt3CRK+Da1p3L5U6JR72H+fAwsX4UrM+G0bMPJU B0Wp1ARAkjkRPjz1diriMvJYmPpkGUjrQZWXd7xMJhbJ5kgr5W1ZmTtgK2F0EkFHokxE pTfvp8q5UH4Xo9g7rlodZkJjRLC7ZpQ9Y0ZyiISuZsKTIum5iigzINgS+tYEW+PlXKS7 ZN7i4mKoZfhulzGMT4Zdg8wgjZEbjbJQkLyYmFoMFo/wty75WSyWILiR1g63OENTh2H7 2IGO/xT15cy8YrXwxhIBGgTBQ6saw6b0AHtetBbupjaCNKycicD7qHFEP4jvXZllOhC0 z1Iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u72si5409887pgc.545.2018.03.22.20.11.26; Thu, 22 Mar 2018 20:11:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752237AbeCWDKX (ORCPT + 99 others); Thu, 22 Mar 2018 23:10:23 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56696 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752209AbeCWDKU (ORCPT ); Thu, 22 Mar 2018 23:10:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23C6940704A3; Fri, 23 Mar 2018 03:10:20 +0000 (UTC) Received: from localhost (ovpn-8-20.pek2.redhat.com [10.72.8.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F26F510B2B35; Fri, 23 Mar 2018 03:10:16 +0000 (UTC) Date: Fri, 23 Mar 2018 11:10:13 +0800 From: Baoquan He To: Andrew Morton Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, takahiro.akashi@linaro.org, ebiederm@xmission.com, vgoyal@redhat.com, dyoung@redhat.com, prudo@linux.vnet.ibm.com Subject: Re: [PATCH 1/2] resource: add walk_system_ram_res_rev() Message-ID: <20180323031013.GB11150@localhost.localdomain> References: <20180322033722.9279-1-bhe@redhat.com> <20180322033722.9279-2-bhe@redhat.com> <20180322152929.9b421af2f66cc819ad691207@linux-foundation.org> <20180323005845.GA25740@localhost.localdomain> <20180322190606.859a0f1c7e2d1b2958daeb9f@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180322190606.859a0f1c7e2d1b2958daeb9f@linux-foundation.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 23 Mar 2018 03:10:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 23 Mar 2018 03:10:20 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bhe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/22/18 at 07:06pm, Andrew Morton wrote: > On Fri, 23 Mar 2018 08:58:45 +0800 Baoquan He wrote: > > > > erk, this is pretty nasty. Isn't there a better way :( > > > > Yes, this is not efficient. > > > > In struct resource{}, ->sibling list is a singly linked list. I ever > > thought about changing it to doubly linked list, yet not very sure if > > it will have effect since struct resource is a core data structure. > > Switching to a list_head sounds OK. The only issue really is memory > consumption and surely we don't have tens of thousands of struct > resources floating about(?). Or if we do have a lot, the machine is > presumably huge (hope?). Yes. It doubles the memory consumption. AFAIK, the biggest number of resrouces I heard of possibly is mentioned in this user space kexec_tools commit. In this commit, Xunlei told on SGI system with 64TB RAM, the array which we have been using to store "System RAM"|"Reserved"|"ACPI **" regions is not big enough. In that case, we need extra 8Byte*2048=16KB at most. With my understanding, this increase is system wide, since each resource instance only needs its own list_head member, right? commit 4a6d67d9e938a7accf128aff23f8ad4bda67f729 Author: Xunlei Pang Date: Thu Mar 23 19:16:59 2017 +0800 x86: Support large number of memory ranges We got a problem on one SGI 64TB machine, the current kexec-tools failed to work due to the insufficient ranges(MAX_MEMORY_RANGES) allowed which is defined as 1024(less than the ranges on the machine). The kcore header is insufficient due to the same reason as well. To solve this, this patch simply doubles "MAX_MEMORY_RANGES" and "KCORE_ELF_HEADERS_SIZE". Signed-off-by: Xunlei Pang Tested-by: Frank Ramsay Signed-off-by: Simon Horman diff --git a/kexec/arch/i386/kexec-x86.h b/kexec/arch/i386/kexec-x86.h index 33df352..51855f8 100644 --- a/kexec/arch/i386/kexec-x86.h +++ b/kexec/arch/i386/kexec-x86.h @@ -1,7 +1,7 @@ #ifndef KEXEC_X86_H #define KEXEC_X86_H -#define MAX_MEMORY_RANGES 1024 +#define MAX_MEMORY_RANGES 2048 > > > AKASHI's method is more acceptable, and currently only kexec has this > > requirement. > > What method is that? I meant this patch is made by AKASHI, he posted a patchset to add kexec_file support for arm64. Among those patches this one is used to arm64 kernel at top of system RAM. Later they change a different way to search memory region to load kernel, so he dropped this patch.