Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch/arm64:Suppot tickless mode #9023

Merged
merged 2 commits into from Apr 21, 2023
Merged

Conversation

hujun260
Copy link
Contributor

Summary

1 Similar to Linux and zephyr, all implementations are in arm64_arch_timer.c

2 Arm64 tickless is turned off by default. If it needs to be turned on, you need to configure the switch CONFIG_SCHED_TICKLESS ON

3 The implementation strategy for tick/tickless is to use the timer inside the CPU and implement the timer driver based on the ARCH_TIMER framework.

4 We implemented tick_* Callback functions to adapt to the driven interface to avoid time format conversion overhead

5 In arm64_tick_cancel func,The remaining time that is not used, so this value can be ignored without reading the corresponding register to obtain the remaining cycles

6 Currently, tick/tickless can takes effect in SMP and non SMP mode, ostest can pass.

Impact

arm64 suppot tickless mode

Testing

ostest pass

@hujun260
Copy link
Contributor Author

@xiaoxiang781216

@hujun260 hujun260 closed this Apr 14, 2023
@hujun260 hujun260 reopened this Apr 14, 2023
@hujun260 hujun260 force-pushed the tickless2 branch 2 times, most recently from a3f2ff6 to 9ebeea6 Compare April 14, 2023 12:20
@masayuki2009
Copy link
Contributor

@hujun260
Can you add qemu-armv8a:tickless configuration to test this PR?

@hujun260 hujun260 force-pushed the tickless2 branch 2 times, most recently from fb2afec to ed5d354 Compare April 18, 2023 12:59
@hujun260
Copy link
Contributor Author

@hujun260 Can you add qemu-armv8a:tickless configuration to test this PR?

Ok,I just add configure qemu-armv8a:nsh_smp_tickless.

@masayuki2009
Copy link
Contributor

@hujun260

====================================================================================
Configuration/Tool: qemu-armv8a/nsh_smp_tickless
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Building NuttX...
Error: chip/qemu_serial.c:743:21: error: 'CONFIG_UART1_BAUD' undeclared here (not in a function); did you mean 'CONFIG_ARCH_BOARD'?
  743 |       .baud_rate  = CONFIG_UART1_BAUD,
      |                     ^~~~~~~~~~~~~~~~~
      |                     CONFIG_ARCH_BOARD
chip/qemu_serial.c: In function 'arm64_serialinit':
Error: chip/qemu_serial.c:843:40: error: 'CONSOLE_DEV' undeclared (first use in this function)
  843 |   ret = uart_register("/dev/console", &CONSOLE_DEV);
      |                                        ^~~~~~~~~~~
chip/qemu_serial.c:843:40: note: each undeclared identifier is reported only once for each function it appears in
Error: chip/qemu_serial.c:849:38: error: 'TTYS0_DEV' undeclared (first use in this function)
  849 |   ret = uart_register("/dev/ttyS0", &TTYS0_DEV);
      |                                      ^~~~~~~~~
At top level:
Error: chip/qemu_serial.c:739:33: error: 'g_uart1priv' defined but not used [-Werror=unused-variable]
  739 | static struct pl011_uart_port_s g_uart1priv =
      |                                 ^~~~~~~~~~~
Error: chip/qemu_serial.c:718:32: error: 'g_uart_ops' defined but not used [-Werror=unused-const-variable=]
  718 | static const struct uart_ops_s g_uart_ops =
      |                                ^~~~~~~~~~

@hujun260
Copy link
Contributor Author

@hujun260

====================================================================================
Configuration/Tool: qemu-armv8a/nsh_smp_tickless
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Building NuttX...
Error: chip/qemu_serial.c:743:21: error: 'CONFIG_UART1_BAUD' undeclared here (not in a function); did you mean 'CONFIG_ARCH_BOARD'?
  743 |       .baud_rate  = CONFIG_UART1_BAUD,
      |                     ^~~~~~~~~~~~~~~~~
      |                     CONFIG_ARCH_BOARD
chip/qemu_serial.c: In function 'arm64_serialinit':
Error: chip/qemu_serial.c:843:40: error: 'CONSOLE_DEV' undeclared (first use in this function)
  843 |   ret = uart_register("/dev/console", &CONSOLE_DEV);
      |                                        ^~~~~~~~~~~
chip/qemu_serial.c:843:40: note: each undeclared identifier is reported only once for each function it appears in
Error: chip/qemu_serial.c:849:38: error: 'TTYS0_DEV' undeclared (first use in this function)
  849 |   ret = uart_register("/dev/ttyS0", &TTYS0_DEV);
      |                                      ^~~~~~~~~
At top level:
Error: chip/qemu_serial.c:739:33: error: 'g_uart1priv' defined but not used [-Werror=unused-variable]
  739 | static struct pl011_uart_port_s g_uart1priv =
      |                                 ^~~~~~~~~~~
Error: chip/qemu_serial.c:718:32: error: 'g_uart_ops' defined but not used [-Werror=unused-const-variable=]
  718 | static const struct uart_ops_s g_uart_ops =
      |                                ^~~~~~~~~~

sorry , i update the patch and revalidation.

1 Similar to Linux and zephyr, all implementations are in arm64_arch_timer.c

2 Arm64 tickless is turned off by default. If it needs to be turned on, you need to configure the switch CONFIG_SCHED_TICKLESS ON

3 The implementation strategy for tick/tickless is to use the timer inside the CPU and implement the timer driver based on the ARCH_TIMER framework.

4 We implemented tick_* Callback functions to adapt to the driven interface to avoid time format conversion overhead

5 In arm64_tick_cancel func,The remaining time that is not used, so this value can be ignored without reading the corresponding register to obtain the remaining cycles

6 Currently, tick/tickless can takes effect in SMP and non SMP mode, ostest can pass.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
add configure CONFIG_SCHED_TICKLESS=y to qemu-armv8a:nsh_smp_tickless

Signed-off-by: hujun5 <hujun5@xiaomi.com>
@xiaoxiang781216 xiaoxiang781216 merged commit abbc661 into apache:master Apr 21, 2023
26 checks passed
@jerpelea jerpelea added this to To-Add in Release Notes - 12.2.0 Jun 13, 2023
@jerpelea jerpelea moved this from To-Add to In Progress in Release Notes - 12.2.0 Jun 26, 2023
@hujun260 hujun260 deleted the tickless2 branch August 10, 2023 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants