<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec">
    <title>gmane.linux.kernel.kexec</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8723"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8722"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8721"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8701"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8700"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8699"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8698"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8697"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8695"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8694"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8693"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8682"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8679"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8678"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8677"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8676"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8674"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8665"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8663"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.kernel.kexec/8662"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8723">
    <title>Re: [PATCH] makedumpfile: warn on vmlinux without dwarf</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8723</link>
    <description>&lt;pre&gt;
Agreed.  An error code is good.

-Cliff

&lt;/pre&gt;</description>
    <dc:creator>Cliff Wickman</dc:creator>
    <dc:date>2013-05-20T12:17:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8722">
    <title>Re: [PATCH] makedumpfile: warn on vmlinux without dwarf</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8722</link>
    <description>&lt;pre&gt;On Wed, 15 May 2013 13:43:59 -0500
Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:


I agree to insert this message here, but don't agree to abort without
any error handling.
I think the code below seems better:

 if (dwarf_info.dwarfd == NULL) {
 ERRMSG("dwfl_module_getdwarf error.\n");
 return DWARF_CB_ABORT;
 }


Thanks
Atsushi Kumagai

&lt;/pre&gt;</description>
    <dc:creator>Atsushi Kumagai</dc:creator>
    <dc:date>2013-05-20T02:20:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8721">
    <title>Re: [PATCH] makedumpfile: message on non-mmap kernels</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8721</link>
    <description>&lt;pre&gt;On Wed, 15 May 2013 13:43:59 -0500
Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:


Where came from this original code ?
The current code in mmap branch doesn't look the return value of
update_mmap_range():

if (!is_mapped_with_mmap(offset))
update_mmap_range(offset);

Anyway, I'll merge this patch into mmap branch after I push the patch
below.


Thanks
Atsushi Kumagai

-----------------------------------------------------------------------
Author: Atsushi Kumagai &amp;lt;kumagai-atsushi-biTfD1RFvDe45+QrQBaojngSJqDPrsil&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Date:   Thu May 17 15:02:19 2013 +0900

    [PATCH] Add error handling for read_with_mmap().

    Add error handling for read_with_mmap the same as read()'s case.

    Signed-off-by: Atsushi Kumagai &amp;lt;kumagai-atsushi-biTfD1RFvDe45+QrQBaojngSJqDPrsil&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

diff --git a/makedumpfile.c b/makedumpfile.c
index fce2e35..1f656e8 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -291,7 +291,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; read_with_mmap(off_t offset, void *bufptr, unsigned long size) {
 nex&lt;/pre&gt;</description>
    <dc:creator>Atsushi Kumagai</dc:creator>
    <dc:date>2013-05-20T02:20:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8701">
    <title>[PATCH] makedumpfile: buddy identification when noncyclic</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8701</link>
    <description>&lt;pre&gt;From: Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

The 'buddy' identification of free pages should be done for non-cyclical
dumps as well as cyclical.
Remove the cyclic test from this condition:
    if (info-&amp;gt;flag_cyclic &amp;amp;&amp;amp; (info-&amp;gt;dump_level &amp;amp; DL_EXCLUDE_FREE))
I find this to speed the scan of page structures for a 1TB system from
60sec to 30sec.

And only do the exclude_free_page() procedure if free pages cannot be
identified using the buddy technique.

Signed-off-by: Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 makedumpfile.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Index: makedumpfile.mmap/makedumpfile.c
===================================================================
--- makedumpfile.mmap.orig/makedumpfile.c
+++ makedumpfile.mmap/makedumpfile.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2979,7 +2979,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; out:
 if (!get_value_for_old_linux())
 return FALSE;
 
-if (info-&amp;gt;flag_cyclic &amp;amp;&amp;amp; (info-&amp;gt;dump_level &amp;amp; DL_EXCLUDE_FREE))
+/* use buddy identification of free pages whether cyclic or not */
+/* (t&lt;/pre&gt;</description>
    <dc:creator>Cliff Wickman</dc:creator>
    <dc:date>2013-05-15T18:43:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8700">
    <title>[PATCH] makedumpfile: message on non-mmap kernels</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8700</link>
    <description>&lt;pre&gt;From: Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

If the crash kernel does not support mmap(2) of /proc/vmcore, make
makedumpfile fall back to using reads with a non-alarming message.

Signed-off-by: Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 makedumpfile.c |   37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

Index: makedumpfile.mmap/makedumpfile.c
===================================================================
--- makedumpfile.mmap.orig/makedumpfile.c
+++ makedumpfile.mmap/makedumpfile.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -239,7 +239,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; read_page_desc(unsigned long long paddr,
 }
 
 static int
-update_mmap_range(off_t offset) {
+update_mmap_range(off_t offset, int initial) {
 off_t start_offset;
 off_t map_size;
 off_t max_offset = get_max_file_offset();
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -258,10 +258,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; update_mmap_range(off_t offset) {
      info-&amp;gt;fd_memory, start_offset);
 
 if (info-&amp;gt;mmap_buf == MAP_FAILED) {
-ERRMSG("Can't map [%llx-%llx] with mmap()\n %s",
-       (ulonglong)start_of&lt;/pre&gt;</description>
    <dc:creator>Cliff Wickman</dc:creator>
    <dc:date>2013-05-15T18:43:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8699">
    <title>[PATCH] makedumpfile: non-cyclic default</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8699</link>
    <description>&lt;pre&gt;From: Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

Make non-cyclic the default, as it is faster.

Dumping a 1TB memory is successful with a crashkernel=512M.
And allow -Y on the command line, as well as --non-cylic.

Signed-off-by: Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 makedumpfile.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Index: makedumpfile.mmap/makedumpfile.c
===================================================================
--- makedumpfile.mmap.orig/makedumpfile.c
+++ makedumpfile.mmap/makedumpfile.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -8585,13 +8585,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; main(int argc, char *argv[])
 initialize_tables();
 
 /*
- * By default, makedumpfile works in constant memory space.
+ * By default, makedumpfile makes one pass through page structures.
+ * Use --cyclic-buffer to work in constant memory space.
  */
-info-&amp;gt;flag_cyclic = TRUE;
+info-&amp;gt;flag_cyclic = FALSE;
 
 info-&amp;gt;block_order = DEFAULT_ORDER;
 message_level = DEFAULT_MSG_LEVEL;
-while ((opt = getopt_long(argc, argv, "b:cDd:EF&lt;/pre&gt;</description>
    <dc:creator>Cliff Wickman</dc:creator>
    <dc:date>2013-05-15T18:43:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8698">
    <title>[PATCH] makedumpfile: turn off mmap for free page scan</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8698</link>
    <description>&lt;pre&gt;From: Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

Because addresses of each successive page structure are often descending
it is much faster to use read()'s, so set off info-&amp;gt;flag_usemmap
while doing exclude_free_page().

Signed-off-by: Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 makedumpfile.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Index: makedumpfile.mmap/makedumpfile.c
===================================================================
--- makedumpfile.mmap.orig/makedumpfile.c
+++ makedumpfile.mmap/makedumpfile.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -3925,9 +3925,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; _exclude_free_page(void)
 return TRUE;
 }
 
+/*
+ * Note that this is a very lengthy process, even using mmap(2). The
+ * page structures in the free lists are read one-at-a-time, but using
+ * readpage_elf(), which reads an entire page.  And addresses of each
+ * successive page structure are often descending, which means that each
+ * read is another mmap(2) operation.
+ * It is much faster to use read()'s, so set off inf&lt;/pre&gt;</description>
    <dc:creator>Cliff Wickman</dc:creator>
    <dc:date>2013-05-15T18:43:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8697">
    <title>[PATCH] makedumpfile: warn on vmlinux without dwarf</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8697</link>
    <description>&lt;pre&gt;From: Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

If the vmlinux does not have dwarf information makedumpfile fails in
a rather obscure way, with a flood of redundant errors,

Make it fail with more of a hint of what is wrong.

Signed-off-by: Cliff Wickman &amp;lt;cpw-sJ/iWh9BUns&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 dwarf_info.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: makedumpfile.mmap/dwarf_info.c
===================================================================
--- makedumpfile.mmap.orig/dwarf_info.c
+++ makedumpfile.mmap/dwarf_info.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -139,6 +139,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; process_module (Dwfl_Module *dwflmod,
 
 /* get a debug context descriptor.*/
 dwarf_info.dwarfd = dwfl_module_getdwarf (dwflmod, &amp;amp;dwbias);
+if (dwarf_info.dwarfd == NULL) {
+fprintf(stderr, "makedumpfile: dwfl_module_getdwarf error\n");
+exit(1);
+}
 dwarf_info.elfd = dwarf_getelf(dwarf_info.dwarfd);
 
 mod_name = dwfl_module_info(dwflmod, NULL, NULL, NULL, NULL, NULL,
&lt;/pre&gt;</description>
    <dc:creator>Cliff Wickman</dc:creator>
    <dc:date>2013-05-15T18:43:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8695">
    <title>Re: Kernel panics when using kexec for rebooting</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8695</link>
    <description>&lt;pre&gt;

Some hardware does not respect the bus master bit.  I assume that Mellanox
has that problem.

Eric
&lt;/pre&gt;</description>
    <dc:creator>Eric W. Biederman</dc:creator>
    <dc:date>2013-05-15T16:53:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8694">
    <title>Re: Kernel panics when using kexec for rebooting</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8694</link>
    <description>&lt;pre&gt;On Tue, May 14, 2013 at 6:14 PM, Eric W. Biederman
&amp;lt;ebiederm-aS9lmoZGLiVWk0Htik3J/w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:


Removing the infiniband drivers in /etc/init.d/halt right before the
kexec -e definitely seems to have done the trick. Thanks!

My follow up question is, if we are clearing the bus master DMA bit,
why are the Mellanox not reset or at least stop doing DMA until the
driver is loaded again? Is this a case of the Mellanox hardware
needing an extra poke to do the right thing?

--dlloyd
&lt;/pre&gt;</description>
    <dc:creator>Dave Lloyd</dc:creator>
    <dc:date>2013-05-15T15:50:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8693">
    <title>Re: [PATCH] kexec: check if memory is reserved only when loading kdump kernel.</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8693</link>
    <description>&lt;pre&gt;
Thanks, applied.
&lt;/pre&gt;</description>
    <dc:creator>Simon Horman</dc:creator>
    <dc:date>2013-05-15T00:35:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8682">
    <title>Re: Kernel panics when using kexec for rebooting</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8682</link>
    <description>&lt;pre&gt;On Tue, May 14, 2013 at 5:01 PM, Eric W. Biederman
&amp;lt;ebiederm-aS9lmoZGLiVWk0Htik3J/w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:


Thank goodness it's not just me! :-)


I'm trying this now. In one panic, the pte referenced was
0x100010000000000 which sure looks a whole like someone wrote his
registers in there. It certainly doesn't look like a valid pte.

So far, unloading pata_acpi and pata_amd seem to have eliminated the
ACPI exception messages. I believe that this resets the device
properly. Unfortunately, it looks like lots of drivers don't implement
the pci_driver-&amp;gt;shutdown call, so it would make sense that this is a
relatively widespread problem.

--dlloyd
&lt;/pre&gt;</description>
    <dc:creator>Dave Lloyd</dc:creator>
    <dc:date>2013-05-14T22:25:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8679">
    <title>Re: makedumpfile: question about memory hole</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8679</link>
    <description>&lt;pre&gt;
Thanks for your investigation. I'm now very clear to what's happening there.

&lt;/pre&gt;</description>
    <dc:creator>HATAYAMA Daisuke</dc:creator>
    <dc:date>2013-05-15T01:00:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8678">
    <title>Re: Kernel panics when using kexec for rebooting</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8678</link>
    <description>&lt;pre&gt;

Oh. Yeah.  IB definitely sets up memory for ongoing dma.  So if it
doesn't have a shutdown method and IB traffic comes in during boot just
about anything cood happen.


Maybe.  Or it might be luck of timing, which memory was stomped when
incomming IB packets stomped on memory.

Eric
&lt;/pre&gt;</description>
    <dc:creator>Eric W. Biederman</dc:creator>
    <dc:date>2013-05-14T23:14:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8677">
    <title>Re: Kernel panics when using kexec for rebooting</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8677</link>
    <description>&lt;pre&gt;On Tue, May 14, 2013 at 5:33 PM, Eric W. Biederman
&amp;lt;ebiederm-aS9lmoZGLiVWk0Htik3J/w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

It could certainly be buggy hardware. Other details include:

Kernel 3.0.29.0 and we are also using infiniband (which I believe I
found a reference to the Mellanox hardware potentially causing this
issue unless the driver was unloaded before reboot with kexec). The
potential issue with unloading the IB drivers doesn't bug me nearly as
much as not unloading pata_amd and pata_acpi causing the ACPI Error
messages upon reboot with kexec.

I'm inclined to chalk the ACPI Error mesages up to potentially buggy
BIOS/hardware from the vendor since pata_amd and pata_acpi are in wide
use and I would expect to see more issues reported were there truly an
issue with rebooting with kexec and not unloading pata_amd and
pata_acpi.


Interesting. Thanks for the information. I have to admit, this part of
the kernel is a bit of a mystery to me.

--dlloyd
&lt;/pre&gt;</description>
    <dc:creator>Dave Lloyd</dc:creator>
    <dc:date>2013-05-14T22:57:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8676">
    <title>Re: Kernel panics when using kexec for rebooting</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8676</link>
    <description>&lt;pre&gt;

It is a classic issue, although I suspect something is unique in your
setup because it has (to my knowledge) not been a widespread problem for
years.


Most devices don't leave dma setup if you reboot, and even more the
generic pci clears the bus master DMA bit which shuts down a lot more
dma.

So the actual lack of a shutdown method is not as much of an issue as it
might appear.

Eric
&lt;/pre&gt;</description>
    <dc:creator>Eric W. Biederman</dc:creator>
    <dc:date>2013-05-14T22:33:29</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8674">
    <title>Re: Kernel panics when using kexec for rebooting</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8674</link>
    <description>&lt;pre&gt;

Yes this does seem to be all over the place, and memory corruption
probably caused by ongoing-dma seems like a reasonable hypothesis.

The easy first thing to try is to remove all of your kernel modules
before you reboot with kexec.  Not infrequently the module remove path
is better tested than the device shutdown path.

Eric
&lt;/pre&gt;</description>
    <dc:creator>Eric W. Biederman</dc:creator>
    <dc:date>2013-05-14T22:01:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8665">
    <title>[PATCH] kexec: check if memory is reserved only when loading kdump kernel.</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8665</link>
    <description>&lt;pre&gt;When memory for crashkernel isn't reserved, it's confusing that kexec
spits error message for unloading kdump kernel as if we were loading it:

  # kexec -p -u
  Memory for crashkernel is not reserved
  Please reserve memory by passing "crashkernel=X&amp;lt; at &amp;gt;Y" parameter to the kernel
  Then try loading kdump kernel
  # echo $?
  1

It's more appropriate to test if memory is reserved only when
loading kdump kernel. With this patch:

  # kexec -p -u
  # echo $?
  0

It's also the same behavior with the case of trying to unload kernel
from unloaded state.

Signed-off-by: WANG Chao &amp;lt;chaowang-H+wXaHxf7aLQT0dZR+AlfA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 kexec/kexec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kexec/kexec.c b/kexec/kexec.c
index 911c0f6..6a13f79 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1175,7 +1175,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(int argc, char *argv[])
 }
 }
 
-if ((kexec_flags &amp;amp; KEXEC_ON_CRASH) &amp;amp;&amp;amp; !is_crashkernel_mem_reserved()) {
+if (do_load &amp;amp;&amp;amp; (kexec_flags &amp;amp; KEXEC_ON_CRASH) &amp;amp;&amp;amp;
+    !is_cras&lt;/pre&gt;</description>
    <dc:creator>WANG Chao</dc:creator>
    <dc:date>2013-05-14T10:32:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8663">
    <title>Re: [PATCH] kexec: Replace printf() with die() to error out to stderr</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8663</link>
    <description>&lt;pre&gt;于 2013年05月14日 11:56, WANG Chao 写道:

Looks good to me.

Acked-by: Zhang Yanfei &amp;lt;zhangyanfei&amp;lt; at &amp;gt;cn.fujitsu.com&amp;gt;



_______________________________________________
kexec mailing list
kexec&amp;lt; at &amp;gt;lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
&lt;/pre&gt;</description>
    <dc:creator>Zhang Yanfei</dc:creator>
    <dc:date>2013-05-14T04:35:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8662">
    <title>Re: [PATCH] kexec: Replace printf() with die() to error out to stderr</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8662</link>
    <description>&lt;pre&gt;
Thanks, applied.
&lt;/pre&gt;</description>
    <dc:creator>Simon Horman</dc:creator>
    <dc:date>2013-05-14T04:35:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.kernel.kexec/8661">
    <title>[PATCH] kexec: Replace printf() with die() to error out to stderr</title>
    <link>http://permalink.gmane.org/gmane.linux.kernel.kexec/8661</link>
    <description>&lt;pre&gt;Error messages are mixed stderr with stdout when we use die() along with
printf(). So use die() to keep error out consistent.

Signed-off-by: WANG Chao &amp;lt;chaowang-H+wXaHxf7aLQT0dZR+AlfA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 kexec/kexec.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/kexec/kexec.c b/kexec/kexec.c
index 53d6edc..911c0f6 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1176,17 +1176,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(int argc, char *argv[])
 }
 
 if ((kexec_flags &amp;amp; KEXEC_ON_CRASH) &amp;amp;&amp;amp; !is_crashkernel_mem_reserved()) {
-printf("Memory for crashkernel is not reserved\n");
-printf("Please reserve memory by passing ");
-printf("\"crashkernel=X&amp;lt; at &amp;gt;Y\" parameter to the kernel\n");
-die("Then try loading kdump kernel\n");
+die("Memory for crashkernel is not reserved\n"
+    "Please reserve memory by passing"
+    "\"crashkernel=X&amp;lt; at &amp;gt;Y\" parameter to kernel\n"
+    "Then try to loading kdump kernel\n");
 }
 
 if (do_load &amp;amp;&amp;amp; (kexec_flags &amp;amp; KEXEC_PRESERVE_CONTEXT) &amp;amp;&amp;amp;
     mem_max == ULON&lt;/pre&gt;</description>
    <dc:creator>WANG Chao</dc:creator>
    <dc:date>2013-05-14T03:56:48</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.linux.kernel.kexec">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.kernel.kexec</link>
  </textinput>
</rdf:RDF>
