Thread (16 messages) 16 messages, 7 authors, 2025-01-10

Re: [PATCH v2 0/3] sysfs: constify bin_attribute argument of sysfs_bin_attr_simple_read()

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2025-01-09 08:12:54
Also in: bpf, linux-modules, lkml

On Thu, Jan 09, 2025 at 12:06:09AM -0800, Christoph Hellwig wrote:
On Thu, Jan 09, 2025 at 08:56:37AM +0100, Greg Kroah-Hartman wrote:
quoted
The "pointless" penalty will go away once we convert all instances, and
really, it's just one pointer check, sysfs files should NOT be a hot
path for anything real, and one more pointer check should be cached and
not measurable compared to the real logic behind the binary data coming
from the hardware/kernel, right?

sysfs is NOT tuned for speed at all, so adding more checks like this
should be fine.
Hey, when I duplicated the method to convert sysfs over to a proper
seq_file based approach that avoids buffer overflows you basically
came up with the same line that Alexei had here.
I did?  Sorry about that, I don't remember that.
And that is a lot
more useful than constification. Not that I mind the latter, but it
would be better if it could be done without leaving both variants
in for long.
I agree, we should get the read_new stuff out in the next kernel cycle I
hope.

As for seq_file for sysfs, is that for binary attributes only, or for
all?  I can't recall that at all.

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help