TLSF and LWMEM, interrupts disabled

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TLSF and LWMEM, interrupts disabled

607 Views
kfranz
Contributor III

We are using a K66 (180MHZ) and MQX 4.2 with the LWMEM memory manager. We are researching changing to using TLSF. We have both an internal system memory pool and an external memory pool using a static RAM chip on the flexbus. Each memory pools is approximately 65KB. Our application requires a worst case interrupt latency of 100usec. 

Both LWMEM and TLSF disable interrupts for periods of time. This is because MQX_ALLOCATOR_ALLOW_IN_ISR is set to 1. This is required for MACNET which releases memory allocations inside of an interrupt. There could be other instances in MQX/RTCS/USB where memory is released or allocated inside of an interrupt.

Once we get our initial allocations done and the system is relatively stable, LWMEM disables interrupts for typically 13usec or less. The exception to this is when a thread is deleted. This causes LWMEM to scan both memory pools looking for any allocations owned by the deleted thread so that LWMEM can release them. Unfortunately, when this occurs interrupts can be disabled for ~400usec which is a problem for our application. We have a workaround... do not delete threads.

TLSF regularly disables interrupts for as long as ~210usec. I did not investigate why TLSF needs to disable interrupt for this long.

So, both TLSF and LWMEM disable interrupts for too long. We have a workaround for LWMEM (but the workaround is not desired). We do not have a workaround for TLSF.

 

Is there a solution to using TLSF so that it does not disable interrupts for more than 100usec?

0 Kudos
Reply
1 Reply

577 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi  Kfranz:

 

I would suggest you contact the owner of MQX -- Embedded Access Inc- for this question.

Embedded Access - MQX Design, Products, & Services

 

Regards

Daniel

0 Kudos
Reply