public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Corey Minyard <cminyard@mvista.com>
Cc: Kenneth Sumrall <ken@mvista.com>,
	linux-kernel@vger.kernel.org,
	Suparna Bhattacharya <suparna@in.ibm.com>,
	lkcd-devel@lists.sourceforge.net
Subject: Re: Kexec, DMA, and SMP
Date: 09 Feb 2003 11:39:27 -0700	[thread overview]
Message-ID: <m1d6m1z4bk.fsf@frodo.biederman.org> (raw)
In-Reply-To: <3E45661A.90401@mvista.com>

Corey Minyard <cminyard@mvista.com> writes:

> The panic case is actually the most interesting for us.  We are using bootimg
> with the MCL coredump to take a kernel core to memory and pick it up on the next
> boot. 

[snip]

With respect to DMA and SMP handling for kexec on panic that case is
much trickier.  A lot of the normal methods simply don't apply because
by definition in a panic something is broken, and that something may
be the code we need to cleanly shutdown the hardware.  But I an not
ready to sacrifice a method that works well in a properly working
kernel just because the panic case can't use it.

In getting it working I suggest we start with the easy cases, where
DMA and SMP are not big issues.  And then we can have a working
framework.

I am still digesting the crash dump code I have seen, but as far as I
can tell what it does is to compress the contents of memory, for
writing out later.

To handle the hard cases for kexec on panic I would recommend the
following.

- Place the recovery code in a reserved area of memory that the normal
  kernel will not touch, and actually run the code there.  This
  trivially solves the DMA problem because the hardware is not DMA'ing

- Setup the kernel that does the recovery so that the pool of memory
  it uses for dynamic allocations is also in the reserved area of
  memory so that it is equally free of DMA dangers.

- Modify the kernel that does the recovery so it can be run at
  different physical address from the standard kernel, so it will not
  need to be moved out of the reserved area of memory.

- Modify the kernel that does the recovery to not care about
  which cpu in a SMP system it comes up on first.

- Modify the kernel that does the recovery so that it is very robust
  in reinitializing devices.  So it can cope with devices in a random
  state.  Though most devices can be handled by simply ignoring them.

- Possibly preserve in the reserved area a separate copy of the tables
  ACPI/MP/etc that the kernel needs for coming up.  I actually don't
  think this needs to happen as the kernel preserves those in place
  already.

At that point I believe a full memory core dump can be achieved
without needing to do anything except to jump to the other kernel
on panic.  All of the memory can be preserved because the kexec case
would not have touched it.

I find this very attractive because it can be done with a very low
impact on the primary kernel whose panic we want to capture, plus it
is an extremely robust solution.

The one piece I don't know about is how to prioritize which pieces of
memory are written out first.  It is certainly a desirable feature
but do we need that, if we can preserve everything?  Or is it easy
enough to get the prioritizing information that we don't care.

Eric

  reply	other threads:[~2003-02-09 18:30 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3E448745.9040707@mvista.com>
     [not found] ` <m1isvuzjj2.fsf@frodo.biederman.org>
2003-02-08 20:18   ` Kexec, DMA, and SMP Corey Minyard
2003-02-09 18:39     ` Eric W. Biederman [this message]
2003-02-10 11:14       ` Kexec on 2.5.59 problems ? Suparna Bhattacharya
2003-02-10 17:09         ` [Fastboot] " Andy Pfiffer
2003-02-10 18:07           ` Eric W. Biederman
2003-02-11  7:21             ` Suparna Bhattacharya
2003-02-11 17:04               ` Andy Pfiffer
2003-02-11 23:46                 ` Andy Pfiffer
2003-02-12  4:29                   ` Eric W. Biederman
2003-02-12 22:31                     ` Andy Pfiffer
2003-02-13  9:50                       ` Suparna Bhattacharya
2003-02-13 15:10                         ` Eric W. Biederman
2003-02-18 10:59                           ` Suparna Bhattacharya
2003-02-18 15:06                             ` Eric W. Biederman
2003-02-10 12:12       ` Kexec, DMA, and SMP Suparna Bhattacharya
2003-02-10 13:56         ` Corey Minyard
2003-02-10 15:07           ` Suparna Bhattacharya
2003-02-10 15:22             ` Corey Minyard
2003-02-10 17:56         ` Eric W. Biederman
2003-02-11  1:35           ` Kenneth Sumrall
2003-02-11  5:08             ` Eric W. Biederman
2003-02-11 17:09               ` Stephen Hemminger
2003-02-11 12:55           ` Suparna Bhattacharya
2003-02-11 13:40             ` Suparna Bhattacharya
2003-02-11 14:06               ` Corey Minyard
2003-02-11 14:40                 ` Suparna Bhattacharya
2003-02-11 15:20                   ` Corey Minyard
2003-02-12  4:28                     ` Eric W. Biederman
2003-02-12 14:17                       ` Corey Minyard
2003-02-12 14:51                         ` Eric W. Biederman
2003-02-12 16:06                           ` Corey Minyard
2003-02-13 11:13                             ` Suparna Bhattacharya
2003-02-14  3:13                             ` Werner Almesberger
2003-02-14 14:20                               ` Corey Minyard
2003-02-14 18:10                                 ` Werner Almesberger
2003-02-14 18:23                                   ` Corey Minyard
2003-02-14 19:26                                     ` Zwane Mwaikambo
2003-02-14 19:44                                       ` Werner Almesberger
2003-02-14 20:00                                         ` Corey Minyard
2003-02-15  6:03                                           ` Eric W. Biederman
2003-02-16 16:22                                             ` Corey Minyard
2003-02-16 21:48                                               ` Eric W. Biederman
2003-02-17  4:26                                                 ` Corey Minyard
2003-02-17  7:18                                                   ` Eric W. Biederman
2003-02-17 17:32                                                     ` Corey Minyard
2003-02-12  4:47                     ` Suparna Bhattacharya

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=m1d6m1z4bk.fsf@frodo.biederman.org \
    --to=ebiederm@xmission.com \
    --cc=cminyard@mvista.com \
    --cc=ken@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkcd-devel@lists.sourceforge.net \
    --cc=suparna@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