help converting zcache from sysfs to debugfs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]