Received: by 10.213.65.68 with SMTP id h4csp1217076imn; Sat, 24 Mar 2018 06:35:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELt729rT/FaSG4lvQZyVUnVOFQaXXIR1wWbQqBOmNrQQM9Nzt1Fx+U5T2MBaSy69G65LRPlT X-Received: by 2002:a17:902:7d08:: with SMTP id z8-v6mr20986665pll.210.1521898517943; Sat, 24 Mar 2018 06:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521898517; cv=none; d=google.com; s=arc-20160816; b=TktryooKsB0B+tkRzt6rLiSQc+fzy9OiS8SrtMaTMNxqk7ySlets60enkesVmVTceu 5OLoOdgD7L8T6wlXJG3shVdciS7gQo5aXTRjAcWq/znss6Fwle3mDc2mByFZKE/vEHJs a4iyNp8lw0Q7GKZItw6Hmr3Ieny1OCJcMRBLM38I/rJ9neP2zsV5r0/dW5zuLKmEMxul 4AI8zK0Jq4zq6gliGKmsaSgSQySlC/U8qj9+D4nQSsoM9k5CNo5CaeXmcwsYuI2JiVm+ I3TuLsEevSOaQ7uGf2aRYkW6FBZmwEsmWw0aH7snSXI9xw/0l5YfF+ZoourE9qtLylsx QYCg== 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=e3CKbN7wc/STtONavGhJyk+RKFIjIHg6gfeWKYOfk9k=; b=Xvsfu8pb9h3zIzS4zXfsOzvOwc9f+LXulftQDrOo3UV/LXFMXe3dnB7pfdM6+10Rzr 2vXnJn8xqnLS8zvZRc5jUnvAKzfQlHYLFQMjMLjq9eYlFoGs1d7wJXU9nOIqozuEqocq G8g3EwPnUTYqDryz/cSTgr6KAg9qBN2pCfRkiebs8pImFDJ6u3gYl323tHXVQWxfwyJX 4+Qvmo24s9T+CpwzHsthBiH7qggsnb0Hi91VEVIaj8+zzyRYccmhTaVdnSz7M0wa7als B1KTfWpE4b8bwK8293yulTi8MVAxcYVqqbJZOmSKww3xfIFK3lCpdu8DFM644Cc9a1T9 iqdw== 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 l69si8585547pfb.389.2018.03.24.06.35.03; Sat, 24 Mar 2018 06:35:17 -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 S1752451AbeCXNdj (ORCPT + 99 others); Sat, 24 Mar 2018 09:33:39 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49018 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752377AbeCXNdg (ORCPT ); Sat, 24 Mar 2018 09:33:36 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC4D28182D3A; Sat, 24 Mar 2018 13:33:34 +0000 (UTC) Received: from localhost (ovpn-8-17.pek2.redhat.com [10.72.8.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C208B2166BAE; Sat, 24 Mar 2018 13:33:33 +0000 (UTC) Date: Sat, 24 Mar 2018 21:33:30 +0800 From: Baoquan He To: Andrew Morton Cc: prudo@linux.vnet.ibm.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, takahiro.akashi@linaro.org, ebiederm@xmission.com, dyoung@redhat.com, vgoyal@redhat.com Subject: Re: [PATCH 1/2] resource: add walk_system_ram_res_rev() Message-ID: <20180324133330.GD25740@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> <20180323031013.GB11150@localhost.localdomain> <20180323130620.7d60fc442463ed5c21898387@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180323130620.7d60fc442463ed5c21898387@linux-foundation.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sat, 24 Mar 2018 13:33:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sat, 24 Mar 2018 13:33:35 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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/23/18 at 01:06pm, Andrew Morton wrote: > On Fri, 23 Mar 2018 11:10:13 +0800 Baoquan He wrote: > > > 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? > > Yes. That sounds perfectly acceptable. > > It would be interesting to see what this approach looks like, if you > have time to toss something together? OK, will make patches for reviewing. Thanks!