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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151102222721.GC10949@danjae.kornet>
Date:	Tue, 3 Nov 2015 07:27:21 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	lkml <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Mohit Agrawal <moagrawa@...hat.com>
Subject: Re: [PATCH] perf sched latency: Fix removed thread issue

On Mon, Nov 02, 2015 at 12:10:25PM +0100, Jiri Olsa wrote:
> If machine's thread gets excited (EXIT event is received),

Why a thread get *excited* when it received EXIT event? :)


> we set thread->dead = true and it is later on removed from
> machine's tree if the pid is reused on new thread.
> 
> The latency subcommand holds tree of working atoms sorted
> by thread's pid/tid. If there's new thread with same pid
> and tid, the old working atom is found and assert bug
> condition is hit in search function:
> 
>   thread_atoms_search: Assertion `!(thread != atoms->thread)' failed
> 
> Changing the sort function to use thread object pointers
> together with pid and tid check. This way new thread will
> never find old one with same pid/tid.
> 
> I think we could change this to the sort based on timestamp
> of thread creation, once it's added within Namhyung's thread
> patchset.

Right.  I'll work on the v6 soon.

As a work around:

Acked-by: Namhyung Kim <namhyung@...nel.org>

Thanks,
Namhyung


> 
> Reported-by: Mohit Agrawal <moagrawa@...hat.com>
> Link: http://lkml.kernel.org/n/tip-o4doazhhv0zax5zshkg8hnys@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
>  tools/perf/builtin-sched.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 0ee6d900e100..e3d3e32c0a93 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -1203,12 +1203,13 @@ static void output_lat_thread(struct perf_sched *sched, struct work_atoms *work_
>  
>  static int pid_cmp(struct work_atoms *l, struct work_atoms *r)
>  {
> +	if (l->thread == r->thread)
> +		return 0;
>  	if (l->thread->tid < r->thread->tid)
>  		return -1;
>  	if (l->thread->tid > r->thread->tid)
>  		return 1;
> -
> -	return 0;
> +	return (int)(l->thread - r->thread);
>  }
>  
>  static int avg_cmp(struct work_atoms *l, struct work_atoms *r)
> -- 
> 2.4.3
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ