From: Mike Kravetz <kravetz@us•ibm.com>
To: Christopher Yeoh <cyeoh@samba•org>
Cc: Chris Yeoh <yeohc@au1•ibm.com>,
Bryan Rosenburg <rosnbrg@us•ibm.com>,
linuxppc-dev@ozlabs•org
Subject: Re: Collecting hypervisor call stats
Date: Tue, 6 Jun 2006 09:46:46 -0700 [thread overview]
Message-ID: <20060606164646.GA3161@w-mikek2.ibm.com> (raw)
In-Reply-To: <17534.30511.192632.558778@localhost.localdomain>
On Thu, Jun 01, 2006 at 03:12:15PM +1000, Christopher Yeoh wrote:
> Here's a patch we've used for collecting hcall counts and times.
Thanks for the patch/code Chris! I'm using this as a basis for something
that we may want to merge into the tree. Just a couple of questions.
Your 'wrappers' have the following general form:
> +long plpar_hcall(unsigned long opcode, unsigned long arg1,
> + unsigned long arg2, unsigned long arg3,
> + unsigned long arg4, unsigned long *out1,
> + unsigned long *out2, unsigned long *out3)
> +{
> + long retcode;
> + unsigned long t_entry;
> + int opcode_index;
> +
> + opcode_index = map_hcall_to_index(opcode);
> +
> + t_entry = mfspr(SPRN_PURR);
> + barrier();
> +
> + retcode = plpar_hcall_real(opcode, arg1, arg2, arg3, arg4,
> + out1, out2, out3);
> +
> + barrier();
> + get_cpu_var(hcall_type_count)[opcode_index]++;
> + put_cpu_var(hcall_type_count);
> + get_cpu_var(hcall_type_time)[opcode_index] += mfspr(SPRN_PURR) - t_entry;
> + put_cpu_var(hcall_type_time);
> +
> + return retcode;
> +};
Can you explain the need for barrier(s) before and after the call to the
real routine? It usually takes me a couple days of thought to figure out
exactly where these are needed. :)
The use of get_cpu_var/put_cpu_var result in disabling/enabling preemption.
I can understand why this would be desirable to assure the accuracy of the
statistics. But, I was wondering if the desired accuracy is worth the added
overhead. My thought was to make these as lightweight as possible and
sacrifice some accuracy if necessary. After all, no 'internal decisions' are
being made because of this data. It is simply exposed to user land.
Thoughts?
Thanks,
--
Mike
next prev parent reply other threads:[~2006-06-06 17:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-31 20:41 Collecting hypervisor call stats Mike Kravetz
2006-05-31 21:25 ` Geoff Levand
2006-05-31 22:40 ` Paul Mackerras
2006-05-31 22:58 ` Mike Kravetz
2006-06-01 5:26 ` Benjamin Herrenschmidt
2006-06-01 18:14 ` Arnd Bergmann
2006-06-01 21:57 ` Benjamin Herrenschmidt
2006-06-01 4:34 ` Jimi Xenidis
2006-06-01 5:12 ` Christopher Yeoh
2006-06-06 16:46 ` Mike Kravetz [this message]
2006-06-07 1:08 ` Christopher Yeoh
2006-06-07 22:57 ` Segher Boessenkool
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=20060606164646.GA3161@w-mikek2.ibm.com \
--to=kravetz@us$(echo .)ibm.com \
--cc=cyeoh@samba$(echo .)org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=rosnbrg@us$(echo .)ibm.com \
--cc=yeohc@au1$(echo .)ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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