Skip to content

Draft: Look at diff for just using ticks in public kernel api - #16

Draft
kent-mcleod wants to merge 1 commit into
masterfrom
kent/mcs-ticks
Draft

Draft: Look at diff for just using ticks in public kernel api#16
kent-mcleod wants to merge 1 commit into
masterfrom
kent/mcs-ticks

Conversation

@kent-mcleod

Copy link
Copy Markdown
Owner

constraints that change:

  • max/min budget/period constraints are much less because there isn't overflow issues in conversion between ticks and us
  • System doesn't perform division operations. Division implementation for 64bit values doesn't have to be validated on each platform/timer frequency used.

build constants that need changing:

  • CONFIG_BOOT_THREAD_TIME_SLICE
  • TIMER_PRECISION
  • ksDomSchedule.length
  • CLOCK_SYNC_DELTA
  • CONFIGURE_KERNEL_WCET

Runtime API changes:

  • SC_Configure would take ticks
  • consumed return value would be in ticks

constraints that change:
- max/min budget/period constraints are much less because there isn't
  overflow issues in conversion between ticks and us
- System doesn't perform division operations. Division implementation
  for 64bit values doesn't have to be validated on each platform/timer
frequency used.

build constants that need changing:
- CONFIG_BOOT_THREAD_TIME_SLICE
- TIMER_PRECISION
- ksDomSchedule.length
- CLOCK_SYNC_DELTA
- CONFIGURE_KERNEL_WCET

Runtime API changes:
- SC_Configure would take ticks
- consumed return value would be in ticks
@Indanz

Indanz commented May 7, 2025

Copy link
Copy Markdown

We already have a ticks version of TIMER_PRECISION: TIMER_OVERHEAD_TICKS. But those config values are constant and could be calculated at compile time. So it's really only SC_Configure that breaks the API.

@Indanz

Indanz commented May 7, 2025

Copy link
Copy Markdown

This is what MCS should have done from the start IMHO. Other than people getting the CLK_MAGIC and CLK_SHIFT wrong, the main problem with doing this conversion in the kernel is mostly on 32-bit platforms with a fractional MHz clock, where that approach just doesn't work because of overflows.

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.

2 participants