From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: linux-mm@kvack.org
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>,
Nitin Gupta <ngupta@vflare.org>,
Konrad Wilk <konrad.wilk@oracle.com>,
Sasha Levin <levinsasha928@gmail.com>
Subject: help converting zcache from sysfs to debugfs?
Date: Tue, 19 Jun 2012 17:29:03 -0700 (PDT) [thread overview]
Message-ID: <6b8ff49a-a5aa-4b9b-9425-c9bc7df35a34@default> (raw)
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>
next reply other threads:[~2012-06-20 0:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-20 0:29 Dan Magenheimer [this message]
2012-06-20 11:03 ` help converting zcache from sysfs to debugfs? 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6b8ff49a-a5aa-4b9b-9425-c9bc7df35a34@default \
--to=dan.magenheimer@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=levinsasha928@gmail.com \
--cc=linux-mm@kvack.org \
--cc=ngupta@vflare.org \
--cc=sjenning@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).