This is effectively a copy of kern_zstdio.c from D13101. The only
difference is that we always use a static context.
Details
Kernel and user core dumping works. I will integrate the zstd
feature into my kernel dump test suite and verify that it plays
nicely with other kernel dump parameters (mini vs. full, dump
device sector size, etc.)
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 14186 Build 14352: arc lint + arc unit
Event Timeline
We're missing savecore support, manual page additions, as well as inclusion in GENERIC, right?
Yes, this is only the kernel code changes from your original patch. Sorry for not specifying that.
Ok. I like the approach, but don't think it makes sense to commit without the other pieces in place as well.
No, I meant the corresponding userspace and documentation changes. Though yes, this patch doesn't make sense without D13632 either :-).
D'oh, of course. Feel free to commandeer the review and upload the other bits, or update your original review with this diff.
sys/kern/subr_compressor.c | ||
---|---|---|
252 | This necessitates using ZSTD_C (or otherwise hijacking the includes path) because zstd.h tries to include userland headers. |
sys/kern/subr_compressor.c | ||
---|---|---|
252 | Hmmm. Doing that also hijacks malloc. |
sys/kern/subr_compressor.c | ||
---|---|---|
252 | Ugly: it can be blocked with #define ZSTD_KFREEBSD_H. |
sys/kern/subr_compressor.c | ||
---|---|---|
252 | Yeah. That compiles. What do you think of adding GZIO and ZSTDIO to GENERIC on AMD64? Other platforms (aarch64)? |
sys/kern/subr_compressor.c | ||
---|---|---|
252 | That would be ok with me, I would just do it as a separate commit. amd64 and arm64 seems like a reasonable starting point. How much bigger does the kernel binary get with those options configured? As for enabling compressed user or kernel dumps by default, I'm not sure. It's probably the right configuration for a lot of systems. Note that compressing core dumps can consume a ton of CPU time; as a followup to this change we should look at adding a periodic sched_yield() or so somewhere in the write path. IMO this is especially important seeing as there's no way to abort a user core dump. I'd probably ask on -arch for opinions on compressing by default. One compromise might be to add installer support for configuring compressed dumps. |
I'm having difficulty finding time to work on it, so I'd very much appreciate it if you picked it up. Thanks!