Skip to content

Conversation

@Josar
Copy link
Contributor

@Josar Josar commented May 15, 2018

This is a PR to reduce overhead for platforms which allow ISR context swap.

As for now the procedure is as follows:

  1. ISR enter
  2. Calback
  3. Do something, thread_yield, check for ISR, signalize with flag, return to caller.
  4. Check for flag, swap context.

This can be reduced.

  1. ISR enter
  2. Calback
  3. Do something, swap context.

As of now the feature can be enabled with a CFLAG.

CFLAGS= -DISR_CONTEXT_SWITCH_ALLOWED

and only the atmega platform was changed accordingly.

Following tests run successfull.

  • tests/xtimer_msg_receive_timeout
  • tests/xtimer_periodic_wakeup
  • tests/xtimer_remove
  • tests/xtimer_remove
  • tests/xtimer_reset
  • tests/xtimer_usleep
  • tests/xtimer_usleep_short

The question is, how to implement this that it works for all platforms or can be enabled and disabled.
Where to place ISR_CONTEXT_SWITCH_ALLOWED ?
As for now it has to be placed at the test or example Makefile.
Any suggestions are welcome.

This is a followup of #8988

This is WIP.

All comparison for irq_is_in() can be moved to thread_yield_higher thus moving the check from multiple places to the dependend platform.

@Josar Josar force-pushed the pr/allow_interrupt_context_switch branch from 074bd30 to cfb063b Compare May 16, 2018 00:52
@Josar
Copy link
Contributor Author

Josar commented May 23, 2018

This changes can not work with the current implementation of the xtimer.
As the xtimer unlocks multiple mutex and the ISR context will be lost if there are multiple timer to shoot in the same ISR.
Also the next compare value is not set before unlocking, thus changing the context.

Besides that it works but major rework of the xtimer is necessary.

@Josar Josar closed this May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant