mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "George Spelvin" <linux@horizon.com>
To: linux@horizon.com, tytso@mit.edu
Cc: hpa@linux.intel.com, linux-kernel@vger.kernel.org,
	mingo@kernel.org, price@mit.edu
Subject: Re: drivers/char/random.c: More futzing about
Date: 11 Jun 2014 23:43:58 -0400	[thread overview]
Message-ID: <20140612034358.4453.qmail@ns.horizon.com> (raw)
In-Reply-To: <20140611163818.GD27151@thunk.org>

Just to add to my total confusion about the totally disparate performance
numbers we're seeing, I did some benchmarks on other machines.

The speedup isn't as good one-pass as it is iterated, and as I mentioned
it's slower on a P4, but it's not 7 times slower by any stretch.

There are all 1-iteration numbers, run immediately after scp-ing the
binary to the machine so there's no possibility if anything being cached.

(The "64" and "32" versions are compiled -m32 and -m64,
of course.)

2.5 GHz Phenom 9850:

$ /tmp/random64
pool 1 = 85670974 e96b1f8f 51244abf 5863283f
pool 2 = 03564c6c eba81d03 55c77fa1 760374a7
 0:        199        142 (-57)
 1:        104         95 (-9)
 2:        104        110 (+6)
 3:        103        109 (+6)
 4:        105         89 (-16)
 5:        103         88 (-15)
 6:        104         89 (-15)
 7:        104         95 (-9)
 8:        105         85 (-20)
 9:        105         85 (-20)
$ /tmp/random32
pool 1 = 85670974 e96b1f8f 51244abf 5863283f
pool 2 = 03564c6c eba81d03 55c77fa1 760374a7
 0:        324        147 (-177)
 1:        100         86 (-14)
 2:        100         99 (-1)
 3:        100         88 (-12)
 4:        100         86 (-14)
 5:        100         86 (-14)
 6:        100         89 (-11)
 7:        100        111 (+11)
 8:        100        111 (+11)
 9:        100         88 (-12)
$ /tmp/random64 10000
pool 1 = 54b3ba06 4769d67a eb04bbf3 5e42df6e
pool 2 = 9d3c469e 6fecdb60 423af4ca 465173d1
 0:     554788     220327 (-334461)
 1:     554825     220176 (-334649)
 2:     553505     220148 (-333357)
 3:     554661     220064 (-334597)
 4:     569559     220064 (-349495)
 5:     612798     220065 (-392733)
 6:     570287     220064 (-350223)
 7:     554790     220064 (-334726)
 8:     554715     220065 (-334650)
 9:     569840     220064 (-349776)
$ /tmp/random32 10000
pool 1 = 54b3ba06 4769d67a eb04bbf3 5e42df6e
pool 2 = 9d3c469e 6fecdb60 423af4ca 465173d1
 0:     520117     280225 (-239892)
 1:     520125     280154 (-239971)
 2:     520104     280094 (-240010)
 3:     520079     280060 (-240019)
 4:     520069     280060 (-240009)
 5:     520060     280060 (-240000)
 6:     558971     280060 (-278911)
 7:     520102     280060 (-240042)
 8:     520082     280060 (-240022)
 9:     520058     280060 (-239998)


3 GHz i5-3330:
$ /tmp/random64
pool 1 = 85670974 e96b1f8f 51244abf 5863283f
pool 2 = 03564c6c eba81d03 55c77fa1 760374a7
 0:         78         75 (-3)
 1:         36         33 (-3)
 2:         33         39 (+6)
 3:         36         30 (-6)
 4:         36         33 (-3)
 5:         30         33 (+3)
 6:         30         54 (+24)
 7:         24         48 (+24)
 8:         27         33 (+6)
 9:         30         33 (+3)
$ /tmp/random32
pool 1 = 85670974 e96b1f8f 51244abf 5863283f
pool 2 = 03564c6c eba81d03 55c77fa1 760374a7
 0:         66         78 (+12)
 1:         39         39 (+0)
 2:         36         39 (+3)
 3:         45         33 (-12)
 4:         42         33 (-9)
 5:         33         42 (+9)
 6:         45         33 (-12)
 7:         39         36 (-3)
 8:        105         48 (-57)
 9:         42         39 (-3)
$ /tmp/random64 10000
pool 1 = 54b3ba06 4769d67a eb04bbf3 5e42df6e
pool 2 = 9d3c469e 6fecdb60 423af4ca 465173d1
 0:     406188     218104 (-188084)
 1:     402620     246968 (-155652)
 2:     402652     239840 (-162812)
 3:     402720     200312 (-202408)
 4:     402584     200080 (-202504)
 5:     447488     200228 (-247260)
 6:     402788     200312 (-202476)
 7:     402688     200080 (-202608)
 8:     427140     224320 (-202820)
 9:     402576     200080 (-202496)
$ /tmp/random32 10000
pool 1 = 54b3ba06 4769d67a eb04bbf3 5e42df6e
pool 2 = 9d3c469e 6fecdb60 423af4ca 465173d1
 0:     406485     266670 (-139815)
 1:     392694     266463 (-126231)
 2:     392496     266763 (-125733)
 3:     426003     266145 (-159858)
 4:     392688     266667 (-126021)
 5:     432231     266589 (-165642)
 6:     392754     298734 (-94020)
 7:     392883     284994 (-107889)
 8:     392637     266694 (-125943)
 9:     392985     267024 (-125961)


3.5 GHz i7-2700:
# /tmp/perftest /tmp/random64
pool 1 = 85670974 e96b1f8f 51244abf 5863283f
pool 2 = 03564c6c eba81d03 55c77fa1 760374a7
 0:         82         90 (+8)
 1:         38         41 (+3)
 2:         46         38 (-8)
 3:         35         41 (+6)
 4:         46         41 (-5)
 5:         38         38 (+0)
 6:         41         55 (+14)
 7:         41         35 (-6)
 8:         46         24 (-22)
 9:         35         38 (+3)
# /tmp/perftest /tmp/random32
pool 1 = 85670974 e96b1f8f 51244abf 5863283f
pool 2 = 03564c6c eba81d03 55c77fa1 760374a7
 0:         82         76 (-6)
 1:         32         53 (+21)
 2:         49         44 (-5)
 3:         35         41 (+6)
 4:         46         35 (-11)
 5:         35         44 (+9)
 6:         49         50 (+1)
 7:         41         41 (+0)
 8:         32         44 (+12)
 9:         49         44 (-5)
# /tmp/perftest /tmp/random64 10000
pool 1 = 54b3ba06 4769d67a eb04bbf3 5e42df6e
pool 2 = 9d3c469e 6fecdb60 423af4ca 465173d1
 0:     445486     227993 (-217493)
 1:     445089     227602 (-217487)
 2:     445381     227736 (-217645)
 3:     445220     227661 (-217559)
 4:     445159     227798 (-217361)
 5:     445285     227608 (-217677)
 6:     445005     227806 (-217199)
 7:     445439     227608 (-217831)
 8:     445328     227798 (-217530)
 9:     445533     227625 (-217908)
# /tmp/perftest /tmp/random32 10000
pool 1 = 54b3ba06 4769d67a eb04bbf3 5e42df6e
pool 2 = 9d3c469e 6fecdb60 423af4ca 465173d1
 0:     437001     335959 (-101042)
 1:     437004     336120 (-100884)
 2:     436683     335936 (-100747)
 3:     436806     336452 (-100354)
 4:     436996     335988 (-101008)
 5:     436916     336210 (-100706)
 6:     437042     354722 (-82320)
 7:     436896     336146 (-100750)
 8:     436981     336741 (-100240)
 9:     437016     331920 (-105096)


And on a 1.6 GHz P4:
$ /tmp/random32
pool 1 = 85670974 e96b1f8f 51244abf 5863283f
pool 2 = 03564c6c eba81d03 55c77fa1 760374a7
 0:        312        176 (-136)
 1:        112        112 (+0)
 2:        112        112 (+0)
 3:        112        112 (+0)
 4:        112        112 (+0)
 5:        112        112 (+0)
 6:        112        112 (+0)
 7:        112        112 (+0)
 8:        112        112 (+0)
 9:        112        112 (+0)
$ /tmp/random32 10000
pool 1 = 54b3ba06 4769d67a eb04bbf3 5e42df6e
pool 2 = 9d3c469e 6fecdb60 423af4ca 465173d1
 0:     480344     550192 (+69848)
 1:     480088     550084 (+69996)
 2:     480140     550128 (+69988)
 3:     480088     550084 (+69996)
 4:     480088     550084 (+69996)
 5:     480088     550084 (+69996)
 6:     480088     550084 (+69996)
 7:     480088     550084 (+69996)
 8:     480088     550084 (+69996)
 9:     480088     550084 (+69996)


And just for lulz, a 1.533 GHz Athlon XP:
$ /tmp/random32
pool 1 = 85670974 e96b1f8f 51244abf 5863283f
pool 2 = 03564c6c eba81d03 55c77fa1 760374a7
 0:         91         83 (-8)
 1:         58         57 (-1)
 2:         58         57 (-1)
 3:         58         57 (-1)
 4:         58         45 (-13)
 5:         58         45 (-13)
 6:         58         45 (-13)
 7:         58         45 (-13)
 8:         58         45 (-13)
 9:         58         45 (-13)
$ /tmp/random32 10000
pool 1 = 54b3ba06 4769d67a eb04bbf3 5e42df6e
pool 2 = 9d3c469e 6fecdb60 423af4ca 465173d1
 0:     570094     380159 (-189935)
 1:     550045     380088 (-169957)
 2:     550028     380043 (-169985)
 3:     568533     380087 (-188446)
 4:     550028     380021 (-170007)
 5:     550028     380021 (-170007)
 6:     550028     380021 (-170007)
 7:     550028     380021 (-170007)
 8:     550028     382985 (-167043)
 9:     550088     380021 (-170067)

      parent reply	other threads:[~2014-06-12  3:44 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09  0:05 [RFC PATCH] drivers/char/random.c: Is reducing locking range like this safe? George Spelvin
2014-06-09  1:35 ` Theodore Ts'o
2014-06-09  2:10   ` George Spelvin
2014-06-09  2:18     ` George Spelvin
2014-06-09  4:03       ` George Spelvin
2014-06-09  9:23         ` George Spelvin
2014-06-09 13:34         ` Theodore Ts'o
2014-06-09 15:04           ` George Spelvin
2014-06-09 15:50             ` Theodore Ts'o
2014-06-09 16:11               ` George Spelvin
2014-06-10  0:20               ` drivers/char/random.c: more ruminations George Spelvin
2014-06-10  1:20                 ` Theodore Ts'o
2014-06-10  3:10                   ` George Spelvin
2014-06-10 15:25                     ` Theodore Ts'o
2014-06-10 20:40                       ` George Spelvin
2014-06-10 21:20                         ` Theodore Ts'o
2014-06-11  0:10                           ` George Spelvin
2014-06-11  2:08                             ` Theodore Ts'o
2014-06-11  3:58                               ` George Spelvin
2014-06-11 13:11                                 ` Theodore Ts'o
2014-06-12  0:42                                   ` George Spelvin
2014-06-12  1:03                                   ` H. Peter Anvin
2014-06-11  4:34                               ` George Spelvin
2014-06-11 13:09                                 ` Theodore Ts'o
2014-06-11  2:21                             ` Theodore Ts'o
2014-06-09 13:17   ` drivers/char/random.c: More futzing about George Spelvin
2014-06-11 16:38     ` Theodore Ts'o
2014-06-11 16:48       ` H. Peter Anvin
2014-06-11 19:25         ` Theodore Ts'o
2014-06-11 20:41           ` H. Peter Anvin
2014-06-12  0:44             ` H. Peter Anvin
2014-06-12  1:51               ` George Spelvin
2014-06-12  0:32       ` George Spelvin
2014-06-12  3:22         ` Theodore Ts'o
2014-06-12  4:13           ` random: Benchamrking fast_mix2 George Spelvin
2014-06-12 11:18             ` George Spelvin
2014-06-12 20:17               ` Theodore Ts'o
2014-06-12 20:46               ` Theodore Ts'o
2014-06-13  0:23                 ` George Spelvin
2014-06-13 15:52                   ` Theodore Ts'o
2014-06-14  2:10                     ` George Spelvin
2014-06-14  3:06                       ` Theodore Ts'o
2014-06-14  5:25                         ` George Spelvin
2014-06-14  6:24                           ` Theodore Ts'o
2014-06-14  8:03                             ` George Spelvin
2014-06-14 11:14                               ` George Spelvin
2014-06-14 15:13                                 ` George Spelvin
2014-06-14 16:33                                   ` Theodore Ts'o
2014-06-15  0:23                                     ` George Spelvin
2014-06-15  1:17                                       ` Theodore Ts'o
2014-06-15  6:58                                         ` George Spelvin
2014-06-15 13:01                                           ` Theodore Ts'o
2014-06-14  6:27                           ` Theodore Ts'o
2014-06-14  4:55                     ` [RFC] random: is the IRQF_TIMER test working as intended? George Spelvin
2014-06-14  6:43                       ` Theodore Ts'o
2014-06-14  7:23                         ` George Spelvin
2014-06-12  3:43       ` George Spelvin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140612034358.4453.qmail@ns.horizon.com \
    --to=linux@horizon.com \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=price@mit.edu \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®