Re: debugfs_create_u*() not SMP-safe

From: Greg KH
Date: Fri Jul 18 2008 - 14:56:51 EST

On Fri, Jul 18, 2008 at 06:52:37AM +0300, Eduard - Gabriel Munteanu wrote:
> Hi,
> I noticed debugfs_create_u*() functions don't allow for any precautions
> to be taken while doing r/w to the exported variables. Thus any export of a
> variable isn't SMP-safe.

That's true, so don't do multiple writes to a debugfs file at the same
time :)

> As far as I can tell, this only works safely for constant data. Let me
> ask then, what is the purpose of these functions? Are they intended only
> for unreliable data?

This is for _debug_ data, not stuff that is "critical". This is for
informational or debug purposes only. If you really care about the data
always being correct here, then don't use debugfs, that's not what it is

Hope this helps,

greg k-h
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at