]> granicus.if.org Git - esp-idf/commit
freertos spinlock/portmux: Reduce spinlocking overhead
authorAngus Gratton <angus@espressif.com>
Mon, 13 Feb 2017 03:46:37 +0000 (14:46 +1100)
committerAngus Gratton <gus@projectgus.com>
Mon, 4 Sep 2017 09:11:51 +0000 (19:11 +1000)
commit4d42b2d100fc11551f3cee9dd2e7bf4ca57eca42
treeaba5d1e6e5ae8ea32181723f472e909d01b93083
parentf2952de3a58c3d5d705d84c17ee7a15b3b6d7327
freertos spinlock/portmux: Reduce spinlocking overhead

Ref TW7117

Microbenchmarks in unit tests:

(All numbers in cycles per benchmarked operation):

Release mode
No lock contention lock/unlock -       301 -> 167 (-45%)
Recursive no contention lock/unlock -  289 -> 148 (-49%)
Lock contention two CPUs (lock/unlock) 699 -> 400 (-43%)

Debug mode
No lock contention lock/unlock -       355 -> 203 (-43%)
Recursive no contention lock/unlock -  345 -> 188 (-46%)
Lock contention two CPUs (lock/unlock) 761 -> 483 (-36%)
components/freertos/include/freertos/FreeRTOS.h
components/freertos/include/freertos/portable.h
components/freertos/include/freertos/portmacro.h
components/freertos/include/freertos/xtensa_context.h
components/freertos/port.c
components/freertos/tasks.c