summaryrefslogtreecommitdiffstats
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorVitaly Wool <vitalywool@gmail.com>2017-04-13 14:56:14 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-04-13 18:24:20 -0700
commit76e32a2a084ed71b48179023cd8fdb3787c8a6ad (patch)
treed0a2cb8e6addcbdcb946192f27243eef0bb7ee3c /mm/huge_memory.c
parent2760078203a6b46b96307f4b06030ab0b801c97e (diff)
downloadop-kernel-dev-76e32a2a084ed71b48179023cd8fdb3787c8a6ad.zip
op-kernel-dev-76e32a2a084ed71b48179023cd8fdb3787c8a6ad.tar.gz
z3fold: fix page locking in z3fold_alloc()
Stress testing of the current z3fold implementation on a 8-core system revealed it was possible that a z3fold page deleted from its unbuddied list in z3fold_alloc() would be put on another unbuddied list by z3fold_free() while z3fold_alloc() is still processing it. This has been introduced with commit 5a27aa822 ("z3fold: add kref refcounting") due to the removal of special handling of a z3fold page not on any list in 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 to lock the page as soon as we get a hold of it, and if trylock fails, we drop 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>
Diffstat (limited to 'mm/huge_memory.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud