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]
Date:   Wed, 14 Mar 2018 14:11:20 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Jason Vas Dias <jason.vas.dias@...il.com>
Cc:     x86@...nel.org, LKML <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        andi <andi@...stfloor.org>
Subject: Re: [PATCH v4.16-rc4 2/2] x86/vdso: on Intel, VDSO should handle
 CLOCK_MONOTONIC_RAW

On Wed, Mar 14, 2018 at 12:55:20PM +0000, Jason Vas Dias wrote:

> > So you can avoid the whole ioctl(ENABLE), ioctl(DISABLE) nonsense and
> > just let them run and do:
> >
> > 	read(group_fd, &buf_pre, size);
> > 	/* your code section */
> > 	read(group_fd, &buf_post, size);
> >
> > 	/* compute buf_post - buf_pre */
> >
> > Which is only 2 system calls, not 4.
> 
> But I can't, really - I am trying to restrict the
> performance counter measurements
> to only a subset of the code, and exclude
> performance measurement result processing  -
> so the timeline is like:

>                       struct timespec t_start, t_end;
>                       perf_event_open(...);
>                       thread_main_loop() { ... do {
>           t     _    clock_gettime(CLOCK_MONOTONIC_RAW, &t_start);
>           t+x _   enable_perf  ();
>                       total_work = do_some_work();
>                       disable_perf ();
>                       clock_gettime(CLOCK_MONOTONIC_RAW, &t_end);
>            t+y_
>                       read_perf_counters_and_store_results
>                        ( perf_grp_fd, &results ,  total_work,
>                          TS2T( &t_end ) - TS2T( &t_start)
>                         );
>            } while (.... );
>         }
> 
>    Now. here the bandwidth / performance results recorded by
>    my 'read_perf_counters_and_store_results' method
>    is very sensitive to the measurement of the OUTER
>    elapsed time .

I still don't see why you have to do that enable_perf() / disable_perf()
stuff. What goes wrong if you just let them run and do 2
read_perf*() things?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ