LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
	"Michael Ellerman" <mpe@ellerman.id.au>
Cc: Jordan Niethe <jniethe5@gmail.com>,
	linuxppc-dev@lists.ozlabs.org,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH 3/5] powerpc/kprobes: Use preempt_enable() rather than the no_resched variant
Date: Mon, 07 Nov 2022 20:29:56 +1000	[thread overview]
Message-ID: <CO5ZS71V6MJL.1IWT63LG32HL9@bobo> (raw)
In-Reply-To: <72639f75fe66f931ec8c2165276ffbfb0fe1006f.1666262278.git.naveen.n.rao@linux.vnet.ibm.com>

On Fri Oct 21, 2022 at 3:28 AM AEST, Naveen N. Rao wrote:
> preempt_enable_no_resched() is just the same as preempt_enable() when we
> are in a irqs disabled context. kprobe_handler() and the post/fault
> handlers are all called with irqs disabled. As such, convert those to
> just use preempt_enable().

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

>
> Reported-by: Nicholas Piggin <npiggin@gmail.com>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> ---
>  arch/powerpc/kernel/kprobes.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
> index 88f42de681e1f8..86ca5a61ea9afb 100644
> --- a/arch/powerpc/kernel/kprobes.c
> +++ b/arch/powerpc/kernel/kprobes.c
> @@ -369,7 +369,7 @@ int kprobe_handler(struct pt_regs *regs)
>  
>  			if (ret > 0) {
>  				restore_previous_kprobe(kcb);
> -				preempt_enable_no_resched();
> +				preempt_enable();
>  				return 1;
>  			}
>  		}
> @@ -382,7 +382,7 @@ int kprobe_handler(struct pt_regs *regs)
>  	if (p->pre_handler && p->pre_handler(p, regs)) {
>  		/* handler changed execution path, so skip ss setup */
>  		reset_current_kprobe();
> -		preempt_enable_no_resched();
> +		preempt_enable();
>  		return 1;
>  	}
>  
> @@ -395,7 +395,7 @@ int kprobe_handler(struct pt_regs *regs)
>  
>  			kcb->kprobe_status = KPROBE_HIT_SSDONE;
>  			reset_current_kprobe();
> -			preempt_enable_no_resched();
> +			preempt_enable();
>  			return 1;
>  		}
>  	}
> @@ -404,7 +404,7 @@ int kprobe_handler(struct pt_regs *regs)
>  	return 1;
>  
>  no_kprobe:
> -	preempt_enable_no_resched();
> +	preempt_enable();
>  	return ret;
>  }
>  NOKPROBE_SYMBOL(kprobe_handler);
> @@ -490,7 +490,7 @@ int kprobe_post_handler(struct pt_regs *regs)
>  	}
>  	reset_current_kprobe();
>  out:
> -	preempt_enable_no_resched();
> +	preempt_enable();
>  
>  	/*
>  	 * if somebody else is singlestepping across a probe point, msr
> @@ -529,7 +529,7 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
>  			restore_previous_kprobe(kcb);
>  		else
>  			reset_current_kprobe();
> -		preempt_enable_no_resched();
> +		preempt_enable();
>  		break;
>  	case KPROBE_HIT_ACTIVE:
>  	case KPROBE_HIT_SSDONE:
> -- 
> 2.38.0


  reply	other threads:[~2022-11-07 10:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 17:28 [PATCH 0/5] powerpc/kprobes: preempt related changes and cleanups Naveen N. Rao
2022-10-20 17:28 ` [PATCH 1/5] powerpc/kprobes: Remove preempt disable around call to get_kprobe() in arch_prepare_kprobe() Naveen N. Rao
2022-11-07 10:14   ` Nicholas Piggin
2022-11-08 10:33     ` Naveen N. Rao
2022-10-20 17:28 ` [PATCH 2/5] powerpc/kprobes: Have optimized_callback() use preempt_enable() Naveen N. Rao
2022-11-07 10:18   ` Nicholas Piggin
2022-10-20 17:28 ` [PATCH 3/5] powerpc/kprobes: Use preempt_enable() rather than the no_resched variant Naveen N. Rao
2022-11-07 10:29   ` Nicholas Piggin [this message]
2022-10-20 17:29 ` [PATCH 4/5] powerpc/kprobes: Setup consistent pt_regs across kprobes, optprobes and KPROBES_ON_FTRACE Naveen N. Rao
2022-11-07 11:15   ` Nicholas Piggin
2022-11-08 10:52     ` Naveen N. Rao
2022-10-20 17:29 ` [PATCH 5/5] powerpc/kprobes: Remove unnecessary headers from kprobes Naveen N. Rao
2022-11-02  8:36   ` Christophe Leroy
2022-11-08 10:06     ` Naveen N. Rao
2022-11-07 11:24 ` [PATCH 0/5] powerpc/kprobes: preempt related changes and cleanups Nicholas Piggin
2022-11-30  9:24 ` (subset) " Michael Ellerman

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=CO5ZS71V6MJL.1IWT63LG32HL9@bobo \
    --to=npiggin@gmail.com \
    --cc=jniethe5@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mhiramat@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.vnet.ibm.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