Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2885919ybi; Sun, 9 Jun 2019 23:53:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfujXmuo68TxtDG6ksWObEbhzoC6Ywna9RSh1wtihAiwvSCh8cF+R8YA6vbdFnQSBv7l4E X-Received: by 2002:a17:902:8c83:: with SMTP id t3mr43000530plo.93.1560149589385; Sun, 09 Jun 2019 23:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560149589; cv=none; d=google.com; s=arc-20160816; b=mB6DLTcYwAgD5W7XGIkIe8Y5ksZHblHmOfqCdB4DwFpDcGMeytHVgWVHcLmh9zE8iC itewLaxcQXt0D8yn4bXWCmWXhuejIQXF6oAzaSMObIOYv5oizsVBl0xzvaWbQ/OWIJlf wHUgcXMkdZDOfvUKgWihIGindJgbC46OjyHrzdU9Ppw6jyNUbE2QFe3NyFQ7rcPu+C9p 7j6J6B0VidfAHZN6as+7iueUWfje98QbRHlAgl1g0Verk9jH7DwcvxrM5iPVMgmvHSuX T5ZAyo13416bkTRXTaIojC3FuCv24dnYMud+hcTadG2kV19WQiphz4yR4gNmP+Ojcllc OaLw== 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=FVRY0sdyR6IG47RMZNdPtjvRMkRi4PJL8+AXeO+HYMM=; b=sV2SVGFQnj7ML6LmlqCek8+PLgXH2x/9V36q3Rjlqys+BpsHaGqyGEEnCbCCfjDN6s cKKexrMED+wmrFzs1iPXtKQCx9RkMobjKv5nVPnpY5WEvMqwIE5fEXe8bUWQK2q4oeFZ KQNf4LW/28y1NXsJztORM5R6dehgebYVgdd1DhQIp/Bhus6j7jqgeUVGPEFiJGigMaMJ GiG5iE9pFZOjey5ASSJvDu/VYRI7duf/lML7EVVS8hLubYgpXbx+OSA8FbSfXVFRSgDS 5giDzOlM/7UX68ZGM8s4RBAbPVg0VRKMZSSeTHOWBn4GwiTA/k3Q1krnKpcoHTLtW3oy JNjw== 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 31si8007944pgu.103.2019.06.09.23.52.54; Sun, 09 Jun 2019 23:53:09 -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 S2387892AbfFJGvz (ORCPT + 99 others); Mon, 10 Jun 2019 02:51:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57508 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387614AbfFJGvy (ORCPT ); Mon, 10 Jun 2019 02:51:54 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 99CE5307D854; Mon, 10 Jun 2019 06:51:53 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-59.pek2.redhat.com [10.72.12.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 876F71975F; Mon, 10 Jun 2019 06:51:49 +0000 (UTC) Date: Mon, 10 Jun 2019 14:51:45 +0800 From: Dave Young To: Borislav Petkov Cc: Pingfan Liu , kexec@lists.infradead.org, Baoquan He , Andrew Morton , Mike Rapoport , yinghai@kernel.org, vgoyal@redhat.com, Randy Dunlap , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr Message-ID: <20190610065145.GF3388@dhcp-128-65.nay.redhat.com> References: <1548047768-7656-1-git-send-email-kernelfans@gmail.com> <20190125103924.GB27998@zn.tnic> <20190125134518.GA23595@dhcp-128-65.nay.redhat.com> <20190125140823.GC27998@zn.tnic> <20190128095809.GC3732@dhcp-128-65.nay.redhat.com> <20190128101831.GA27154@zn.tnic> <20190607173016.GM20269@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190607173016.GM20269@zn.tnic> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 10 Jun 2019 06:51:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/07/19 at 07:30pm, Borislav Petkov wrote: > On Mon, Jan 28, 2019 at 11:18:31AM +0100, Borislav Petkov wrote: > > On Mon, Jan 28, 2019 at 05:58:09PM +0800, Dave Young wrote: > > > Another reason is in case ,high we will need automatically reserve a > > > region in low area for swiotlb. So for example one use > > > crashkernel=256M,high, actual reserved memory is 256M above 4G and > > > another 256M under 4G for swiotlb. Normally it is not necessary for > > > most people. Thus we can not make ,high as default. > > > > And how is the poor user to figure out that we decided for her/him that > > swiotlb reservation is something not necessary for most people and thus > > we fail the crashkernel= reservation? > > > > IOW, that "logic" above doesn't make a whole lot of sense to me from > > user friendliness perspective. > > So to show what I mean: I'm trying to reserve a crash kernel region on a > box here. I tried: > > crashkernel=64M@16M > > as it is stated in Documentation/kdump/kdump.txt. > > Box said: > > [ 0.000000] crashkernel reservation failed - memory is in use. > > Oh great. > > Then I tried: > > crashkernel=64M@64M > > Box said: > > [ 0.000000] crashkernel reservation failed - memory is in use. > > So I simply did: > > crashkernel=64M > > and the box said: > > [ 0.000000] Reserving 64MB of memory at 3392MB for crashkernel (System RAM: 16271MB) > > So I could've gone a long time poking at the memory to find a suitable > address. > > So do you see what I mean with making this as user-friendly and as > robust as possible? Yes, it is clear to me, I absolutely agree that is not friendly :) Previously without KASLR, one can check /proc/iomem to find a possible free area and use it for next and future boot. But in case KASLR enabled nowadays it become harder to predict the persistent free areas. > > In this case I don't care about *where* my crash kernel is - I only want > to have one loaded *somewhere*. We would suggest people to use crashkernel=X instead. for the X@Y I believe it is some historic thing, it *should* be able to be obsolete at least on X86, (not sure other arches). I expect people can comment if they have some use cases requiring this X@Y way. We have modified the crashkernel=X to search 0 - 4G memory instead of old 0 - 896M for low memory areas, so a possible case is people who uses very old kexec-tools which can only load kernel to memory under 896M. Another way is we just obsolete X@Y, but introduce another interface like crahskernel=X,max= (max will be used like the CRASH_ADDR_HIGH_MAX in arch/x86/kernel/setup.c) > > And the same strategy should be applied to other reservation attempts > - we should try hard to reserve and if we cannot reserve, then try an > alternating range. > > I even think that > > crashkernel=X@Y > > should not simply fail if Y is occupied but keep trying and say > > [ 0.000000] Reserving 64MB of memory at alternative address 3392MB for crashkernel (System RAM: 16271MB) > > and only fail when the user doesn't really want the kernel to try hard > by booting with > > crashkernel=X@Y,strict > > But that's for another day. Maybe X@Y,max=.. Then kernel will search begin with Y, and stop until max - 1; > > -- > Regards/Gruss, > Boris. > > Good mailing practices for 400: avoid top-posting and trim the reply. Thanks Dave