anchao commented on PR #13486: URL: https://github.com/apache/nuttx/pull/13486#issuecomment-2357343295
> The benefits are very significant. Before the modification, if we needed to obtain the interrupt status, it required three steps: > > 1 Obtain the CPU index 2 Access the global variable 4 Disable/Enable interrupts This process involved at least 6 CPU instructions. > > However, now it only requires a single CPU instruction. 1. The switch interrupt in `up_interrupt_context()` could be deleted actually, as 32-bit is atomic type on arm32 CPU core 2. The instructions cycle timings of MCR may bring more overhead, requiring **6 cycles in the worst case**  https://developer.arm.com/documentation/100026/0104/smr1465219161191 Do we have relevant performance test? For example, how many cycles does it take to call up_set_current_regs()/up_current_regs() 10,000 times with/out this PR? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
