From: Konrad Rzeszutek Wilk <konrad@darnok.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Nitin Gupta <ngupta@vflare.org>,
linux-mm@kvack.org, Seth Jennings <sjenning@linux.vnet.ibm.com>,
Sasha Levin <levinsasha928@gmail.com>,
Konrad Wilk <konrad.wilk@oracle.com>
Subject: Re: help converting zcache from sysfs to debugfs?
Date: Wed, 20 Jun 2012 07:03:02 -0400 [thread overview]
Message-ID: <CAPbh3rtA3AcR3TU2-dGpgLOR-TfkXcGAmZJASDwAdsEi_GfK-w@mail.gmail.com> (raw)
In-Reply-To: <6b8ff49a-a5aa-4b9b-9425-c9bc7df35a34@default>
[-- Attachment #1: Type: text/plain, Size: 1530 bytes --]
On Jun 19, 2012 8:30 PM, "Dan Magenheimer" <dan.magenheimer@oracle.com>
wrote:
>
> 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.
Which ones must be atomic? Do they really need to be atomic if they are for
diagnostics/developers?
>
> 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.
But only for those counters that truly must be atomic.
>
> 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?)
A dozen that _MUST_ be atomic?
>
> 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
>
[-- Attachment #2: Type: text/html, Size: 2091 bytes --]
next prev parent reply other threads:[~2012-06-20 11:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-20 0:29 Dan Magenheimer
2012-06-20 11:03 ` Konrad Rzeszutek Wilk [this message]
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=CAPbh3rtA3AcR3TU2-dGpgLOR-TfkXcGAmZJASDwAdsEi_GfK-w@mail.gmail.com \
--to=konrad@darnok.org \
--cc=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