From: Baoquan He <bhe@redhat.com>
To: Pingfan Liu <piliu@redhat.com>
Cc: Dave Young <dyoung@redhat.com>,
kexec@lists.infradead.org, kernelfans@gmail.com
Subject: Re: [PATCH 1/2] kexec: add a dummy note for each offline cpu
Date: Wed, 14 Dec 2016 15:40:46 +0800 [thread overview]
Message-ID: <20161214074046.GP1034@x1> (raw)
In-Reply-To: <1481695887-21090-1-git-send-email-piliu@redhat.com>
On 12/14/16 at 02:11pm, Pingfan Liu wrote:
> kexec-tools always allocates program headers for each possible cpu. This
> incurs zero PT_NOTE for offline cpu. We mark this case so that later,
> the capture kernel can distinguish it from the mistake of allocated
> program header.
> The counterpart of the capture kernel comes in next patch.
When you execute dmesg on your testing machine and grep nr_cpu_ids,
what's the value of nr_cpu_ids?
>
> Signed-off-by: Pingfan Liu <piliu@redhat.com>
> ---
> This unnecessary warning buzz on all archs when there is offline cpu
>
> include/uapi/linux/elf.h | 1 +
> kernel/kexec_core.c | 9 +++++++++
> 2 files changed, 10 insertions(+)
>
> diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
> index b59ee07..9744f1e 100644
> --- a/include/uapi/linux/elf.h
> +++ b/include/uapi/linux/elf.h
> @@ -367,6 +367,7 @@ typedef struct elf64_shdr {
> * using the corresponding note types via the PTRACE_GETREGSET and
> * PTRACE_SETREGSET requests.
> */
> +#define NT_DUMMY 0
> #define NT_PRSTATUS 1
> #define NT_PRFPREG 2
> #define NT_PRPSINFO 3
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index 5616755..aeac16e 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -891,9 +891,12 @@ void __crash_kexec(struct pt_regs *regs)
> if (mutex_trylock(&kexec_mutex)) {
> if (kexec_crash_image) {
> struct pt_regs fixed_regs;
> + unsigned int cpu;
>
> crash_setup_regs(&fixed_regs, regs);
> crash_save_vmcoreinfo();
> + for_each_cpu_not(cpu, cpu_online_mask)
> + crash_save_cpu(NULL, cpu);
> machine_crash_shutdown(&fixed_regs);
> machine_kexec(kexec_crash_image);
> }
> @@ -1040,6 +1043,12 @@ void crash_save_cpu(struct pt_regs *regs, int cpu)
> buf = (u32 *)per_cpu_ptr(crash_notes, cpu);
> if (!buf)
> return;
> + if (regs == NULL) {
> + buf = append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_DUMMY,
> + NULL, 0);
> + final_note(buf);
> + return;
> + }
> memset(&prstatus, 0, sizeof(prstatus));
> prstatus.pr_pid = current->pid;
> elf_core_copy_kernel_regs(&prstatus.pr_reg, regs);
> --
> 2.7.4
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2016-12-14 7:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 6:11 [PATCH 1/2] kexec: add a dummy note for each offline cpu Pingfan Liu
2016-12-14 6:11 ` [PATCH 2/2] [fs] proc/vmcore: check the dummy place holder for offline cpu to avoid warning Pingfan Liu
2016-12-14 23:56 ` Xunlei Pang
2016-12-15 3:04 ` Liu ping fan
2016-12-14 6:19 ` [PATCH 1/2] kexec: add a dummy note for each offline cpu Liu ping fan
2016-12-14 7:40 ` Baoquan He [this message]
2016-12-14 8:15 ` Liu ping fan
2016-12-14 8:25 ` Baoquan He
2016-12-14 8:39 ` Liu ping fan
2016-12-14 8:44 ` Baoquan He
2016-12-14 9:06 ` Liu ping fan
2016-12-14 8:48 ` Xunlei Pang
2016-12-14 8:56 ` Liu ping fan
2016-12-14 9:10 ` Xunlei Pang
2016-12-14 9:13 ` Liu ping fan
2016-12-14 23:49 ` Xunlei Pang
2016-12-15 7:16 ` Dave Young
2016-12-15 8:43 ` Liu ping fan
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=20161214074046.GP1034@x1 \
--to=bhe@redhat.com \
--cc=dyoung@redhat.com \
--cc=kernelfans@gmail.com \
--cc=kexec@lists.infradead.org \
--cc=piliu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox