Skip to content

Timekeeping & allocators#18

Open
d-tatianin wants to merge 36 commits into
masterfrom
new
Open

Timekeeping & allocators#18
d-tatianin wants to merge 36 commits into
masterfrom
new

Conversation

@d-tatianin

Copy link
Copy Markdown
Member

No description provided.

This logic was already duplicated in two places, with more places to come in
the future commits. Make a separate helpers & use them instead of opencoding
the memory map iteration code.

Note that the boot allocator still opencodes it, but it uses the new
ultra_mme_is_ram helper nonetheless, so our direct map and the boot allocator
should have the same idea about what is ram and what isn't.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Update the allocator state before calling boot_free on the old buffer,
such that it doesn't attempt to grow again forever until it hits a
BUG_ON in the emplace code.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
This will be used in the following commits for allocating huge pages,
but it might have utility in other places as well in the future.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
1. Fix ticket field order being mixed up between endian types
2. Add a missing irq state parameter to try_lock
3. Add a missing standalone SPINLOCK_INIT helper
4. Use a relaxed load in try_lock
5. Fix is_locked being incorrect in case of an overflow

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Some places in code will require the actual arch-specific details of whether a
specific page table level is implemented, or if it's simply folded. For example,
for preallocating the top level tables to remove the need for syncing new
kernel mappings between all page tables.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
We know the size from the IO window itself, therefore we don't need the caller
to remember it.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
To prevent collisions with the host errno definitions.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
The skeleton consists of the following parts:
1. A counter_device, this is an abstraction over actual timer hardware, it
   attempts to simplify it down to just a counter read callback. This
   abstraction also calculates all the values needed to convert the counter
   value into the number of elapsed nanoseconds, as well as other logic such
   as overflow detection, etc.
2. A timekeeper. This is the subsystem that provides the kernel with helpers
    such as ns_since_boot or delay_ns. It's also responsible for periodically
    pinging the time counter device to make sure we never miss an overflow
    and to make sure our counter readback path is fast.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
So we can share the core helpers with the testing infrastructure without
duplicating them.

Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant