lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <67720a34-7519-0974-1fe6-7200f1c59ae0@kernel.org>
Date:   Thu, 25 May 2023 19:00:41 +0200
From:   Daniel Bristot de Oliveira <bristot@...nel.org>
To:     linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
        Steven Rostedt <rostedt@...dmis.org>
Cc:     Juri Lelli <juri.lelli@...hat.com>,
        William White <chwhite@...hat.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Jonathan Corbet <corbet@....net>
Subject: Re: [PATCH V2 3/3] tracing/timerlat: Add user-space interface

[...]

>  
> +static void check_timerlat_user_migration(pid_t pid, long dest_cpu);
>  /*
>   * trace_sched_switch - sched:sched_switch trace event handler
>   *
> @@ -1196,6 +1199,9 @@ trace_sched_switch_callback(void *data, bool preempt,
>  	struct osnoise_variables *osn_var = this_cpu_osn_var();
>  	int workload = test_bit(OSN_WORKLOAD, &osnoise_options);
>  
> +	if (unlikely(workload && timerlat_enabled()))
> +		check_timerlat_user_migration(n->pid, smp_processor_id());
> +

it should be !workload, anyway, I will move this check to a sched_migrate_task
tracepoint because it runs less frequently and...

[...]

the tracepoint also informs the origin CPU, so it can be passed here:

> +
> +static void check_timerlat_user_migration(pid_t pid, long dest_cpu)
> +{
> +	struct osnoise_variables *osn_var;
> +	long cpu;
> +

and we can avoid this ugly loop.

> +	for_each_possible_cpu(cpu) {
> +		osn_var = per_cpu_ptr(&per_cpu_osnoise_var, cpu);
> +		if (osn_var->pid == pid && dest_cpu != cpu) {
> +			per_cpu_ptr(&per_cpu_timerlat_var, cpu)->uthread_migrate = 1;
> +			osnoise_taint("timerlat user thread migrate\n");
> +			osnoise_stop_tracing();
> +			break;
> +		}
> +	}

Lazy daniel should have had a look first, but at least now I know I also need
to do some ifdeffery.

-- Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ