Skip to content

Async Serial LoggerΒ #532

@kitlith

Description

@kitlith

Currently, SerialLogger is sync. @Orycterope estimates that "serial is like 80% of why sunrise is slow" because of this.

However, we print really early on in boot, even before the scheduler is active. So, we don't have much of an option but to do sync printing at that point. It's probably also a good idea not to rely on the scheduler when a kernel panic occurs. So, I propose having two serial drivers: the current one, only used for boot and panic, and an async one used for normal system functioning.

This requires some additional consideration, such as:

  • On panic, we don't want to lose the buffer of the async logger. We should make sure to use the sync logger to flush the buffer.
  • We want a(n easy) way to switch between these loggers. I suggest some sort of static that holds a &Write... wait we need it to be mutable, and i don't know how well a mutable reference would work as a static :/ maybe an Arc/RwLock/etc.?

Metadata

Metadata

Assignees

No one assigned

    Labels

    project-kernelRelated to the kerneltype-perfThis is a performance regression/potential improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions