From: Dipankar Sarma <dipankar@in.ibm.com>
To: Rik van Riel <riel@conectiva.com.br>
Cc: Ravikiran G Thirumalai <kiran@in.ibm.com>,
lse-tech@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [RFC] [PATCH] Scalable Statistics Counters
Date: Wed, 5 Dec 2001 21:09:38 +0530 [thread overview]
Message-ID: <20011205210938.D5254@in.ibm.com> (raw)
In-Reply-To: <20011205163153.E16315@in.ibm.com> <Pine.LNX.4.33L.0112051109340.4079-100000@imladris.surriel.com>
In-Reply-To: <Pine.LNX.4.33L.0112051109340.4079-100000@imladris.surriel.com>; from riel@conectiva.com.br on Wed, Dec 05, 2001 at 11:13:19AM -0200
Hi Rik,
On Wed, Dec 05, 2001 at 11:13:19AM -0200, Rik van Riel wrote:
> On Wed, 5 Dec 2001, Ravikiran G Thirumalai wrote:
>
> > Here is a RFC for Scalable Statistics Counters.
>
> > Initial results of micro benchmarking on 3 cpus showed a 65% reduction
> > in cpu cycles used to update the proposed statistics counter, over
> > global non atomic counter.
>
> I'd use it, if there were a really easy interface to the thing.
>
> This would include both an interface to automagically use it from
> the routines where we increase variables to some automagic reporting
> in /proc ;)
Which interfaces would you consider complicated ?
I guess currently one would do -
struct yyy {
int blah1;
void *blah2;
int stats;
};
void some_init_routine(struct another_struct *op)
{
op->yyy = kmalloc(sizeof(struct yyy), GFP_KERNEL);
if (op->yyy == NULL)
return;
memset(op->yyy, 0, sizeof(struct yyy));
}
void do_something(struct another_struct *op)
{
op->yyy.stats++;
}
int get_stats(struct another_struct *op)
{
return op->yyy.stats;
}
statctr just provides interfaces to do all these three operations.
Did I miss something here ?
What would be your ideal way of using a statistics counter ?
>
> (it'd be so cool if we could just start using a statistic variable
> through some macro and it'd be automatically declared and visible
> in /proc ;))
>
Given a parent /proc directory, it would be possible for statctr to
automatically create corresponding proc entries and automatically
reflect the combined per-cpu counter value.
However if you want to club multiple statctrs together in
a single /proc entry, then it gets complicated and it might
just be easier for the driver to maintain its proc entries.
Thanks
Dipankar
--
Dipankar Sarma <dipankar@in.ibm.com> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.
next prev parent reply other threads:[~2001-12-05 16:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-05 11:01 [RFC] [PATCH] Scalable Statistics Counters Ravikiran G Thirumalai
2001-12-05 13:13 ` Rik van Riel
2001-12-05 15:39 ` Dipankar Sarma [this message]
2001-12-05 20:08 ` Andrew Morton
2001-12-06 3:18 ` Rusty Russell
2001-12-07 12:52 ` Dipankar Sarma
2001-12-07 13:23 ` [Lse-tech] " Andi Kleen
2001-12-08 7:38 ` Rusty Russell
[not found] <20011205163153.E16315@in.ibm.com.suse.lists.linux.kernel>
[not found] ` <Pine.LNX.4.33L.0112051109340.4079-100000@imladris.surriel.com.suse.lists.linux.kernel>
2001-12-05 14:03 ` Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2001-12-06 12:33 [Lse-tech] " Ravikiran G Thirumalai
2001-12-06 12:59 ` Keith Owens
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=20011205210938.D5254@in.ibm.com \
--to=dipankar@in.ibm.com \
--cc=kiran@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=riel@conectiva.com.br \
/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