[MINOR] KmsgWriter opens /dev/kmsg on every write #31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
KmsgWriter::writeinmy_init_pid1opens/dev/kmsgfor every single log write. This is slow and could fail under resource pressure during early boot when FDs are scarce.Impact
Performance degradation during boot. Potential log loss if
/dev/kmsgopen fails during resource exhaustion.Files
crates/my_init_pid1/src/main.rs--KmsgWriterstructSuggested Fix
Open
/dev/kmsgonce during init and reuse the file descriptor. Store it as a static or in the writer struct.Per issue description referencing crates/my_init_pid1/src/main.rs: open /dev/kmsg per write is slow and could fail under FD scarcity.