linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* help converting zcache from sysfs to debugfs?
@ 2012-06-20  0:29 Dan Magenheimer
  2012-06-20 11:03 ` Konrad Rzeszutek Wilk
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dan Magenheimer @ 2012-06-20  0:29 UTC (permalink / raw)
  To: linux-mm; +Cc: Seth Jennings, Nitin Gupta, Konrad Wilk, Sasha Levin

Zcache (in staging) has a large number of read-only counters that
are primarily of interest to developers.  These counters are currently
visible from sysfs.  However sysfs is not really appropriate and
zcache will need to switch to debugfs before it can be promoted
out of staging.

For some of the counters, it is critical that they remain accurate so
an atomic_t must be used.  But AFAICT there is no way for debugfs
to work with atomic_t.

Is that correct?  Or am I missing something?

Assuming it is correct, I have a workaround but it is ugly:

static unsigned long counterX;
static atomic_t atomic_counterX;

	counterX = atomic_*_return(atomic_counterX)

and use atomic_counter in normal code and counter for debugfs.

This works but requires each counter to be stored twice AND
makes the code look ugly.

Is there a better way?  I can probably bury the ugliness in
macros but that doesn't solve the duplicate storage.  (Though
since there are only about a dozen, maybe it doesn't matter?)

Thanks,
Dan

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2012-06-20 17:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-20  0:29 help converting zcache from sysfs to debugfs? Dan Magenheimer
2012-06-20 11:03 ` Konrad Rzeszutek Wilk
2012-06-20 15:24   ` Dan Magenheimer
2012-06-20 14:20 ` Seth Jennings
2012-06-20 14:36 ` Seth Jennings
2012-06-20 15:30   ` Dan Magenheimer
2012-06-20 15:40     ` Seth Jennings
2012-06-20 16:56     ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).