From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: linux-ia64@vger.kernel.org
Subject: RE: [PATCH] - Reduce overhead of FP exception logging messages
Date: Wed, 22 Nov 2006 19:23:52 +0000 [thread overview]
Message-ID: <000001c70e6b$be9fed30$ff0da8c0@amr.corp.intel.com> (raw)
Jack Steiner wrote on Wednesday, November 22, 2006 7:55 AM
> Improve the scalability of the fpswa code that rate-limits
> logging of messages.
>
> There are 2 distinctly different problems in this code.
>
> 1) If prctl is used to disable logging, last_time is never
> updated. The result is that fpu_swa_count is zeroed out on
> EVERY fp fault. This causes a very very hot cache line.
> The fix reduces the wallclock time of a 1024p FP exception test
> from 28734 sec to 19 sec!!!
>
> 2) On VERY large systems, excessive messages are logged because
> multiple cpus can each reset or increment fpu_swa_count at
> about the same time. The result is that hundreds of messages
> are logged each second. The fixes reduces the logging rate
> to ~1 per second.
>
>
> +static DEFINE_PER_CPU(struct fpu_swa_msg, cpulast);
> +DECLARE_PER_CPU(struct fpu_swa_msg, cpulast);
> +static struct fpu_swa_msg last __cacheline_aligned;
>
> [...]
>
> + if (!(current->thread.flags & IA64_THREAD_FPEMU_NOPRINT)) {
> + unsigned long count, current_jiffies = jiffies;
> + struct fpu_swa_msg *cp = &__get_cpu_var(cpulast);
Now that you fixed prctl problem mentioned in (1) above, do you really
have to go such elaborated per-cpu method of updating last_time and
fpu_swa_count? fpu_swa_count should really be declared as atomic_t and
use atomic_inc() for updates. And I would think that should rate limit
properly at 5 per 5 sec.
- Ken
reply other threads:[~2006-11-22 19:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='000001c70e6b$be9fed30$ff0da8c0@amr.corp.intel.com' \
--to=kenneth.w.chen@intel.com \
--cc=linux-ia64@vger.kernel.org \
/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