public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* debugfs_create_u*() not SMP-safe
@ 2008-07-18  3:52 Eduard - Gabriel Munteanu
  2008-07-18 18:46 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Eduard - Gabriel Munteanu @ 2008-07-18  3:52 UTC (permalink / raw)
  To: greg; +Cc: torvalds, Randy Dunlap, linux-kernel, Pekka Enberg

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.

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?

As I see it, they could be replaced by one of the following:
- Have them only export atomic data, that is atomic_t variables.
- Have them take a lock as a parameter, which the read() / write()
  handler grabs. The kernel code that exported the variable should also
  do r/w while holding that same lock.

Or am I wrong?


	Thanks,
	Eduard


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-18 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18  3:52 debugfs_create_u*() not SMP-safe Eduard - Gabriel Munteanu
2008-07-18 18:46 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox