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: <20190416193320.GC9247@kernel.org>
Date:   Tue, 16 Apr 2019 16:33:20 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Jiri Olsa <jolsa@...nel.org>
Cc:     lkml <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Andi Kleen <ak@...ux.intel.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Song Liu <songliubraving@...com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>
Subject: Re: [PATCH 08/12] perf tools: Fix side band thread draining

Em Tue, Apr 16, 2019 at 06:01:23PM +0200, Jiri Olsa escreveu:
> Current perf_evlist__poll_thread code could finish
> without draining the data. Adding the logic that
> makes sure we won't finish before the drain.
> 
> Fixes: 657ee5531903 ("perf evlist: Introduce side band thread")

Thanks, applied to perf/urgent.

- Arnaldo

> Link: http://lkml.kernel.org/n/tip-41i888xyim9n5ceyr44jb468@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
>  tools/perf/util/evlist.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index f2bbae38278d..4b6783ff5813 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -1868,12 +1868,12 @@ static void *perf_evlist__poll_thread(void *arg)
>  {
>  	struct perf_evlist *evlist = arg;
>  	bool draining = false;
> -	int i;
> +	int i, done = 0;
> +
> +	while (!done) {
> +		bool got_data = false;
>  
> -	while (draining || !(evlist->thread.done)) {
> -		if (draining)
> -			draining = false;
> -		else if (evlist->thread.done)
> +		if (evlist->thread.done)
>  			draining = true;
>  
>  		if (!draining)
> @@ -1894,9 +1894,13 @@ static void *perf_evlist__poll_thread(void *arg)
>  					pr_warning("cannot locate proper evsel for the side band event\n");
>  
>  				perf_mmap__consume(map);
> +				got_data = true;
>  			}
>  			perf_mmap__read_done(map);
>  		}
> +
> +		if (draining && !got_data)
> +			break;
>  	}
>  	return NULL;
>  }
> -- 
> 2.17.2

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ