All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atsushi Kumagai <ats-kumagai@wm.jp.nec.com>
To: Pratyush Anand <panand@redhat.com>
Cc: "dyoung@redhat.com" <dyoung@redhat.com>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"bhe@redhat.com" <bhe@redhat.com>
Subject: RE: [Makedumpfile Patch v3 7/7] mem-usage: allow to work only with -f for kernel version < 4.11
Date: Fri, 3 Mar 2017 02:10:28 +0000	[thread overview]
Message-ID: <0910DD04CBD6DE4193FCF86B9C00BE9701EAABEE@BPXM01GP.gisp.nec.co.jp> (raw)
In-Reply-To: <6689d9cf1e69f79b0e8c74ecab8e003e5507a79b.1488443170.git.panand@redhat.com>

>PT_LOAD of kcore does not have valid p_paddr values for kernel version
>less that v4.11. Therefore, older kernel will no long work for mem-usage
>with current makedumpfile code. They can only work when they are patched
>with fix to "update physical address for kcore ram and text".
>
>This patch fixes the makedumpfile so that it does not allow to work
>older kernel for --mem-usage until someone is sure that kernel is
>rightly patched and so uses -f in command line. It also updates man page
>and usage info accordingly.
>
>Signed-off-by: Pratyush Anand <panand@redhat.com>
>---
> makedumpfile.8 | 9 ++++++++-
> makedumpfile.c | 6 ++++++
> print_info.c   | 3 ++-
> 3 files changed, 16 insertions(+), 2 deletions(-)
>
>diff --git a/makedumpfile.8 b/makedumpfile.8
>index 9069fb18cdb6..993236486e77 100644
>--- a/makedumpfile.8
>+++ b/makedumpfile.8
>@@ -235,13 +235,20 @@ the ELF format does not support compressed data.
>
> .TP
> \fB\-f\fR
>-Force existing DUMPFILE to be overwritten.
>+Force existing DUMPFILE to be overwritten and mem-usage to work with older
>+kernel as well.
> .br
> .B Example:
> .br
> # makedumpfile \-f \-d 31 \-x vmlinux /proc/vmcore dumpfile
> .br
> This command overwrites \fIDUMPFILE\fR even if it already exists.
>+.br
>+# makedumpfile \-f \-\-mem\-usage /proc/kcore
>+.br
>+Kernel version lesser than v4.11 will not work with \-\-mem\-usage
>+functionality until it has been patched with upstream commit 464920104bf7.
>+Therefore if you have patched your older kernel then use \-f.
>
> .TP
> \fB\-x\fR \fIVMLINUX\fR
>diff --git a/makedumpfile.c b/makedumpfile.c
>index 3b8e9810468d..e3be1ab0a9ec 100644
>--- a/makedumpfile.c
>+++ b/makedumpfile.c
>@@ -11269,6 +11269,12 @@ main(int argc, char *argv[])
> 			MSG("Try `makedumpfile --help' for more information.\n");
> 			goto out;
> 		}
>+		if (info->kernel_version < KERNEL_VERSION(4, 11, 0) &&
>+				!info->flag_force) {
>+			MSG("mem-usage not supported for this kernel.\n");
>+			MSG("You can try with -f if your kernel's kcore has valid p_paddr\n");
>+			goto out;
>+		}

You forgot to set COMPLETED to retcd before goto.
The behavior will be different from the v2 patch.


Thanks,
Atsushi Kumagai

>
> 		if (!show_mem_usage())
> 			goto out;
>diff --git a/print_info.c b/print_info.c
>index 392d863a4227..72ed8fa0c059 100644
>--- a/print_info.c
>+++ b/print_info.c
>@@ -309,7 +309,8 @@ print_usage(void)
> 	MSG("      Print debugging message.\n");
> 	MSG("\n");
> 	MSG("  [-f]:\n");
>-	MSG("      Overwrite DUMPFILE even if it already exists.\n");
>+	MSG("      Overwrite DUMPFILE even if it already exists\n");
>+	MSG("      Force mem-usage to work with older kernel as well.\n");
> 	MSG("\n");
> 	MSG("  [-h, --help]:\n");
> 	MSG("      Show help message and LZO/snappy support status (enabled/disabled).\n");
>--
>2.9.3
>


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2017-03-03  2:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02  8:36 [Makedumpfile Patch v3 0/7] Fix --mem-usage /proc/kcore Pratyush Anand
2017-03-02  8:36 ` [Makedumpfile Patch v3 1/7] show_mem_usage(): calculate page offset after elf load Pratyush Anand
2017-03-02  8:36 ` [Makedumpfile Patch v3 2/7] initial(): call cach_init() a bit early Pratyush Anand
2017-07-19  7:46   ` Atsushi Kumagai
2017-07-19 11:20     ` Pratyush Anand
2017-07-20  6:54       ` Atsushi Kumagai
2017-07-20  8:01         ` Hatayama, Daisuke
2017-03-02  8:36 ` [Makedumpfile Patch v3 3/7] x86_64: check physical address in PT_LOAD for none direct mapped regions Pratyush Anand
2017-03-02  8:36 ` [Makedumpfile Patch v3 4/7] elf_info: kcore: check for invalid physical address Pratyush Anand
2017-03-02  8:36 ` [Makedumpfile Patch v3 5/7] makedumpfile: Correct the calculation of kvaddr in set_kcore_vmcoreinfo Pratyush Anand
2017-03-02  8:36 ` [Makedumpfile Patch v3 6/7] makedumpfile: Discard process_dump_load Pratyush Anand
2017-03-02  8:36 ` [Makedumpfile Patch v3 7/7] mem-usage: allow to work only with -f for kernel version < 4.11 Pratyush Anand
2017-03-03  2:10   ` Atsushi Kumagai [this message]
2017-03-03  2:48     ` Pratyush Anand
2017-03-03  3:07       ` bhe
2017-03-03  4:35         ` Atsushi Kumagai
2017-03-03  4:56           ` Pratyush Anand

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=0910DD04CBD6DE4193FCF86B9C00BE9701EAABEE@BPXM01GP.gisp.nec.co.jp \
    --to=ats-kumagai@wm.jp.nec.com \
    --cc=bhe@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=panand@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.