Re: [PATCH v3 0/2] Use blocked_lock_lock only to protect blocked_hash

From: Jeff Layton
Date: Sat Mar 07 2015 - 09:00:58 EST


On Fri, 6 Mar 2015 08:53:30 +0100
Daniel Wagner <daniel.wagner@xxxxxxxxxxxx> wrote:

> Hi,
>
> Finally, I got a bigger machine and did a quick test round. I expected
> to see some improvements but the resutls do not show any real gain. So
> they are merely refactoring patches.
>

Ok, in that case is there any point in merging these? I'm all for
breaking up global locks when it makes sense, but if you can't
demonstrate a clear benefit then I'm less inclined to take the churn.

Perhaps we should wait to see if a benefit emerges when/if you convert
the lglock code to use normal spinlocks (like Andi suggested)? That
seems like a rather simple conversion, and I don't think it's
"cheating" in any sense of the word.

I do however wonder why Nick used arch_spinlock_t there when he wrote
the lglock code instead of normal spinlocks. Was it simply memory usage
considerations or something else?

> 4x Intel(R) Xeon(R) CPU E5-4610 v2 @ 2.30GHz
>
> 4.0.0-rc2/flock01.data
> # NumSamples = 3; Min = 47160.80; Max = 47555.42
> # Mean = 47294.254786; Variance = 34110.284932; SD = 184.689699; Median 47166.534982
> # each â represents a count of 1
> 47160.8049 - 47200.2668 [ 2]: ââ
> 47200.2668 - 47239.7288 [ 0]:
> 47239.7288 - 47279.1908 [ 0]:
> 47279.1908 - 47318.6527 [ 0]:
> 47318.6527 - 47358.1147 [ 0]:
> 47358.1147 - 47397.5767 [ 0]:
> 47397.5767 - 47437.0386 [ 0]:
> 47437.0386 - 47476.5006 [ 0]:
> 47476.5006 - 47515.9625 [ 0]:
> 47515.9625 - 47555.4245 [ 1]: â
>
> patched/flock01.data
> # NumSamples = 21; Min = 45877.22; Max = 50206.70
> # Mean = 47042.844720; Variance = 752166.966346; SD = 867.275600; Median 46939.811380
> # each â represents a count of 1
> 45877.2235 - 46310.1709 [ 2]: ââ
> 46310.1709 - 46743.1182 [ 7]: âââââââ
> 46743.1182 - 47176.0655 [ 3]: âââ
> 47176.0655 - 47609.0128 [ 6]: ââââââ
> 47609.0128 - 48041.9602 [ 2]: ââ
> 48041.9602 - 48474.9075 [ 0]:
> 48474.9075 - 48907.8548 [ 0]:
> 48907.8548 - 49340.8021 [ 0]:
> 49340.8021 - 49773.7495 [ 0]:
> 49773.7495 - 50206.6968 [ 1]: â
>
>
> 4.0.0-rc2/flock02.data
> # NumSamples = 1786; Min = 1.86; Max = 3.13
> # Mean = 2.204980; Variance = 0.015900; SD = 0.126096; Median 2.177549
> # each â represents a count of 13
> 1.8606 - 1.9880 [ 5]:
> 1.9880 - 2.1154 [ 315]: ââââââââââââââââââââââââ
> 2.1154 - 2.2427 [ 1040]: ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> 2.2427 - 2.3701 [ 272]: ââââââââââââââââââââ
> 2.3701 - 2.4975 [ 75]: âââââ
> 2.4975 - 2.6249 [ 42]: âââ
> 2.6249 - 2.7523 [ 28]: ââ
> 2.7523 - 2.8796 [ 7]:
> 2.8796 - 3.0070 [ 1]:
> 3.0070 - 3.1344 [ 1]:
>
> patched/flock02.data
> # NumSamples = 4586; Min = 2.14; Max = 4.31
> # Mean = 2.619467; Variance = 0.043192; SD = 0.207828; Median 2.575378
> # each â represents a count of 27
> 2.1385 - 2.3561 [ 186]: ââââââ
> 2.3561 - 2.5737 [ 2079]: âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> 2.5737 - 2.7914 [ 1642]: ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> 2.7914 - 3.0090 [ 355]: âââââââââââââ
> 3.0090 - 3.2266 [ 246]: âââââââââ
> 3.2266 - 3.4442 [ 66]: ââ
> 3.4442 - 3.6618 [ 9]:
> 3.6618 - 3.8795 [ 1]:
> 3.8795 - 4.0971 [ 0]:
> 4.0971 - 4.3147 [ 2]:
>
>
> 4.0.0-rc2/lease01.data
> # NumSamples = 12; Min = 1097.16; Max = 1255.06
> # Mean = 1184.550432; Variance = 1590.438052; SD = 39.880297; Median 1190.704582
> # each â represents a count of 1
> 1097.1556 - 1112.9460 [ 1]: â
> 1112.9460 - 1128.7363 [ 0]:
> 1128.7363 - 1144.5267 [ 1]: â
> 1144.5267 - 1160.3170 [ 0]:
> 1160.3170 - 1176.1074 [ 2]: ââ
> 1176.1074 - 1191.8977 [ 2]: ââ
> 1191.8977 - 1207.6881 [ 2]: ââ
> 1207.6881 - 1223.4784 [ 3]: âââ
> 1223.4784 - 1239.2688 [ 0]:
> 1239.2688 - 1255.0591 [ 1]: â
>
> patched/lease01.data
> # NumSamples = 14; Min = 1055.00; Max = 1213.97
> # Mean = 1128.800723; Variance = 2225.466357; SD = 47.174849; Median 1114.384900
> # each â represents a count of 1
> 1054.9959 - 1070.8932 [ 2]: ââ
> 1070.8932 - 1086.7906 [ 1]: â
> 1086.7906 - 1102.6879 [ 1]: â
> 1102.6879 - 1118.5853 [ 4]: ââââ
> 1118.5853 - 1134.4826 [ 0]:
> 1134.4826 - 1150.3800 [ 1]: â
> 1150.3800 - 1166.2773 [ 2]: ââ
> 1166.2773 - 1182.1747 [ 0]:
> 1182.1747 - 1198.0720 [ 2]: ââ
> 1198.0720 - 1213.9694 [ 1]: â
>
>
> 4.0.0-rc2/lease02.data
> # NumSamples = 12; Min = 841.43; Max = 911.82
> # Mean = 888.716745; Variance = 317.221486; SD = 17.810713; Median 894.897002
> # each â represents a count of 1
> 841.4339 - 848.4727 [ 1]: â
> 848.4727 - 855.5115 [ 0]:
> 855.5115 - 862.5503 [ 0]:
> 862.5503 - 869.5891 [ 0]:
> 869.5891 - 876.6278 [ 2]: ââ
> 876.6278 - 883.6666 [ 1]: â
> 883.6666 - 890.7054 [ 1]: â
> 890.7054 - 897.7442 [ 3]: âââ
> 897.7442 - 904.7830 [ 2]: ââ
> 904.7830 - 911.8218 [ 2]: ââ
>
> patched/lease02.data
> # NumSamples = 26; Min = 845.36; Max = 917.22
> # Mean = 886.178134; Variance = 320.861100; SD = 17.912596; Median 889.109363
> # each â represents a count of 1
> 845.3620 - 852.5481 [ 2]: ââ
> 852.5481 - 859.7343 [ 1]: â
> 859.7343 - 866.9204 [ 1]: â
> 866.9204 - 874.1065 [ 2]: ââ
> 874.1065 - 881.2926 [ 3]: âââ
> 881.2926 - 888.4788 [ 2]: ââ
> 888.4788 - 895.6649 [ 6]: ââââââ
> 895.6649 - 902.8510 [ 4]: ââââ
> 902.8510 - 910.0372 [ 2]: ââ
> 910.0372 - 917.2233 [ 3]: âââ
>
>
> 4.0.0-rc2/posix01.data
> # NumSamples = 5; Min = 46659.56; Max = 48332.45
> # Mean = 47237.374603; Variance = 337801.649607; SD = 581.207063; Median 47011.051338
> # each â represents a count of 1
> 46659.5620 - 46826.8508 [ 1]: â
> 46826.8508 - 46994.1396 [ 1]: â
> 46994.1396 - 47161.4284 [ 1]: â
> 47161.4284 - 47328.7172 [ 1]: â
> 47328.7172 - 47496.0060 [ 0]:
> 47496.0060 - 47663.2948 [ 0]:
> 47663.2948 - 47830.5836 [ 0]:
> 47830.5836 - 47997.8724 [ 0]:
> 47997.8724 - 48165.1612 [ 0]:
> 48165.1612 - 48332.4500 [ 1]: â
>
> patched/posix01.data
> # NumSamples = 5; Min = 47274.54; Max = 47925.60
> # Mean = 47693.475091; Variance = 48592.645586; SD = 220.437396; Median 47762.516318
> # each â represents a count of 1
> 47274.5400 - 47339.6458 [ 1]: â
> 47339.6458 - 47404.7516 [ 0]:
> 47404.7516 - 47469.8574 [ 0]:
> 47469.8574 - 47534.9632 [ 0]:
> 47534.9632 - 47600.0690 [ 0]:
> 47600.0690 - 47665.1748 [ 0]:
> 47665.1748 - 47730.2806 [ 1]: â
> 47730.2806 - 47795.3863 [ 2]: ââ
> 47795.3863 - 47860.4921 [ 0]:
> 47860.4921 - 47925.5979 [ 1]: â
>
>
> 4.0.0-rc2/posix02.data
> # NumSamples = 633; Min = 3.28; Max = 6.66
> # Mean = 3.742386; Variance = 0.087680; SD = 0.296108; Median 3.683302
> # each â represents a count of 4
> 3.2834 - 3.6214 [ 218]: ââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> 3.6214 - 3.9595 [ 338]: ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> 3.9595 - 4.2975 [ 39]: âââââââââ
> 4.2975 - 4.6356 [ 23]: âââââ
> 4.6356 - 4.9736 [ 13]: âââ
> 4.9736 - 5.3117 [ 1]:
> 5.3117 - 5.6497 [ 0]:
> 5.6497 - 5.9878 [ 0]:
> 5.9878 - 6.3258 [ 0]:
> 6.3258 - 6.6638 [ 1]:
>
> patched/posix02.data
> # NumSamples = 1266; Min = 3.52; Max = 8.13
> # Mean = 4.177377; Variance = 0.139937; SD = 0.374081; Median 4.091573
> # each â represents a count of 10
> 3.5154 - 3.9770 [ 343]: ââââââââââââââââââââââââââââââââââ
> 3.9770 - 4.4386 [ 760]: ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> 4.4386 - 4.9002 [ 87]: ââââââââ
> 4.9002 - 5.3617 [ 55]: âââââ
> 5.3617 - 5.8233 [ 17]: â
> 5.8233 - 6.2849 [ 2]:
> 6.2849 - 6.7464 [ 0]:
> 6.7464 - 7.2080 [ 1]:
> 7.2080 - 7.6696 [ 0]:
> 7.6696 - 8.1311 [ 1]:
>
> 4.0.0-rc2/posix03.data
> # NumSamples = 6; Min = 37.77; Max = 41.77
> # Mean = 39.590607; Variance = 1.780789; SD = 1.334462; Median 39.619681
> # each â represents a count of 1
> 37.7725 - 38.1719 [ 1]: â
> 38.1719 - 38.5713 [ 1]: â
> 38.5713 - 38.9706 [ 0]:
> 38.9706 - 39.3700 [ 1]: â
> 39.3700 - 39.7694 [ 0]:
> 39.7694 - 40.1688 [ 1]: â
> 40.1688 - 40.5682 [ 1]: â
> 40.5682 - 40.9675 [ 0]:
> 40.9675 - 41.3669 [ 0]:
> 41.3669 - 41.7663 [ 1]: â
>
> patched/posix03.data
> # NumSamples = 15; Min = 37.45; Max = 44.72
> # Mean = 41.543496; Variance = 4.628029; SD = 2.151286; Median 41.293384
> # each â represents a count of 1
> 37.4498 - 38.1767 [ 1]: â
> 38.1767 - 38.9036 [ 0]:
> 38.9036 - 39.6304 [ 1]: â
> 39.6304 - 40.3573 [ 4]: ââââ
> 40.3573 - 41.0842 [ 1]: â
> 41.0842 - 41.8110 [ 1]: â
> 41.8110 - 42.5379 [ 1]: â
> 42.5379 - 43.2648 [ 3]: âââ
> 43.2648 - 43.9916 [ 0]:
> 43.9916 - 44.7185 [ 3]: âââ
>
> v3:
> - added missing !IS_OFDLCK
> - removed unnecessary locking protecting fl_list by flock_lock_lglock
>
> v2:
> - added a few lockdep assertion
> - dropped spinlock conversion
>
> v1:
> - rebased on v3.19-8975-g3d88348
> - splittet into smaller pieces
> - fixed a wrong usage of __locks_insert/delete_block() and it's posix version
> - added seqfile helpers to avoid ugly open coded version
>
> https://lkml.org/lkml/2015/3/2/351
>
> Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>
> Cc: Jeff Layton <jlayton@xxxxxxxxxxxxxxx>
> Cc: "J. Bruce Fields" <bfields@xxxxxxxxxxxx>
> Cc: linux-fsdevel@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
>
> Daniel Wagner (2):
> locks: Split insert/delete block functions into flock/posix parts
> locks: Use blocked_lock_lock only to protect blocked_hash
>
> fs/locks.c | 111 ++++++++++++++++++++++++++++++++++++++++---------------------
> 1 file changed, 74 insertions(+), 37 deletions(-)
>


--
Jeff Layton <jlayton@xxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/