Re: [PATCH v3 0/4] Use AF_ALG in checksum utilities

2018-05-07 Thread Assaf Gordon
Hello Paul, On Mon, May 07, 2018 at 12:36:43AM -0700, Paul Eggert wrote: > Assaf Gordon wrote: [...] > > It won't matter to a single user on a desktop, but imagine > > a shared server at a university, when all of a sudden a sysadmin > > might see a very very high %SYS load - with almost no way to

Re: af_alg benchmarks and performance

2018-05-07 Thread Assaf Gordon
Hello, On Tue, May 08, 2018 at 02:20:07AM +0200, Bruno Haible wrote: > The following approaches come to mind: [...] > * Use the kernel-provided meta-info about the algorithms to decide whether > to use the kernel API. > > In detail: Read /proc/crypto at run time. It consists of records

Re: af_alg benchmarks and performance

2018-05-07 Thread Assaf Gordon
Hello Bruno and all, On Tue, May 08, 2018 at 01:10:52AM +0200, Bruno Haible wrote: > Let me try to summarize. Thanks for writing this - informative and helpful. > * We need to consider each of the algorithms md5, sha1 sha256 separately, > because each algorithm has a different performanc

Re: optimizing af_alg

2018-05-07 Thread Bruno Haible
Matteo Croce wrote: > Obviously it works only if you always use the same algo and with a > single thread Why only in a single thread? Can't you do socket(AF_ALG, SOCK_SEQPACKET, 0) = 3 bind(3, {sa_family=AF_ALG, sa_data="hash\0... sha1\0..."}, 88) = 0 accept(3, NULL, NULL) = 4

Re: af_alg benchmarks and performance

2018-05-07 Thread Paul Eggert
On 05/07/2018 05:20 PM, Bruno Haible wrote: * Use the kernel-provided meta-info about the algorithms to decide whether to use the kernel API. ... Drawback: Does not work if /proc is not mounted. I would favour the third approach. I agree. With the Linux kernel these days, mountin

Re: af_alg benchmarks and performance

2018-05-07 Thread Bruno Haible
What can we do to get the speedups but avoid the slowdowns, in the two hairy cases - the afalg_buffer case, - the afalg_stream case with non-regular files? The following approaches come to mind: * A "tuning" framework like the one from GMP. This is a set of benchmark programs that the d

af_alg benchmarks and performance

2018-05-07 Thread Bruno Haible
Hi all, Thanks for your benchmarking help and explanations. Let me try to summarize. * We need to consider each of the algorithms md5, sha1 sha256 separately, because each algorithm has a different performance characteristic [1]. This is due to the following factors: - Some non-Inte

Re: imperative vs. descriptive style

2018-05-07 Thread Bruno Haible
John W. Eaton wrote: > I also have the vague recollection of RMS telling people to write > >Return a list containing a and b. > > instead of > >The function foo returns ... > > or even > >Returns a list ... He apparently doesn't do this any more. Recently RMS reviewed the document

Re: Re: imperative vs. descriptive style

2018-05-07 Thread John W. Eaton
On 05/06/2018 10:33 AM, Jim Meyering wrote: Here's the relevant section: (from https://www.gnu.org/prep/standards/html_node/GNU-Manuals.html) Whenever possible, please stick to the active voice, avoiding the passive, and use the present tense, not the future teste. For instance, write “The funct

test-poll: High failure rate on multi-core FreeBSD guest

2018-05-07 Thread Andrea Bolognani
Hi, the test-poll test seems to have a very high failure rate on a multi-core FreeBSD guest: $ for i in $(seq 1 1); do > ./tests/test-poll >/dev/null 2>&1 > echo $? > done >test-poll.rc $ grep -c '.*' test-poll.rc 1 $ grep -c '^0$' test-poll.rc 5 $ grep -c '^1$' test

Re: af_alg: Add ability to use Linux kernel crypto API on data in memory

2018-05-07 Thread Matteo Croce
On Mon, May 7, 2018 at 11:55 AM, Matteo Croce wrote: > On Mon, May 7, 2018 at 4:07 AM, Paul Eggert wrote: >> Bruno Haible wrote: >>> >>> Oops, I goofed with "git diff". Here's the correct patch to test. >> >> >> I tried those bench-md5 benchmarks on two platforms, with somewhat more >> disappoint

Re: af_alg: Add ability to use Linux kernel crypto API on data in memory

2018-05-07 Thread Matteo Croce
On Mon, May 7, 2018 at 4:07 AM, Paul Eggert wrote: > Bruno Haible wrote: >> >> Oops, I goofed with "git diff". Here's the correct patch to test. > > > I tried those bench-md5 benchmarks on two platforms, with somewhat more > disappointing results. > > I observed a real-time slowdown ranging from 1

Re: [PATCH v3 0/4] Use AF_ALG in checksum utilities

2018-05-07 Thread Paul Eggert
Assaf Gordon wrote: I think that for the same reason that --with-openssl defaults to 'no' and not to 'auto' applies here. This is a good point; it's easier to understand and explain if the two options have similar defaults. I'm not sure there is significant improvement of using af_alg comp