Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7029098ybi; Thu, 13 Jun 2019 08:23:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsh221mYRtkN1eC/AyzWd2xjlScAiIW6lobLiSAxbz3g6OaliMng3hXELHRifNUUQNaJ/U X-Received: by 2002:a62:7641:: with SMTP id r62mr68730281pfc.35.1560439406084; Thu, 13 Jun 2019 08:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560439406; cv=none; d=google.com; s=arc-20160816; b=Ias/nj4SU+P5PTIP4dephGOTE8UgWzCD9k0hrd2sV+r2vZjWQ/pLxvHKhmNvbeE0ju m8YgJi5rbFoZyio0195uxpkbNys/MpcSwGCbo20mp+ss+wwtzOVjfYtl9TgwOKwkIB6C XhMg+7XKJC37Q+a8w+/Xl1oj3yaqHELJVIdNkPvvAF+4Py9p6ZcnTWrpnR84ULnPt/Z6 TeoH4tMM7gglxumBCNv2AtIeBrzum9j4KCVv9yDgz9/UyOwkaGEcEUar+EWA9IYLihkq CNxEp73lrdkgIMxXuIa1oOFQctyG072deM+2b5K2renFC4YfulFJFkU1RcvZhGs2ceRy 1BjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8PkC0EBapHR12vT+h7Pbh+cIwdQ0xmtvjDkx2GTUDxE=; b=ZFyxgoPPZg0rDQV6oQbftMWp72fnBeL2HMH8Pa4QYtwEh13gfNFICu70G7UyIcdPZZ xkY2fE2+MILmEk0ZLGC1u+L/7FIb93Mo6py3Em5LhI/wfdGq7xvNFthFDjNpM738uh79 uXUAYEgLXfv3k2CEMncgcsaAMbODZ1NyXkbubTFeQfd8ezME+mnTm2Ysquy+e5tPKrU2 /b21NtcQqlsiCA3u/BUEY2osocn5ea2+uDBxcuv2aii4afW5LMI76l8ZMvpRAbLk8c/L 7xviEJOUTJGITv7NF9JC/Tp+LSk+R1cXKhLkx9jd96QL2Vq/G864sMbQeSIhQmvO9VUw eyYA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20si3372456plp.394.2019.06.13.08.23.11; Thu, 13 Jun 2019 08:23:26 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388784AbfFMPWL (ORCPT + 99 others); Thu, 13 Jun 2019 11:22:11 -0400 Received: from foss.arm.com ([217.140.110.172]:39268 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731988AbfFMMnV (ORCPT ); Thu, 13 Jun 2019 08:43:21 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E04BE2B; Thu, 13 Jun 2019 05:43:20 -0700 (PDT) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 76DA33F694; Thu, 13 Jun 2019 05:43:18 -0700 (PDT) Subject: Re: [PATCH 0/4] support reserving crashkernel above 4G on arm64 kdump To: Chen Zhou Cc: catalin.marinas@arm.com, will.deacon@arm.com, akpm@linux-foundation.org, ard.biesheuvel@linaro.org, rppt@linux.ibm.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, ebiederm@xmission.com, 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 References: <20190507035058.63992-1-chenzhou10@huawei.com> <51995efd-8469-7c15-0d5e-935b63fe2d9f@arm.com> <638a5d22-8d51-8d63-2d8a-a38bbb8fb1d6@huawei.com> From: James Morse Message-ID: <72a9c52b-1b24-57e8-e29f-b5a53524744b@arm.com> Date: Thu, 13 Jun 2019 13:43:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <638a5d22-8d51-8d63-2d8a-a38bbb8fb1d6@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Chen Zhou, On 13/06/2019 12:27, Chen Zhou wrote: > On 2019/6/6 0:32, James Morse wrote: >> On 07/05/2019 04:50, Chen Zhou wrote: >>> We use crashkernel=X to reserve crashkernel below 4G, which will fail >>> when there is no enough memory. Currently, crashkernel=Y@X can be used >>> to reserve crashkernel above 4G, in this case, if swiotlb or DMA buffers >>> are requierd, capture kernel will boot failure because of no low memory. >> >>> When crashkernel is reserved above 4G in memory, kernel should reserve >>> some amount of low memory for swiotlb and some DMA buffers. So there may >>> be two crash kernel regions, one is below 4G, the other is above 4G. >> >> This is a good argument for supporting the 'crashkernel=...,low' version. >> What is the 'crashkernel=...,high' version for? >> >> Wouldn't it be simpler to relax the ARCH_LOW_ADDRESS_LIMIT if we see 'crashkernel=...,low' >> in the kernel cmdline? >> >> I don't see what the 'crashkernel=...,high' variant is giving us, it just complicates the >> flow of reserve_crashkernel(). >> >> If we called reserve_crashkernel_low() at the beginning of reserve_crashkernel() we could >> use crashk_low_res.end to change some limit variable from ARCH_LOW_ADDRESS_LIMIT to >> memblock_end_of_DRAM(). >> I think this is a simpler change that gives you what you want. > > According to your suggestions, we should do like this: > 1. call reserve_crashkernel_low() at the beginning of reserve_crashkernel() > 2. mark the low region as 'nomap' > 3. use crashk_low_res.end to change some limit variable from ARCH_LOW_ADDRESS_LIMIT to > memblock_end_of_DRAM() > 4. rename crashk_low_res as "Crash kernel (low)" for arm64 > 5. add an 'linux,low-memory-range' node in DT (This bit would happen in kexec-tools) > Do i understand correctly? Yes, I think this is simpler and still gives you what you want. It also leaves the existing behaviour unchanged, which helps with keeping compatibility with existing user-space and older kdump kernels. Thanks, James