Btreefs generates executable code at runtime to unpack btree nodes
evilpiepirate.org
evilpiepirate.org
Let's see if they will switch to that.
https://lore.kernel.org/linux-bcachefs/ZIuCFtmnFturKwex@mori...
E.g. PostgreSQL can do that these days (not sure if it did back then): https://www.postgresql.org/docs/current/jit-reason.html
ALTER SYSTEM SET jit=off;
Basically a performance blackhole for more complex queries. Most OSM related projects disable it straight away as it only creates headaches.
https://github.com/osm-search/Nominatim/pull/2559 https://github.com/gravitystorm/openstreetmap-carto/blob/mas...
The performance gains are much higher if the database engine was designed to have JIT-ed execution from day one. Grafting it onto a database engine after the fact, like Postgres, is going to gain substantially less benefit than is theoretically possible. Additionally, it mostly benefits databases where query predicates have a large amount of data to process, it doesn’t do much for OLTP. But in the right system and context, large integer factor performance improvements are routinely achievable.
We live in a world where just last week Google turned off io_uring access on a pile of machines, and that's only "executing" restricted sets of operations. Executable code in kernel = big giant target painted on back.
Using LLVM for JIT is also not the best idea because LLVM is a complex codebase with bugs. Example: https://github.com/ClickHouse/ClickHouse/issues/50323#issuec... Although there are some marginal benefits: https://clickhouse.com/blog/clickhouse-just-in-time-compiler...
[...]
So, without intending any particular hostility:
<puts on maintainer hat>
bcachefs's x86 JIT is:
Nacked-by: Andy Lutomirski <luto@kernel.org> # for x86
<takes off maintainer hat>
This makes me sad, because I like bcachefs. But you can get it merged
without worrying about my NAK by removing the x86 part.
[...]
https://lore.kernel.org/linux-bcachefs/dcf8648b-c367-47a5-a2... > No, I'm saying your concerns are baseless and too vague to address.
If you don't address them, the NAK will stand forever, or at least until a
different group of people take over x86 maintainership. That's fine with me.
I'm generally pretty happy about working with people to get their Linux
code right. But no one is obligated to listen to me.
>
>> text_poke() by itself is *not* the proper API, as discussed. It
>> doesn't serialize adequately, even on x86. We have text_poke_sync()
>> for that.
>
> Andy, I replied explaining the difference between text_poke() and
> text_poke_sync(). It's clear you have no idea what you're talking about,
> so I'm not going to be wasting my time on further communications with
> you.
No problem. Then your x86 code will not be merged upstream.
Best of luck with the actual filesystem parts!
--Andy
https://lore.kernel.org/linux-bcachefs/20230620201851.qrcabl... [...]
> >> Andy, I replied explaining the difference between text_poke() and
> >> text_poke_sync(). It's clear you have no idea what you're talking about,
> >> so I'm not going to be wasting my time on further communications with
> >> you.
>
> One more specific concern: This comment made me very uncomfortable and
> it read to me very much like a personal attack, something which is
> contrary to our code of conduct.
It's not; I prefer to be direct than passive
aggressive, and if I have to bow out of a discussion
that isn't going anywhere I feel I owe an explanation
of _why_. Too much conflict avoidance means things
don't get resolved.
And Andy and I are talking on IRC now, so things are
proceeding in a better direction.Kent seems way out of line. “Direct” is one thing, telling a maintainer they have no idea what they’re talking about is another. It’s totally uncalled for.
Are they trying to imitate Linus, or something? Sorry, you don’t get a license to be an asshole until you literally invent Linux.
That doesn't grant you a license either.
For Linux that was 15+ years after it started, did fine, and conquered the world, without needing one.
It's vital to pay attention to the sheer volume of comments being made that all needed to be substantively responded to by one developer. The sense I get is very much that the appropriate attitude is: don't join the dog-pile if you don't want to be snapped at.
Happy to be put right though.
https://lore.kernel.org/linux-bcachefs/ZGB1eevk%2Fu2ssIBT@mo...
[...]
testing random btree updates:
dynamically generated unpack:
rand_insert: 20.0 MiB with 1 threads in 33 sec, 1609 nsec per iter, 607 KiB per sec
old C unpack:
rand_insert: 20.0 MiB with 1 threads in 35 sec, 1672 nsec per iter, 584 KiB per sec
the Eric Biggers special:
rand_insert: 20.0 MiB with 1 threads in 35 sec, 1676 nsec per iter, 583 KiB per sec
[...]All in all, while a good Phoronix benchmark is what can make it supplant all other Linux filesystems, I appreciate the security concerns raised by maintainers, and I agree that a better approach would have been to use the default code at first, and seek advice on how to improve its performance. Thankfully, it looks like that is where it is going now.
They have engineers dedicated to 0.5-2.0% improvements in the kernel