Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3042371imj; Mon, 11 Feb 2019 12:49:08 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia7WJyZWjakAc88oeuDsiZn1g4aNUNMlE3pyqxOQ6hwYhQapqBmFg3xevQ+HsEFrYo/D1vk X-Received: by 2002:aa7:808a:: with SMTP id v10mr189028pff.8.1549918147925; Mon, 11 Feb 2019 12:49:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549918147; cv=none; d=google.com; s=arc-20160816; b=fCuW2Q8JVbrhIXKe2whChIkDvIqGZYkXKVTnfX4q+g7m/IFhw3X6+RjS2MqkPDUvSk fw10ik83bXI4f/h4e8Ad/MVcWSY7EzKb7RpPWdke2IwAhqaXgr6uihYsMkQypQ4WVjqW +PckZV7YzVhAe5HOIPBtAVsZhlMls01qhCAApvawJcEpb/r7gRGFEWJJjRrEpbDGsAHr WTiugd1U9K3Ft2baXUclaj3t4nTCi5L+7EslYc091iLaJ7QGrrwPGk90jG1NtlGM8Xnr XXXI8StrdhjbHN48rXPFG7yChwsS4XZbooUsenzTqffI1IPx+Ya5Q7nlW0J9gx2ipI5l U1DA== 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; bh=oceF7IQes7zoQru5i5BXprDrEcnvMf6xQM5tTIjJcwE=; b=qK3DeQGTRA31gtWryDpExEF57Bg6ea04KciL0WEdnktZpzCYcKYme962lNJKERqI/o BLfM9PiYfI0AmhHTdGz1SgHS9H/M/lV4Ki9SVuLZ6OvnehMWK8yBAWuili9dpLt/urna vfVOR0A9n8/BM7d5dHZRUvwGUJMWYFydEHmTjwoCQ2bwAdCsNQRBcktXxzV2XY2TK0u4 LLndHhkCW4RsfEYDccKMd+cCeXmVPRNcZ32tjnosRJAHp+StYBVOGRjObWUr5JHfSeMD 6Jcl+nm9T2cH8SVpjiH+eYDVQX7PHYwxqH8SkLgUY8xXyUoMPJZMMxDBdH9H8zQ3ukFX Uyow== 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 m15si8464512pgb.425.2019.02.11.12.48.52; Mon, 11 Feb 2019 12:49:07 -0800 (PST) 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 S1726391AbfBKUse (ORCPT + 99 others); Mon, 11 Feb 2019 15:48:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38314 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726080AbfBKUse (ORCPT ); Mon, 11 Feb 2019 15:48:34 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F14C80F82; Mon, 11 Feb 2019 20:48:33 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-81.pek2.redhat.com [10.72.12.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F05977C82D; Mon, 11 Feb 2019 20:48:23 +0000 (UTC) Date: Tue, 12 Feb 2019 04:48:16 +0800 From: Dave Young To: Borislav Petkov , bhe@redhat.com Cc: Jerry Hoemann , x86@kernel.org, Baoquan He , Randy Dunlap , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Pingfan Liu , Mike Rapoport , Andrew Morton , yinghai@kernel.org, vgoyal@redhat.com Subject: Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr Message-ID: <20190211204816.GB21473@dhcp-128-65.nay.redhat.com> References: <20190125103924.GB27998@zn.tnic> <20190125134518.GA23595@dhcp-128-65.nay.redhat.com> <20190125140823.GC27998@zn.tnic> <20190131075907.GB19091@dhcp-128-65.nay.redhat.com> <20190131105732.GC6749@zn.tnic> <20190131222732.GA946@anatevka> <20190131234740.GO6749@zn.tnic> <20190204223016.GB11986@anatevka> <20190205081552.GG21801@zn.tnic> <20190206120804.GC10062@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190206120804.GC10062@dhcp-128-65.nay.redhat.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 11 Feb 2019 20:48:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/06/19 at 08:08pm, Dave Young wrote: > On 02/05/19 at 09:15am, Borislav Petkov wrote: > > On Mon, Feb 04, 2019 at 03:30:16PM -0700, Jerry Hoemann wrote: > > > Is your objection only to the second fallback of allocating > > > memory above >= 4GB? Or are you objecting to allocating from > > > (896 .. 4GB) as well? > > > > My problem is why should the user need to specify high or low allocation > > explicitly when we can handle all that in the kernel automatically. > > > > The presence of crashkernel= on the cmdline sure means that the user > > wants to allocate memory for a second kernel. > > > > Now, if the requested allocation fails, we say: > > > > Error reserving crashkernel > > > > So, instead of saying that, we can *try* *again* and say > > > > Error reserving requested crashkernel at @..., attempting a high range. > > > > and run memblock_find_in_range() on the other regions which we deemed > > are ok to allocate from. > > > > Why aren't we doing that by default instead of placing all those > > different options in front of the user and expecting her/him to know > > something about all those magic ranges? > > As we talked in another reply, for the >4G allocation we can not avoid > the swiotlb issue, but if one request for 256M in high region and we > allocate the low part automatically, it will eat more memory eg. 512M. > > But probably in case allacation failed in low region ,high is a must for kdump > reservation, since no other choices perhaps we can make that as you said That is exactly what Pingfan is doing in this patch. Even we make it automatic in kernel, but we have to have some default value for swiotlb in case crashkernel can not find a free region under 4G. So this default value can not work for every use cases, people need manually use crashkernel=,low and crashkernel=,high in case crashkernel=X does not work. One can tune it for their use: 1) crashkernel=X reservation fails, likely the ,low default value is still too big, one can shrink the value and manually try other value 2) crashkernel=X reserve successfully on high memory and along with some default low memory region. But the low region is not enough. In this case one can increase the This should answer the question why ,high and ,low is still needed. But for above consumption 1), KASLR can still cause default ,low memory failed to reserve. So I wonder if KASLR can skip the 0-896M if the system memory is big enough. Thanks Dave