Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1824427yba; Sun, 14 Apr 2019 22:05:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzM+lI5XDHk4XS51jS5yxN0cVekk/PSKZQMggDYhYgmsckXwq1H/5JuRaIvJPxMEVfMY+Y0 X-Received: by 2002:a63:408:: with SMTP id 8mr67506771pge.334.1555304732221; Sun, 14 Apr 2019 22:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555304732; cv=none; d=google.com; s=arc-20160816; b=BB55a0hCOmqnScrSji9f2jzR9QJyFQWSA7oVtdmSE+vuNB1Jqf4X0VwtKpx2hXiUWM ExFt3J4qO6m05L+gNMQVwl+oJWHrGtCdou4kbihr1+4z7hSAOcBGQ2CakekyGwsxPV6P m9X7SEmIr+fVB0MtaAw7JZTd57K/blpDqZLF7ZMO64sc5pEZYEuLq+VyLv9OqpUOvLiP Ru9sqIePdvYUvfTRuMazsDSx7kUxna0izl9Rttlk56/Ne87bHkt2HmGDTNc3pz9FIqnh 97bWF7Oa57YPoho9zJe5kkgFaQRU/RrUOVH80D6zGngf7QNkEaEGuX/u+0MCyIPCPEMo x6+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=tBacxYYr5jJDp/mNEcEd0r1ead0eRh6rtRa+cn6JjTE=; b=DfYbtIOEwHoy4NyzP28LbLgrTce3DYe10v/QowGW+uM+px9gfj6oGGIYubbd5kJiZl DbSwRJXS/kiG9Wfm6Sp5QttJidjlrlddVc+qa/aU3nzotSwiZxJS+2snXkeN9IkONdE4 87aeMVbf/CeKGk/QMXN1iPBvNW/+K5eIp+pEFdXBr9jW7VxRFrQ1nmN2jXmUGVrGbegN 6SIw8gwV7He+Xb54DuQZYUZQFo6IIBajnYrO74WpX+VJS3z3DADSk2lqHguLexql9Bpu rSHiw+PQsEiRrCNkdudEjJcdtTE68m5apeRe3iOX1ifR7gdKRSAp1GqonDF6KgdLuSZQ elAw== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i24si44004036pgh.434.2019.04.14.22.05.14; Sun, 14 Apr 2019 22:05:32 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725813AbfDOFEj (ORCPT + 99 others); Mon, 15 Apr 2019 01:04:39 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44744 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbfDOFEi (ORCPT ); Mon, 15 Apr 2019 01:04:38 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3F53rYB043259 for ; Mon, 15 Apr 2019 01:04:37 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rvkftg2n4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 15 Apr 2019 01:04:37 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 15 Apr 2019 06:04:34 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 15 Apr 2019 06:04:22 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3F54LAc42598586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Apr 2019 05:04:21 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0ADC152051; Mon, 15 Apr 2019 05:04:21 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.112]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id DA6875204E; Mon, 15 Apr 2019 05:04:19 +0000 (GMT) Date: Mon, 15 Apr 2019 08:04:18 +0300 From: Mike Rapoport To: Chen Zhou Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, ebiederm@xmission.com, catalin.marinas@arm.com, will.deacon@arm.com, akpm@linux-foundation.org, ard.biesheuvel@linaro.org, horms@verge.net.au, takahiro.akashi@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org, wangkefeng.wang@huawei.com Subject: Re: [PATCH v3 3/4] arm64: kdump: support more than one crash kernel regions References: <20190409102819.121335-1-chenzhou10@huawei.com> <20190409102819.121335-4-chenzhou10@huawei.com> <20190410130917.GC17196@rapoport-lnx> <137bef2e-8726-fd8f-1cb0-7592074f7870@huawei.com> <20190414121058.GC20947@rapoport-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 19041505-0016-0000-0000-0000026ECD39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19041505-0017-0000-0000-000032CB0FBF Message-Id: <20190415050417.GB6167@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-15_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=679 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904150033 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Apr 15, 2019 at 10:05:18AM +0800, Chen Zhou wrote: > Hi Mike, > > On 2019/4/14 20:10, Mike Rapoport wrote: > >> > >> solution A: phys_addr_t start[INIT_MEMBLOCK_RESERVED_REGIONS * 2]; > >> phys_addr_t end[INIT_MEMBLOCK_RESERVED_REGIONS * 2]; > >> start, end is physical addr > >> > >> solution B: int start_rgn[INIT_MEMBLOCK_REGIONS], end_rgn[INIT_MEMBLOCK_REGIONS]; > >> start_rgn, end_rgn is rgn index > >> > >> Solution B do less remove operations and with no warning comparing to solution A. > >> I think solution B is better, could you give some suggestions? > > > > Solution B is indeed better that solution A, but I'm still worried by > > relatively large arrays on stack and the amount of loops :( > > > > The very least we could do is to call memblock_cap_memory_range() to drop > > the memory before and after the ranges we'd like to keep. > > 1. relatively large arrays > As my said above, the start_rgn, end_rgn is rgn index, we could use unsigned char type. Let's stick to int for now > 2. loops > Loops always exist, and the solution with fewer loops may be just encapsulated well. Of course the loops are there, I just hoped we could get rid of the nested loop and get away with single passes in all the cases. Apparently it's not the case :( > Thanks, > Chen Zhou > -- Sincerely yours, Mike.