Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932602Ab2CACxc (ORCPT ); Wed, 29 Feb 2012 21:53:32 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:50388 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932216Ab2CACxb (ORCPT ); Wed, 29 Feb 2012 21:53:31 -0500 Date: Thu, 1 Mar 2012 11:53:29 +0900 From: Simon Horman To: Eugene Surovegin Cc: linux-kernel@vger.kernel.org, kexec-list , Eric Biederman , Vivek Goyal Subject: Re: [PATCH] kdump: force page alignment for per-CPU crash notes. Message-ID: <20120301025328.GF10053@verge.net.au> References: <1330536083-13098-1-git-send-email-surovegin@google.com> <20120301011811.GC16483@verge.net.au> <20120301013200.GF16483@verge.net.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organisation: Horms Solutions Ltd. 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: 1861 Lines: 41 On Wed, Feb 29, 2012 at 05:39:55PM -0800, Eugene Surovegin wrote: > On Wed, Feb 29, 2012 at 5:32 PM, Simon Horman wrote: > > On Wed, Feb 29, 2012 at 05:23:10PM -0800, Eugene Surovegin wrote: > >> On Wed, Feb 29, 2012 at 5:18 PM, Simon Horman wrote: > >> > >> > On Wed, Feb 29, 2012 at 09:21:23AM -0800, Eugene Surovegin wrote: > >> > > Per-CPU allocations are not guaranteed to be physically contiguous. > >> > > However, kdump kernel and user-space code assumes that per-CPU > >> > > memory, used for saving CPU registers on crash, is. > >> > > This can cause corrupted /proc/vmcore in some cases - the main > >> > > symptom being huge ELF note section. > >> > > > >> > > Force page alignment for note_buf_t to ensure that this assumption holds. > >> > > >> > Ouch. I'm surprised there is an allocation on crash, perhaps > >> > it could at least be done earlier? And am I right in thinking > >> > that this change increases the likely hood that the allocation > >> > could fail? > >> > > >> > >> I'm not following. This allocation is done on start-up, not on crash. > >> If you cannot allocate this much memory on system boot, I'm not sure what > >> else you can do on this system.... > > > > Sorry, my eyes deceived me. You are correct and I agree. > > > > Is it the case that note_buf_t is never larger than PAGE_SIZE? > > If so I your patch looks good to me. > > Currently, maximum note size is hardcoded in kexec-tools to 1024 > (MAX_NOTE_BYTES). > Usually it's way less. IIRC on x86_64 it's 336 bytes. Ok, understood. Reviewed-by: Simon Horman -- 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/