public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] uprobes: Improve scalability by reducing the contention on siglock
       [not found]               ` <20240808102837.GC8020@redhat.com>
@ 2024-08-08 12:31                 ` Liao, Chang
  2024-08-08 13:17                   ` Oleg Nesterov
  0 siblings, 1 reply; 2+ messages in thread
From: Liao, Chang @ 2024-08-08 12:31 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: mhiramat, peterz, mingo, acme, namhyung, mark.rutland,
	alexander.shishkin, jolsa, irogers, adrian.hunter, kan.liang,
	linux-kernel, linux-trace-kernel, linux-perf-users, bpf,
	Andrii Nakryiko, Masami Hiramatsu, Steven Rostedt, paulmck



在 2024/8/8 18:28, Oleg Nesterov 写道:
> On 08/08, Liao, Chang wrote:
>>
>>   - pre_ssout() resets the deny signal flag
>>
>>   - uprobe_deny_signal() sets the deny signal flag when TIF_SIGPENDING is cleared.
>>
>>   - handle_singlestep() check the deny signal flag and restore TIF_SIGPENDING if necessary.
>>
>> Does this approach look correct to you,do do you have any other way to implement the "flag"?
> 
> Yes. But I don't think pre_ssout() needs to clear this flag. handle_singlestep() resets/clears
> state, active_uprobe, frees insn slot. So I guess we only need
> 
> 
> --- x/kernel/events/uprobes.c
> +++ x/kernel/events/uprobes.c
> @@ -2308,9 +2308,10 @@ static void handle_singlestep(struct upr
>  	utask->state = UTASK_RUNNING;
>  	xol_free_insn_slot(current);
>  
> -	spin_lock_irq(&current->sighand->siglock);
> -	recalc_sigpending(); /* see uprobe_deny_signal() */
> -	spin_unlock_irq(&current->sighand->siglock);
> +	if (utask->xxx) {
> +		set_thread_flag(TIF_SIGPENDING);
> +		utask->xxx = 0;
> +	}

Agree, if no more discussion about this flag, I will just send v2 today.

Thanks.

>  
>  	if (unlikely(err)) {
>  		uprobe_warn(current, "execute the probed insn, sending SIGILL.");
> 
> and that is all.
> 
> Oleg.
> 
> 

-- 
BR
Liao, Chang

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] uprobes: Improve scalability by reducing the contention on siglock
  2024-08-08 12:31                 ` [PATCH] uprobes: Improve scalability by reducing the contention on siglock Liao, Chang
@ 2024-08-08 13:17                   ` Oleg Nesterov
  0 siblings, 0 replies; 2+ messages in thread
From: Oleg Nesterov @ 2024-08-08 13:17 UTC (permalink / raw)
  To: Liao, Chang
  Cc: mhiramat, peterz, mingo, acme, namhyung, mark.rutland,
	alexander.shishkin, jolsa, irogers, adrian.hunter, kan.liang,
	linux-kernel, linux-trace-kernel, linux-perf-users, bpf,
	Andrii Nakryiko, Steven Rostedt, paulmck

On 08/08, Liao, Chang wrote:
>
>
> 在 2024/8/8 18:28, Oleg Nesterov 写道:
> > --- x/kernel/events/uprobes.c
> > +++ x/kernel/events/uprobes.c
> > @@ -2308,9 +2308,10 @@ static void handle_singlestep(struct upr
> >  	utask->state = UTASK_RUNNING;
> >  	xol_free_insn_slot(current);
> >
> > -	spin_lock_irq(&current->sighand->siglock);
> > -	recalc_sigpending(); /* see uprobe_deny_signal() */
> > -	spin_unlock_irq(&current->sighand->siglock);
> > +	if (utask->xxx) {
> > +		set_thread_flag(TIF_SIGPENDING);
> > +		utask->xxx = 0;
> > +	}
>
> Agree, if no more discussion about this flag, I will just send v2 today.

Please also resend the previous patch a 1/2, this one as 2/2.

Oleg.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-08 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240801082407.1618451-1-liaochang1@huawei.com>
     [not found] ` <20240801140639.GE4038@redhat.com>
     [not found]   ` <51a756b7-3c2f-9aeb-1418-b38b74108ee6@huawei.com>
     [not found]     ` <20240802092406.GC12343@redhat.com>
     [not found]       ` <0c69ef28-26d8-4b6e-fa78-2211a7b84eca@huawei.com>
     [not found]         ` <20240806172529.GC20881@redhat.com>
     [not found]           ` <20240807101746.GA27715@redhat.com>
     [not found]             ` <3bb87fb4-c32e-0a35-0e93-5e1971fe8268@huawei.com>
     [not found]               ` <20240808102837.GC8020@redhat.com>
2024-08-08 12:31                 ` [PATCH] uprobes: Improve scalability by reducing the contention on siglock Liao, Chang
2024-08-08 13:17                   ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox