Age | Commit message (Collapse) | Author |
|
prep work for setxattr
|
|
less error prone
|
|
|
|
History is a circle.
In hindsight that function was pointless, it makes the code more complicated
for pretty much no reason (except saving a few LoC, which is silly).
|
|
I think I've done this refactor in the opposite direction a few years ago.
This is mostly meant to prepare me for setxattr, which requires two inputs -
coincidentally, one is already going to be a kernel input, and the other will
be an user input, so it works out.
I also just didn't like the previous way it worked, this feels cleaner.
|
|
might potentially be used in a reworked open(), mount() etc interface
|
|
|
|
I really should just rename interrupts to something else.
This is inspired by Plan9 and meant to make debugging easier, as the
dying process can take a stacktrace etc.
It kinda sucks that the default handler now depends on fprintf, which is quite
a bit of code, but whatever.
|
|
|
|
mostly inspired by Plan 9's Ureg, probably obvious from the name
|
|
|
|
|
|
This is meant to facilitate a syscall for returning from interrupts, which
will actually work in the general case as opposed to the current hack, which
only works if the interrupt occured during a syscall (which is correct... for
now).
|
|
This is just for simplicity's sake.
I think I could even omit the `movw $TSS, (GdtTss + 2)` and have the linker
fill that out as a relocation, but that would probably be more complex overall.
|
|
Once again, needed for the interrupt return syscall.
Seems to have made the kernel slower in timebench?
|
|
I want to implement a new syscall for returning from "interrupts" (my
crappy take on Plan 9's notes / UNIX signals), and I've realized that
I can't use SYSRET for that, as it clobbers RCX and R11.
This hasn't been an issue so far, as I've only been switching into usermode
to return from syscalls, but now I might be switching into it at arbitrary
moments (right after an interrupt handler recovers from a page fault, etc).
I could make it so I switch between IRET and SYSRET depending on the context,
but I don't think it's worth it.
|
|
On the assembly side, ensure the stack frame looks always the same, by pushing
a fake "error code" for the interrupts that don't generate one.
On the C side, use a struct instead of magic indices into an "array", and
make it consistent with the current style.
|
|
|
|
I'm storing more information in less space. Win-win.
|
|
This will both let me save space in the allocation header, and make the
debugprint more readable.
|
|
For a while during development it managed to be faster than the old allocator
despite having more overhead, probably because it makes better use of the
cache. It no longer is - not sure why. The code definitely could be optimized
to hell, though, and it'd probably recover its original edge.
Non-power-of-2 sizeclasses would be really useful, as I could then e.g.
fit four processes into a page instead of three, but I think implementing them
"well" would be too complicated for now.
In hindsight arbitrary allocation descriptions were probably a bad idea too.
I've kept them in for now, but I'll switch to an enum of allocation types soon.
I think I can fit all the per-allocation state (size+type) in 2 bytes.
There are so few allocations in the kernel that I no longer care about the
backtraces, so I'm leaving them out.
The "large" allocations could probably be tested with execbuf in userland, so
I might actually implement them soon too.
|
|
Yay for guaranteed O(1) insertions, even if iostress seems a bit slower.
|
|
|
|
* firstfreepage now updates properly, preventing a crash (oops)
* kfree only wipes the length of the allocation, not the entire page - which
should make it easier to see the performance impact of the pagealloc changes
|
|
The postqueue functions remain as-is, as that's a more "specialized" interface.
They're mostly wrappers around queue.h, though.
|
|
|
|
I'm still not sure if I should use sys/queue.h for this.
But yeah, this is more consistent, and it will also let me switch over to O(1)
insertions later on.
|
|
Keeping its old name for now to make things easier for myself.
This might just be replaced by sys/queue.h soon.
|
|
|
|
The bitmap functions now accept page addresses so I don't have to handle
raw bitmap indexes, which was kinda complex.
kmalloc_sanity is now not visible to other code as it wasn't really that useful
in the first place.
|
|
This will likely be changed back, but for the time being it will let me
implement a better allocator without too much effort.
|
|
To use the same testing methodology as when I've introduced request slots:
before:
/ $ iostress 1 1000000 0 > /dev/vtty
run 0: 2585203
1000000 calls, 0 bytes. avg 2585203
after:
/ $ iostress 1 1000000 0 > /dev/vtty
run 0: 2783171
1000000 calls, 0 bytes. avg 2783171
This is around a 7.7% slowdown - that I hope to fix with a better malloc.
While this doesn't really make the code that much simpler, it doesn't feel
like the right approach in the first place
|
|
* I'm being more strict about the linked list state to hopefully ensure
I'm not leaking any references.
* vfsreq_create was renamed to vfsreq_dispatchcopy as that name feels more
clear. It copies its argument, and dispatches it.
* Requests for user backends are now handled more like requests for kernel
backends - there's an accept() function that accepts a request.
|
|
|
|
|
|
I probably should've tested DUP_WRONLY too, now that I think about it. TODO?
|
|
It was a dumb hack that wasn't even necessary - an error when mounting should
shadow over the mountpoint anyways.
|
|
|
|
|
|
|
|
|
|
|
|
the vm isn't getting an NMI for any real reason anyways, so I might as well
abuse it
|
|
|
|
|
|
|
|
|
|
|
|
not sure how that slipped by
|
|
|