Re: [PATCH v4 2/4] zram: implement deduplication in zram

From: Sergey Senozhatsky
Date: Wed Apr 26 2017 - 00:03:08 EST


On (04/26/17 09:52), js1304@xxxxxxxxx wrote:
[..]
> <no-dedup>
> Elapsed time: out/host: 88 s
> mm_stat: 8834420736 3658184579 3834208256 0 3834208256 32889 0 0 0
>
> <dedup>
> Elapsed time: out/host: 100 s
> mm_stat: 8832929792 3657329322 2832015360 0 2832015360 32609 0 952568877 80880336
>
> It shows performance degradation roughly 13% and save 24% memory. Maybe,
> it is due to overhead of calculating checksum and comparison.

I like the patch set, and it makes sense. the benefit is, obviously,
case-by-case. on my system I've managed to save just 60MB on a 2.7G
data set, which is far less than I was hoping to save :)


I usually do DIRECT IO fio performance test. JFYI, the results
were as follows:

NO DEDUP DEDUP
#jobs1
WRITE: (586MB/s) (235MB/s)
WRITE: (535MB/s) (226MB/s)
READ: (415MB/s) (189MB/s)
WRITE: (416MB/s) (190MB/s)
READ: (382MB/s) (375MB/s)
READ: (312MB/s) (314MB/s)
READ: (197MB/s) (166MB/s)
WRITE: (197MB/s) (166MB/s)
#jobs2
WRITE: (1039MB/s) (447MB/s)
WRITE: (642MB/s) (262MB/s)
READ: (654MB/s) (337MB/s)
WRITE: (654MB/s) (337MB/s)
READ: (1444MB/s) (1184MB/s)
READ: (1291MB/s) (1140MB/s)
READ: (451MB/s) (223MB/s)
WRITE: (451MB/s) (224MB/s)
#jobs3
WRITE: (1175MB/s) (648MB/s)
WRITE: (678MB/s) (277MB/s)
READ: (921MB/s) (509MB/s)
WRITE: (921MB/s) (509MB/s)
READ: (1322MB/s) (1146MB/s)
READ: (1642MB/s) (1266MB/s)
READ: (583MB/s) (248MB/s)
WRITE: (582MB/s) (248MB/s)
#jobs4
WRITE: (1734MB/s) (878MB/s)
WRITE: (712MB/s) (291MB/s)
READ: (1298MB/s) (695MB/s)
WRITE: (1300MB/s) (695MB/s)
READ: (1885MB/s) (2197MB/s)
READ: (2908MB/s) (2256MB/s)
READ: (621MB/s) (268MB/s)
WRITE: (622MB/s) (268MB/s)
#jobs5
WRITE: (2260MB/s) (1104MB/s)
WRITE: (740MB/s) (296MB/s)
READ: (1578MB/s) (900MB/s)
WRITE: (1579MB/s) (901MB/s)
READ: (2378MB/s) (1969MB/s)
READ: (2573MB/s) (1753MB/s)
READ: (650MB/s) (275MB/s)
WRITE: (650MB/s) (275MB/s)
#jobs6
WRITE: (2907MB/s) (1331MB/s)
WRITE: (773MB/s) (299MB/s)
READ: (1733MB/s) (1010MB/s)
WRITE: (1734MB/s) (1011MB/s)
READ: (3010MB/s) (2465MB/s)
READ: (2715MB/s) (1772MB/s)
READ: (672MB/s) (280MB/s)
WRITE: (672MB/s) (280MB/s)
#jobs7
WRITE: (3098MB/s) (1526MB/s)
WRITE: (779MB/s) (299MB/s)
READ: (1800MB/s) (1151MB/s)
WRITE: (1800MB/s) (1151MB/s)
READ: (3294MB/s) (2765MB/s)
READ: (2861MB/s) (2031MB/s)
READ: (693MB/s) (283MB/s)
WRITE: (693MB/s) (283MB/s)
#jobs8
WRITE: (3425MB/s) (1739MB/s)
WRITE: (792MB/s) (302MB/s)
READ: (2003MB/s) (1289MB/s)
WRITE: (2004MB/s) (1289MB/s)
READ: (3901MB/s) (3218MB/s)
READ: (2954MB/s) (2297MB/s)
READ: (714MB/s) (285MB/s)
WRITE: (714MB/s) (286MB/s)
#jobs9
WRITE: (3744MB/s) (1944MB/s)
WRITE: (794MB/s) (303MB/s)
READ: (2038MB/s) (1400MB/s)
WRITE: (2040MB/s) (1401MB/s)
READ: (4159MB/s) (3583MB/s)
READ: (2963MB/s) (2425MB/s)
READ: (700MB/s) (286MB/s)
WRITE: (700MB/s) (286MB/s)
#jobs10
WRITE: (3863MB/s) (2122MB/s)
WRITE: (780MB/s) (304MB/s)
READ: (2059MB/s) (1551MB/s)
WRITE: (2060MB/s) (1552MB/s)
READ: (4573MB/s) (4004MB/s)
READ: (3025MB/s) (2271MB/s)
READ: (706MB/s) (287MB/s)
WRITE: (706MB/s) (287MB/s)

NO DEDUP DEDUP
jobs1 perfstat
stalled-cycles-frontend 86,881,019,525 ( 45.68%) 95,848,055,454 ( 44.71%)
stalled-cycles-backend 41,714,207,854 ( 21.93%) 44,958,946,213 ( 20.97%)
instructions 179,619,952,260 ( 0.94) 208,777,551,585 ( 0.97)
branches 40,332,931,254 ( 669.275) 46,951,257,852 ( 680.888)
branch-misses 211,977,694 ( 0.53%) 227,694,865 ( 0.48%)
jobs2 perfstat
stalled-cycles-frontend 126,409,074,631 ( 49.54%) 151,381,853,397 ( 50.04%)
stalled-cycles-backend 63,694,911,449 ( 24.96%) 75,662,875,621 ( 25.01%)
instructions 237,127,811,965 ( 0.93) 278,316,276,728 ( 0.92)
branches 51,822,635,738 ( 597.433) 60,986,851,952 ( 590.588)
branch-misses 315,755,016 ( 0.61%) 347,424,093 ( 0.57%)
jobs3 perfstat
stalled-cycles-frontend 191,089,532,462 ( 51.36%) 231,335,643,820 ( 52.60%)
stalled-cycles-backend 97,686,908,504 ( 26.26%) 120,989,629,180 ( 27.51%)
instructions 331,602,259,024 ( 0.89) 381,383,314,335 ( 0.87)
branches 72,970,225,738 ( 539.030) 84,708,904,219 ( 536.393)
branch-misses 507,931,782 ( 0.70%) 518,364,954 ( 0.61%)
jobs4 perfstat
stalled-cycles-frontend 223,445,892,011 ( 52.52%) 249,360,340,619 ( 53.35%)
stalled-cycles-backend 114,943,710,906 ( 27.02%) 128,993,039,366 ( 27.60%)
instructions 380,626,111,963 ( 0.89) 414,605,021,230 ( 0.89)
branches 82,445,041,251 ( 536.219) 89,259,825,600 ( 535.932)
branch-misses 583,497,374 ( 0.71%) 588,281,124 ( 0.66%)
jobs5 perfstat
stalled-cycles-frontend 263,619,571,807 ( 52.85%) 321,088,781,157 ( 54.21%)
stalled-cycles-backend 134,179,697,076 ( 26.90%) 167,682,863,875 ( 28.31%)
instructions 443,228,511,108 ( 0.89) 507,399,916,840 ( 0.86)
branches 95,466,677,594 ( 532.379) 110,214,238,221 ( 523.279)
branch-misses 672,890,143 ( 0.70%) 730,685,294 ( 0.66%)
jobs6 perfstat
stalled-cycles-frontend 291,216,196,229 ( 53.06%) 368,134,629,095 ( 54.77%)
stalled-cycles-backend 148,091,553,338 ( 26.98%) 196,277,284,992 ( 29.20%)
instructions 490,912,765,147 ( 0.89) 568,687,905,057 ( 0.85)
branches 105,042,602,744 ( 532.627) 123,581,871,771 ( 515.815)
branch-misses 714,275,025 ( 0.68%) 795,739,846 ( 0.64%)
jobs7 perfstat
stalled-cycles-frontend 330,653,507,547 ( 53.29%) 408,847,632,764 ( 54.82%)
stalled-cycles-backend 173,091,173,960 ( 27.90%) 225,113,359,025 ( 30.18%)
instructions 551,239,096,548 ( 0.89) 634,980,768,831 ( 0.85)
branches 117,955,044,019 ( 531.343) 137,597,472,747 ( 516.418)
branch-misses 803,168,054 ( 0.68%) 890,836,684 ( 0.65%)
jobs8 perfstat
stalled-cycles-frontend 356,648,221,633 ( 53.60%) 430,630,870,321 ( 54.78%)
stalled-cycles-backend 181,355,532,439 ( 27.26%) 225,833,853,276 ( 28.73%)
instructions 591,082,455,684 ( 0.89) 675,551,813,173 ( 0.86)
branches 125,997,333,678 ( 530.684) 145,611,739,589 ( 519.054)
branch-misses 823,592,583 ( 0.65%) 934,474,711 ( 0.64%)
jobs9 perfstat
stalled-cycles-frontend 390,346,479,419 ( 53.77%) 464,669,227,714 ( 54.83%)
stalled-cycles-backend 194,450,562,714 ( 26.79%) 231,567,413,546 ( 27.32%)
instructions 645,446,764,508 ( 0.89) 732,189,754,115 ( 0.86)
branches 137,219,009,187 ( 529.491) 157,387,961,718 ( 520.710)
branch-misses 898,414,437 ( 0.65%) 990,118,876 ( 0.63%)
jobs10 perfstat
stalled-cycles-frontend 424,813,625,460 ( 54.03%) 504,229,836,920 ( 54.93%)
stalled-cycles-backend 216,498,718,346 ( 27.54%) 264,019,747,607 ( 28.76%)
instructions 698,139,050,494 ( 0.89) 791,700,475,394 ( 0.86)
branches 148,117,364,023 ( 527.254) 170,053,726,692 ( 520.519)
branch-misses 962,807,047 ( 0.65%) 1,065,430,885 ( 0.63%)


NO DEDUP DEDUP
seconds elapsed 63.480344573 97.971439666
seconds elapsed 58.655823065 110.635292879
seconds elapsed 73.470677655 139.499601409
seconds elapsed 78.538327853 150.636241458
seconds elapsed 87.074751505 177.352050355
seconds elapsed 96.067528245 200.932336337
seconds elapsed 107.100552618 223.780631440
seconds elapsed 114.803603478 244.200975111
seconds elapsed 127.158686582 267.434811513
seconds elapsed 139.436204098 291.221754828

-ss