Commit a384259
Mikulas Patocka
dm-transaction-manager: use red-black trees instead of linear lists
There was reported performance degradation when the shadow map contained
too many entries [1]. The shadow map uses 256-bucket hash with linear
lists - when there are too many entries, it has quadratic complexity.
Meir Elisha proposed to add a module parameter that could configure the
size of the hash array - however, this is not ideal because users don't
know that they should increase the parameter when they get bad
performance.
This commit replaces the linear lists with rb-trees (so that there's a
hash of rb-trees), they have logarithmic complexity, so it solves the
performance degradation.
Link: https://patchwork.kernel.org/project/dm-devel/patch/[email protected]/ [1]
Reported-by: Meir Elisha <[email protected]>
Signed-off-by: Mikulas Patocka <[email protected]>1 parent cd6521d commit a384259
1 file changed
+37
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | | - | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | | - | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
117 | 126 | | |
118 | 127 | | |
119 | 128 | | |
| |||
130 | 139 | | |
131 | 140 | | |
132 | 141 | | |
| 142 | + | |
133 | 143 | | |
134 | 144 | | |
| 145 | + | |
135 | 146 | | |
136 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
137 | 160 | | |
138 | 161 | | |
139 | 162 | | |
140 | 163 | | |
141 | 164 | | |
142 | 165 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 166 | + | |
147 | 167 | | |
148 | 168 | | |
149 | 169 | | |
150 | | - | |
151 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
152 | 174 | | |
153 | | - | |
154 | | - | |
| 175 | + | |
155 | 176 | | |
156 | | - | |
157 | 177 | | |
158 | 178 | | |
159 | 179 | | |
| |||
162 | 182 | | |
163 | 183 | | |
164 | 184 | | |
165 | | - | |
| 185 | + | |
166 | 186 | | |
167 | 187 | | |
168 | 188 | | |
| |||
176 | 196 | | |
177 | 197 | | |
178 | 198 | | |
179 | | - | |
| 199 | + | |
180 | 200 | | |
181 | 201 | | |
182 | 202 | | |
| |||
0 commit comments