From: Feng Tang <feng.tang@intel.com>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: <akpm@linux-foundation.org>, <bristot@redhat.com>,
<bsegall@google.com>, <dietmar.eggemann@arm.com>,
<juri.lelli@redhat.com>, <linux-kernel@vger.kernel.org>,
<mgorman@suse.de>, <mingo@redhat.com>, <peterz@infradead.org>,
<rostedt@goodmis.org>, <vbabka@suse.cz>,
<vincent.guittot@linaro.org>, <vschneid@redhat.com>,
<sparclinux@vger.kernel.org>
Subject: Re: sched/debug: Dump end of stack when detected corrupted
Date: Fri, 6 Sep 2024 19:47:35 +0800 [thread overview]
Message-ID: <Ztrr10sxYvQQGonC@feng-clx.sh.intel.com> (raw)
In-Reply-To: <20240906084546.3304-1-glaubitz@physik.fu-berlin.de>
Hi Andrian,
On Fri, Sep 06, 2024 at 10:45:46AM +0200, John Paul Adrian Glaubitz wrote:
> Hi Feng,
>
> > - if (task_stack_end_corrupted(prev))
> > + if (task_stack_end_corrupted(prev)) {
> > + unsigned long *ptr = end_of_stack(prev);
> > +
> > + /* Dump 16 ulong words around the corruption point */
> > +#ifdef CONFIG_STACK_GROWSUP
> > + ptr -= 15;
> > +#endif
> > + print_hex_dump(KERN_ERR, "Corrupted Stack: ",
> > + DUMP_PREFIX_ADDRESS, 16, 1, ptr, 16 * sizeof(*ptr), 1);
> > +
>
> I would recommend determining the buffer element size with sizeof(unsigned long) for
> better readability and using "true" instead of "1" to set the value of the ascii
> parameter to print_hex_dump(), see [1]. Otherwise looks good to me.
Thanks for the review! Yes, I can make that change.
> Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>
> PS: Please CC me for a potential v3.
Sure.
Thanks,
Feng
> Thanks,
> Adrian
>
> > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/hexdump.c#n252
next prev parent reply other threads:[~2024-09-06 11:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-19 3:22 [PATCH] " Feng Tang
2024-09-03 16:33 ` John Paul Adrian Glaubitz
2024-09-04 2:59 ` Feng Tang
2024-09-06 8:45 ` John Paul Adrian Glaubitz
2024-09-06 11:47 ` Feng Tang [this message]
2025-01-25 17:54 ` John Paul Adrian Glaubitz
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=Ztrr10sxYvQQGonC@feng-clx.sh.intel.com \
--to=feng.tang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sparclinux@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@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
all inboxes | Powered by JetHome®