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

[kernel] Speed up TTY output processing #1709

Merged
merged 1 commit into from
Sep 11, 2023
Merged

[kernel] Speed up TTY output processing #1709

merged 1 commit into from
Sep 11, 2023

Conversation

ghaerr
Copy link
Owner

@ghaerr ghaerr commented Sep 11, 2023

Tested on QEMU, this increases sl output by 25-50% on already fast systems. Discussed in #1619 (comment).

It seems @Vutshi has a knack for finding deep rabbit holes. Using the operation of sl, testing has found that the output speed varies considerably, based on something I can't pinpoint. I've looked at the scheduler, kernel timers, serial console, and all seem operating correctly. What is being observed is that (especially with this enhancement) sl runs fast ~0.45 seconds on QEMU on boot (from ~0.73s - 1.0s before). But after running networking, then stopping it, or running /bin/getty on a serial line, then stopping it, or even just typing ^D a few times to login: on serial, the sl output time increases 50% to 0.73s or more, then sometimes drops back to speedy again.

This needs testing on real hardware - I'm very interested to learn how much quicker this change gets us, as well as any slowdowns seen when init 3 is run opening a /bin/getty on /dev/ttyS0.

@Vutshi
Copy link

Vutshi commented Sep 11, 2023

@ghaerr I will test it as soon as I have access to the hardware. Meanwhile, I’ve learned about a new 8086 emulator which claims to be CPU cycle exact.
https://int10h.org/blog/2023/07/martypc-pc-xt-emulator-raising-the-bar/
I wonder whether it can be useful in our context of performance debugging as it also provides some extensive debugging info.

@ghaerr
Copy link
Owner Author

ghaerr commented Sep 11, 2023

I’ve learned about a new 8086 emulator which claims to be CPU cycle exact.

I just read about that emulator last week. IIRC it also emulates much of the PC hardware. I think it as well as other non-QEMU emulators would be very useful for ELKS. The problem with many emulators is they can take some time to setup properly. I have more emulators on my long list of things to do, but don't have lots of time to learn new ones. Anyone that has knowledge of a specific emulator or some time to set one up - it would be great to hear from you :)

@tyama501: I have dosbox setup and running which I use for testing your PC-98 port, but I have not been able to get it to boot non-FAT floppies (since we're using the its boot command running under DOS). Have you found a way to get it to boot an IBM PC MINIX-formattted floppy?

Are there other emulators that we should prioritize? What about Bochs, does anyone use that anymore? I have ongoing concerns about QEMU, as it has a nasty bug/feature that turns off the INT 8 hardware timer interrupt at times (I think too save CPU usage) which wreaks havoc on system timings and ELKS operation in general. It apparently only does this when the serial port is enabled. I would much like to test the sl timing issues on another emulator. Although the speed issues described above are likely ELKS internal, I haven't ruled out QEMU timing issues either.

@ghaerr ghaerr merged commit 5eaea47 into master Sep 11, 2023
@ghaerr ghaerr deleted the slspeedup branch September 11, 2023 17:10
@tyama501
Copy link
Contributor

I didn't know DOSBox-X cannot boot non-FAT but I tried now and failed to boot...

@ghaerr ghaerr mentioned this pull request Sep 12, 2023
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.

3 participants