Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752965AbbGUHuT (ORCPT ); Tue, 21 Jul 2015 03:50:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46897 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751802AbbGUHuR (ORCPT ); Tue, 21 Jul 2015 03:50:17 -0400 Date: Tue, 21 Jul 2015 15:50:11 +0800 From: Baoquan He To: Dave Young Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, bp@suse.de, akpm@linux-foundation.org, jkosina@suse.cz, vgoyal@redhat.com, linux-kernel@vger.kernel.org, yinghai@kernel.org Subject: Re: [PATCH v2] Do not reserve crashkernel high memory if crashkernel low memory reserving failed Message-ID: <20150721075011.GC16747@dhcp-128-28.nay.redhat.com> References: <1437304064-9916-1-git-send-email-bhe@redhat.com> <20150719145320.GB9968@dhcp-17-102.nay.redhat.com> <20150721073123.GA30649@dhcp-129-220.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150721073123.GA30649@dhcp-129-220.nay.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2417 Lines: 56 Hi Dave, On 07/21/15 at 03:31pm, Dave Young wrote: > Hi, Baoquan > > The interface was introduced by Yinghai, ccing him. > > On 07/19/15 at 10:53pm, Baoquan He wrote: > > People reported that when allocating crashkernel memory using > > ",high" and ",low" syntax, there were cases where the reservation > > of the "high" portion succeeds, but the reservation of the "low" > > portion fails. Then kexec can load kdump kernel successfully, but > > the boot of kdump kernel fails as there's no low memory. This is > > because allocation of low memory for kdump kernel can fail on large > > systems for reasons. E.g it could be manually specified crashkernel > > low memory is too large to find in memblock region. > > > > In this patch add return value for reserve_crashkernel_low. Then put > > the crashkernel low memory reserving earlier, just between finding > > the crashkernel high memory region and reserving crashkernel high > > memory. Then if crashkernel low memory reserving failed we do not > > reserve crashkernel high memory but return immediately. Users can > > take measures when they found kdump kernel cann't be loaded > > successfully. > > So we have 3 sementics now, > crashkernel ,low > crashkernel ,high > crashkernel ,low + crashkernel ,high > For the last case, we need make sure both ,low and ,high reserved, > > Can we assume we need both ,low and ,high being ok if one specify > these two types in kernel cmdline? I think so. the reason why ,low is introduced is swiotlb or pci device need low memory when crashkernel is reserved above 4G. Low memory is necessary when ,high is specified unless user can make sure their machines don't need low memory and specify crashkernel=0,low explictly. > > Also in case one suceed, another fail, should we free the reserved memory? In this patch it doesn't need to free. Since it just finds an available memblock region for crashkernel high, then try to reserve crashkernel low memory. If low memory failed to allocate, it doesn't allocate crashkernel high memory found, but return immediately. Only if low memory is allocated successfully, high memory is allocated too subsequently. Thanks Baoquan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/