All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Vernon Lovejoy <vlovejoy@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/show_trace_log_lvl: ensure stack pointer is aligned, again
Date: Fri, 28 Apr 2023 08:55:13 +0200	[thread overview]
Message-ID: <20230428065513.GA22111@redhat.com> (raw)
In-Reply-To: <20230428043158.r5omehiaqawcac2y@treble>

On 04/27, Josh Poimboeuf wrote:
>
> On Thu, Apr 27, 2023 at 04:00:54PM +0200, Oleg Nesterov wrote:
> > +	stack = PTR_ALIGN(stack, sizeof(long));
> >  	for ( ; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
> >  		const char *stack_name;
>
> Seems reasonable, though 'stack' is already initialized a few lines
> above this, so it would be cleaner to do the PTR_ALIGN then.  Or even
> better, just move it all to the for loop:
>
> 	for (stack = PTR_ALIGN(stack ? : get_stack_pointer(task, regs));
> 	     stack;
> 	     stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {

We decided to make the simplest one-liner fix, but I was thinking about

	for ( stack = stack ? : get_stack_pointer(task, regs);
	     (stack = PTR_ALIGN(stack, sizeof(long)));
	      stack = stack_info.next_sp)
	{
		...

to factout out the annoying PTR_ALIGN(). Will it work for you?

Oleg.


  reply	other threads:[~2023-04-28  6:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 14:00 [PATCH] x86/show_trace_log_lvl: ensure stack pointer is aligned, again Oleg Nesterov
2023-04-28  4:31 ` Josh Poimboeuf
2023-04-28  6:55   ` Oleg Nesterov [this message]
2023-04-28 23:57     ` Josh Poimboeuf
2023-04-29 10:08       ` Oleg Nesterov
2023-04-30 11:59       ` David Laight
2023-04-30 19:00         ` Oleg Nesterov
2023-05-12  2:20         ` Josh Poimboeuf
2023-05-12 10:43           ` Oleg Nesterov

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=20230428065513.GA22111@redhat.com \
    --to=oleg@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vlovejoy@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.