forked fromtorvalds/linux
- Notifications
You must be signed in to change notification settings - Fork1
Commit76e32a2
z3fold: fix page locking in z3fold_alloc()
Stress testing of the current z3fold implementation on a 8-core systemrevealed it was possible that a z3fold page deleted from its unbuddiedlist in z3fold_alloc() would be put on another unbuddied list byz3fold_free() while z3fold_alloc() is still processing it. This hasbeen introduced with commit5a27aa8 ("z3fold: add kref refcounting")due to the removal of special handling of a z3fold page not on any listin z3fold_free().To fix this, the z3fold page lock should be taken in z3fold_alloc()before the pool lock is released. To avoid deadlocking, we just try tolock the page as soon as we get a hold of it, and if trylock fails, wedrop this page and take the next one.Signed-off-by: Vitaly Wool <vitalywool@gmail.com>Cc: Dan Streetman <ddstreet@ieee.org>Cc: <Oleksiy.Avramchenko@sony.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent2760078 commit76e32a2
1 file changed
+7
-2
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
185 | 185 |
| |
186 | 186 |
| |
187 | 187 |
| |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
188 | 194 |
| |
189 | 195 |
| |
190 | 196 |
| |
| |||
385 | 391 |
| |
386 | 392 |
| |
387 | 393 |
| |
388 |
| - | |
| 394 | + | |
389 | 395 |
| |
390 | 396 |
| |
391 | 397 |
| |
| |||
394 | 400 |
| |
395 | 401 |
| |
396 | 402 |
| |
397 |
| - | |
398 | 403 |
| |
399 | 404 |
| |
400 | 405 |
| |
|
0 commit comments
Comments
(0)