In dbg_check_enter_isr we have two comparisons, OR and increment. Because it is OR (and not AND), it looks like the comparisons do not have to be inside the critical section - cannot the critical section be reduced to just the increment?
On the other hand there is probably not much sense in that since I've tried the lock-free safe_increment/safe_decrement and it did not change the benchmark at all. I guess port_lock_from_isr & port_unlock_from_isr are pretty cheap operations.
I am still trying to figure out which operations are expensive and which ones are cheap.
UART is dropping bytes :(
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: UART is dropping bytes :(
Usually. reducing critical sections is not really important in a RT system unless you reduce the longest one in the system. In a RT system you always need to consider the worst case.
Of course reducing critical sections in general is still a good idea in order to have a more benign overall jitter, you gain a better distribution in the system "jitter spectrum" (average jitter closer to the best case).
Not sure if it is clear what I am trying to explain.
Giovanni
Of course reducing critical sections in general is still a good idea in order to have a more benign overall jitter, you gain a better distribution in the system "jitter spectrum" (average jitter closer to the best case).
Not sure if it is clear what I am trying to explain.
Giovanni
Re: UART is dropping bytes :(
Giovanni wrote:Not sure if it is clear what I am trying to explain.
You might be saying that Premature optimization is the root of all evil