[dpdk-dev] [PATCH v2 8/9] eal: add lcore iterators
Stephen Hemminger
stephen at networkplumber.org
Sat Jun 20 04:21:47 CEST 2020
On Fri, 19 Jun 2020 18:22:43 +0200
David Marchand <david.marchand at redhat.com> wrote:
> + rte_rwlock_read_lock(&lcore_lock);
I see you converted a spin lock to a reader lock.
Are you sure this is a good idea, although conceptually faster,
the implementation on most cpu's is slower than a simple spin lock.
https://www.kernel.org/doc/htmldocs/kernel-locking/Efficiency.html
If your code divides neatly along reader/writer lines (as our
cache code does), and the lock is held by readers for significant
lengths of time, using these locks can help. They are slightly slower
than the normal locks though, so in practice rwlock_t is not usually
worthwhile.
More information about the dev
mailing list