mcslock: add MCS queued lock implementation
authorPhil Yang <phil.yang@arm.com>
Fri, 5 Jul 2019 10:27:06 +0000 (18:27 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 7 Jul 2019 21:45:22 +0000 (23:45 +0200)
commit2173f3333b61d243ee4745f79519e86478f38c4d
tree024f945abb6b61508e9a2dbb118ea888e7f34651
parentdb90b4969e2e2e5df88fb993779bf6a03e9cae39
mcslock: add MCS queued lock implementation

If there are multiple threads contending, they all attempt to take the
spinlock lock at the same time once it is released. This results in a
huge amount of processor bus traffic, which is a huge performance
killer. Thus, if we somehow order the lock-takers so that they know who
is next in line for the resource we can vastly reduce the amount of bus
traffic.

This patch added MCS lock library. It provides scalability by spinning
on a CPU/thread local variable which avoids expensive cache bouncings.
It provides fairness by maintaining a list of acquirers and passing the
lock to each CPU/thread in the order they acquired the lock.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
MAINTAINERS
doc/api/doxy-api-index.md
doc/guides/rel_notes/release_19_08.rst
lib/librte_eal/common/Makefile
lib/librte_eal/common/include/arch/arm/rte_mcslock.h [new file with mode: 0644]
lib/librte_eal/common/include/arch/ppc_64/rte_mcslock.h [new file with mode: 0644]
lib/librte_eal/common/include/arch/x86/rte_mcslock.h [new file with mode: 0644]
lib/librte_eal/common/include/generic/rte_mcslock.h [new file with mode: 0644]
lib/librte_eal/common/meson.build