mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Vivek Goyal <vgoyal@in.ibm.com>
Cc: fastboot@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] kdump/kexec: calculate note size at compile time
Date: Thu, 29 Mar 2007 12:48:40 +0900	[thread overview]
Message-ID: <20070329034839.GA5973@verge.net.au> (raw)
In-Reply-To: <20070329034421.GC9582@in.ibm.com>

On Thu, Mar 29, 2007 at 09:14:21AM +0530, Vivek Goyal wrote:
> On Thu, Mar 29, 2007 at 12:30:59PM +0900, Simon Horman wrote:
> > Hi,
> > 
> > this is a(nother) minor update to this patch. 
> > Explanation below.
> > 
> > -- 
> > Horms
> >   H: http://www.vergenet.net/~horms/
> >   W: http://www.valinux.co.jp/en/
> > 
> > [PATCH] kdump/kexec: calculate note size at compile time
> > 
> > Currently the size of the per-cpu region reserved to save crash
> > notes is set by the per-architecture value MAX_NOTE_BYTES. Which
> > in turn is currently set to 1024 on all supported architectures.
> > 
> > While testing ia64 I recently discovered that this value is
> > in fact too small. The particular setup I was using actually
> > needs 1172 bytes. This lead to very tedious failure mode
> > where the tail of one elf note would overwrite the head of
> > another if they ended up being alocated sequentially by kmalloc,
> > which was often the case.
> > 
> > It seems to me that a far better approach is to caclculate the size
> > that the area needs to be. This patch does just that.
> > 
> > If a simpler stop-gap patch for ia64 to be squeezed into 2.6.21(.X)
> > is needed then this should be as easy as making MAX_NOTE_BYTES
> > larger in arch/asm-ia64/kexec.h. Perhaps 2048 would be a good choice.
> > However, I think that the approach in this patch is a much more robust
> > idea.
> > 
> > Update I:
> > 
> >   Changed KEXEC_NOTE_HEAD_BYTES to KEXEC_NOTE_DESC_BYTES in line
> >   with the name of the relevant field in struct elf_note
> > 
> > Update II:
> > 
> >   * Use KEXEC_NOTE_NAME instead of "CORE" in kernel/kexec.c and
> >     arch/ia64/kernel/crash.c just to be extra sure that the data
> >     used to calculate the size, and the data stuffed into the reserved
> >     area is the same.
> > 
> >     Incidently, the ia64 code really ought to use the generic code.
> >     I am working on a patch for this. But it is not urgent.
> > 
> 
> Looks good. Another patch to make ia64 also use generic kexec code
> for note generation would be nice.

Thanks, I will make it so :-)

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


  reply	other threads:[~2007-03-29  3:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-28  6:18 Simon Horman
2007-03-28  6:43 ` Vivek Goyal
2007-03-28  7:13   ` Horms
2007-03-28  8:08     ` Vivek Goyal
2007-03-29  3:30       ` Simon Horman
2007-03-29  3:44         ` Vivek Goyal
2007-03-29  3:48           ` Simon Horman [this message]
2007-03-30  0:41         ` Andrew Morton
2007-03-30  2:34           ` Simon Horman
2007-04-02  4:48           ` Simon Horman
2007-04-02 10:10             ` Simon Horman
2007-04-03  9:37 Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070329034839.GA5973@verge.net.au \
    --to=horms@verge.net.au \
    --cc=akpm@linux-foundation.org \
    --cc=fastboot@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vgoyal@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome