Timekeeping & allocators#18
Open
d-tatianin wants to merge 36 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.