All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Joshua Kinard <kumba@gentoo.org>
Cc: Linux MIPS List <linux-mips@linux-mips.org>
Subject: Re: [PATCH v3] MIPS: R12000: Enable branch prediction global history
Date: Wed, 3 Jun 2015 10:21:25 +0200	[thread overview]
Message-ID: <20150603082124.GH9839@linux-mips.org> (raw)
In-Reply-To: <556E2C6D.6070802@gentoo.org>

On Tue, Jun 02, 2015 at 06:21:33PM -0400, Joshua Kinard wrote:

> From: Joshua Kinard <kumba@gentoo.org>
> 
> The R12000 added a new feature to enhance branch prediction called
> "global history".  Per the Vr10000 Series User Manual (U10278EJ4V0UM),
> Coprocessor 0, Diagnostic Register (22):
> 
> """
> If bit 26 is set, branch prediction uses all eight bits of the global
> history register.  If bit 26 is not set, then bits 25:23 specify a count
> of the number of bits of global history to be used. Thus if bits 26:23
> are all zero, global history is disabled.
> 
> The global history contains a record of the taken/not-taken status of
> recently executed branches, and when used is XOR'ed with the PC of a
> branch being predicted to produce a hashed value for indexing the BPT.
> Some programs with small "working set of conditional branches" benefit
> significantly from the use of such hashing, some see slight performance
> degradation.
> """
> 
> This patch enables global history on R12000 CPUs and up by setting bit
> 26 in the branch prediction diagnostic register (CP0 $22) to '1'.  Bits
> 25:23 are left alone so that all eight bits of the global history
> register are available for branch prediction.

Will apply but could you also submit a patch to set cpu_has_bp_ghist to
0/1 as applicable in all cpu-feature-overrides.h?

Also the manual suggests this CPU feature may not always be neneficial
for performance so I'm wondering if we should add a way to modify it
at runtime.

I'm curious, have you checked the default setting of the global history
on kernel entry?

  Ralf

  reply	other threads:[~2015-06-03  8:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 22:21 [PATCH v3] MIPS: R12000: Enable branch prediction global history Joshua Kinard
2015-06-03  8:21 ` Ralf Baechle [this message]
2015-06-04  3:27   ` Joshua Kinard

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=20150603082124.GH9839@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=kumba@gentoo.org \
    --cc=linux-mips@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.