public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ravikiran G Thirumalai <kiran@in.ibm.com>
To: Rik van Riel <riel@conectiva.com.br>
Cc: linux-kernel@vger.kernel.org, lse <lse-tech@lists.sourceforge.net>
Subject: Re: [RFC] Scalable statistics counters using kmalloc_percpu
Date: Mon, 29 Jul 2002 19:48:25 +0530	[thread overview]
Message-ID: <20020729194825.B2393@in.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.44L.0207261225160.3086-100000@imladris.surriel.com>; from riel@conectiva.com.br on Fri, Jul 26, 2002 at 12:27:40PM -0300

On Fri, Jul 26, 2002 at 12:27:40PM -0300, Rik van Riel wrote:
> On Fri, 26 Jul 2002, Ravikiran G Thirumalai wrote:
> 
> > Rik, You were interested in using this.  Does this implementation suit
> > your needs?
> 
> >From a quick glance it looks like it will.
> 
> However, it might be more efficient to put the statistics
> in one file in /proc with named fields, or have a way to
> group them in one or multiple files.
>

Ok, Here's what I have in mind;
Introduce a statctr_base_t type which represents a group of counters on
the same proc file, have statctr_base_init and statctr_base_cleanup
to create and destroy these datatypes.  Each line in the /proc file
will be of the form
countername value

Here are the changed and new interfaces:
1. int statctr_init(statctr_t *statctr, unsigned long value,
		statctr_base_t *base, const char *countername, int flags);
2. void statctr_cleanup(statctr_t *);
3. int statctr_base_init(statctr_base_t *base,
                struct proc_dir_entry *procbase, const char *procname);
4. extern void statctr_base_cleanup(satctr_base_t *base);

Does this look ok?
 
> Not sure about that, though ... really depends on how
> expensive stat+open+read+close is compared to parsing a
> file with multiple fields.
>

Also, when you group counters into a single file, you inadvertently 
end up  reading counters you may not require at that time.
Reads to  statctrs are not as cheap as cpu local writes. You'll have to 
take that into account too i guess ..... 

Thanks,
Kiran

  parent reply	other threads:[~2002-07-29 14:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-26 15:10 [RFC] Scalable statistics counters using kmalloc_percpu Ravikiran G Thirumalai
2002-07-26 15:27 ` Rik van Riel
2002-07-26 15:54   ` [Lse-tech] " Dipankar Sarma
2002-07-29 14:18   ` Ravikiran G Thirumalai [this message]
2002-07-26 18:46 ` Andrew Morton
2002-07-26 19:46   ` William Lee Irwin III
2002-07-26 19:50     ` Robert Love
2002-07-26 19:53       ` William Lee Irwin III
2002-07-26 20:15       ` [Lse-tech] " William Lee Irwin III
2002-07-26 20:22         ` Robert Love
2002-07-27 12:00           ` Zwane Mwaikambo
2002-07-27 12:21         ` Zwane Mwaikambo
2002-07-28 21:33           ` Martin J. Bligh
2002-07-29 10:31             ` Zwane Mwaikambo
2002-07-29 14:54               ` Martin J. Bligh
2002-07-27  1:56   ` Rusty Russell
2002-07-27  4:45     ` Andrew Morton
2002-07-27  4:59       ` Rusty Russell
2002-07-27  6:16         ` Andrew Morton
2002-07-29 10:57   ` Ravikiran G Thirumalai
2002-07-29 18:23     ` Andrew Morton
2002-07-29 18:50       ` [Lse-tech] " Dipankar Sarma
2002-07-30 11:25       ` Ravikiran G Thirumalai

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=20020729194825.B2393@in.ibm.com \
    --to=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