Age | Commit message (Collapse) | Author |
|
oversight resulting in a small one-time mem leak
|
|
This adds eight 8KiB "fixed" buffers per opened journal,
recycled in a basic LRU fashion.
Any read 8KiB or smaller passes through this cache, simply
memcpy()d from the buffer when already resident, or upsized to an
8KiB read when absent, to then be memcpy()d out of the populated
buffer when the read into the buffer completes.
Any read larger than 8KiB bypasses the buffers to be read
directly into the provided destination via iou as if the cache
weren't present at all.
|
|
Udpate thunk usage througout to explicitly control thunk instance
lifecycles from calleees according to new model.
This enables discarding a bunch of the per-object dispatch
thunks, eliminates some thunk leaks, and I think generally makes
the code more expressive and clear about what's going on.
Keep in mind this is all experimental and and I'm not spending a
whole lot of time on this, it's mostly a toy and exploring some
different programming styles I'd never really consider for
production/real work.
Though it actually has some interesting properties, and produces
some surprisingly succinct and readable listings at times once
you have the cumbersome building blocks in place. Especially for
non-daemon programs where you can basically either log+ignore
errors or treat them as fatal, I think this programming style
might actually have its place.
|
|
This is currently very hacky and unfinished, but does enough for
some performance comparisons against a zstd-using journalctl --verify
that has been hacked to return early after the first pass.
It's currently rather leaky, the whole per-object-dispatch thingy
is illuminating a thunk_h shortcoming and forcing addressing the
issue... soon.
|
|
thunk.h got some rudimentary environment caching, and in the
process introduced thunk_free().
Update the submodule and replace the bare free(closure) callsites
with thunk_free(closure).
This should help reduce the amount of malloc/free hammering in jio,
though there are still quite a few allocations for object payloads
in e.g. report-entry-arrays, and the object header space is allocated
as a thunk payload which doesn't get environment caching yet.
|
|
This introduces an journal_t.idx member for "fixed" style usage
in io_uring parlance. Once all journals get opened, they're registered
in the underlying iou ring.
Subsequent operations on these files may supply these idx values
as the fd, but must also add IOSQE_FIXED_FILE to the sqe's flags.
This commit also switches the already present read operations to
use the idx/IOSQE_FIXED_FILE method.
Theoretically this should offer some efficiency gains, since the
kernel can now skip some per-operation fd handling overheads by
having them done once instead @ registration time.
|
|
Make naming a bit more descriptive and consistent...
journals_for_each() is a simple non-IO-incurring journals
array iteration, journal_for_each() generates IO and walks
the data objects hash table... they're quite different,
and shouldn't have such similar names.
|
|
|
|
This is a very quick and dirty experimental hack written in some
sort of bastard continuation-passing style in C w/io_uring using
journal-file introspection and manipulation duty as an excuse for
its existence.
Consider this unfinished prototype quality code.
|