Merge branch 'fix/spinlock-performance' into 'master'

freertos: fix inlining for xtensa port

Closes IDF-5178, IDF-5221, and IDF-5179

See merge request espressif/esp-idf!18641
This commit is contained in:
Anton Maklakov 2022-07-11 12:33:20 +08:00
commit 22802392bc
3 changed files with 11 additions and 11 deletions

View File

@ -274,7 +274,7 @@ void vPortYieldOtherCore(BaseType_t coreid);
* @return true Core can yield
* @return false Core cannot yield
*/
static inline bool xPortCanYield(void);
FORCE_INLINE_ATTR bool xPortCanYield(void);
// ------------------- Hook Functions ----------------------
@ -315,7 +315,7 @@ void vPortSetStackWatchpoint(void *pxStackStart);
* @note [refactor-todo] IDF should call a FreeRTOS like macro instead of port function directly
* @return BaseType_t Core ID
*/
static inline BaseType_t IRAM_ATTR xPortGetCoreID(void)
FORCE_INLINE_ATTR BaseType_t xPortGetCoreID(void)
{
return (BaseType_t) cpu_hal_get_core_id();
}
@ -452,7 +452,7 @@ static inline void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t comp
// ---------------------- Yielding -------------------------
static inline bool IRAM_ATTR xPortCanYield(void)
FORCE_INLINE_ATTR bool xPortCanYield(void)
{
uint32_t threshold = REG_READ(INTERRUPT_CORE0_CPU_INT_THRESH_REG);
/* when enter critical code, FreeRTOS will mask threshold to RVHAL_EXCM_LEVEL

View File

@ -364,7 +364,7 @@ void vPortYieldOtherCore(BaseType_t coreid);
* @return true Core can yield
* @return false Core cannot yield
*/
static inline bool xPortCanYield(void);
FORCE_INLINE_ATTR bool xPortCanYield(void);
// ------------------- Hook Functions ----------------------
@ -403,7 +403,7 @@ void vPortSetStackWatchpoint( void *pxStackStart );
* @note [refactor-todo] IDF should call a FreeRTOS like macro instead of port function directly
* @return BaseType_t Core ID
*/
static inline BaseType_t xPortGetCoreID(void);
FORCE_INLINE_ATTR BaseType_t xPortGetCoreID(void);
/**
* @brief Wrapper for atomic compare-and-set instruction
@ -637,7 +637,7 @@ static inline void __attribute__((always_inline)) vPortExitCriticalSafe(portMUX_
// ---------------------- Yielding -------------------------
static inline bool IRAM_ATTR xPortCanYield(void)
FORCE_INLINE_ATTR bool xPortCanYield(void)
{
uint32_t ps_reg = 0;
@ -656,7 +656,7 @@ static inline bool IRAM_ATTR xPortCanYield(void)
// ----------------------- System --------------------------
static inline BaseType_t IRAM_ATTR xPortGetCoreID(void)
FORCE_INLINE_ATTR BaseType_t xPortGetCoreID(void)
{
return (BaseType_t) cpu_hal_get_core_id();
}

View File

@ -10,7 +10,7 @@
*/
#ifndef IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP
#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 300 // TODO: IDF-5178
#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 215
#endif
#ifndef IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM
#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM 300
@ -26,7 +26,7 @@
microbenchmark currently runs slower with PSRAM enabled. */
#if !CONFIG_FREERTOS_SMP // IDF-5224
#ifndef IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME
#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME 25000 // TODO: IDF-5179
#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME 20000
#endif
#ifndef IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME_PSRAM
#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME_PSRAM 25000
@ -42,13 +42,13 @@
// throughput performance by iperf
#ifndef IDF_PERFORMANCE_MIN_TCP_RX_THROUGHPUT
#define IDF_PERFORMANCE_MIN_TCP_RX_THROUGHPUT 40 // TODO: IDF-5221
#define IDF_PERFORMANCE_MIN_TCP_RX_THROUGHPUT 45
#endif
#ifndef IDF_PERFORMANCE_MIN_TCP_TX_THROUGHPUT
#define IDF_PERFORMANCE_MIN_TCP_TX_THROUGHPUT 40
#endif
#ifndef IDF_PERFORMANCE_MIN_UDP_RX_THROUGHPUT
#define IDF_PERFORMANCE_MIN_UDP_RX_THROUGHPUT 60 // TODO: IDF-5221
#define IDF_PERFORMANCE_MIN_UDP_RX_THROUGHPUT 64
#endif
#ifndef IDF_PERFORMANCE_MIN_UDP_TX_THROUGHPUT
#define IDF_PERFORMANCE_MIN_UDP_TX_THROUGHPUT 50