x86/platform/uv: Disable UV BAU by default

For several years, the common practice has been to boot UVs with the
"nobau" parameter on the command line, to disable the BAU.  We've
decided that it makes more sense to just disable the BAU by default in
the kernel, and provide the option to turn it on, if desired.

For now, having the on/off switch doesn't buy us any more than just
reversing the logic would, but we're working towards having the BAU
enabled by default on UV4.  When those changes are in place, having the
on/off switch will make more sense than an enable flag, since the
default behavior will be different depending on the system version.

I've also added a bit of documentation for the new parameter to
Documentation/kernel-parameters.txt.

Signed-off-by: Alex Thorlton <athorlton@sgi.com>
Reviewed-by: Hedi Berriche <hedi@sgi.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1459451909-121845-1-git-send-email-athorlton@sgi.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Alex Thorlton 2016-03-31 14:18:29 -05:00 committed by Ingo Molnar
parent c05c2ec96b
commit 1c532e00a0
3 changed files with 34 additions and 11 deletions

View File

@ -131,6 +131,7 @@ parameter is applicable:
More X86-64 boot options can be found in More X86-64 boot options can be found in
Documentation/x86/x86_64/boot-options.txt . Documentation/x86/x86_64/boot-options.txt .
X86 Either 32-bit or 64-bit x86 (same as X86-32+X86-64) X86 Either 32-bit or 64-bit x86 (same as X86-32+X86-64)
X86_UV SGI UV support is enabled.
XEN Xen support is enabled XEN Xen support is enabled
In addition, the following text indicates that the option: In addition, the following text indicates that the option:
@ -542,6 +543,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Format: <int> (must be >=0) Format: <int> (must be >=0)
Default: 64 Default: 64
bau= [X86_UV] Enable the BAU on SGI UV. The default
behavior is to disable the BAU (i.e. bau=0).
Format: { "0" | "1" }
0 - Disable the BAU.
1 - Enable the BAU.
unset - Disable the BAU.
baycom_epp= [HW,AX25] baycom_epp= [HW,AX25]
Format: <io>,<mode> Format: <io>,<mode>

View File

@ -598,7 +598,7 @@ struct bau_control {
int timeout_tries; int timeout_tries;
int ipi_attempts; int ipi_attempts;
int conseccompletes; int conseccompletes;
short nobau; bool nobau;
short baudisabled; short baudisabled;
short cpu; short cpu;
short osnode; short osnode;

View File

@ -37,7 +37,7 @@ static int timeout_base_ns[] = {
}; };
static int timeout_us; static int timeout_us;
static int nobau; static bool nobau = true;
static int nobau_perm; static int nobau_perm;
static cycles_t congested_cycles; static cycles_t congested_cycles;
@ -106,13 +106,28 @@ static char *stat_description[] = {
"enable: number times use of the BAU was re-enabled" "enable: number times use of the BAU was re-enabled"
}; };
static int __init static int __init setup_bau(char *arg)
setup_nobau(char *arg)
{ {
nobau = 1; int result;
if (!arg)
return -EINVAL;
result = strtobool(arg, &nobau);
if (result)
return result;
/* we need to flip the logic here, so that bau=y sets nobau to false */
nobau = !nobau;
if (!nobau)
pr_info("UV BAU Enabled\n");
else
pr_info("UV BAU Disabled\n");
return 0; return 0;
} }
early_param("nobau", setup_nobau); early_param("bau", setup_bau);
/* base pnode in this partition */ /* base pnode in this partition */
static int uv_base_pnode __read_mostly; static int uv_base_pnode __read_mostly;
@ -131,10 +146,10 @@ set_bau_on(void)
pr_info("BAU not initialized; cannot be turned on\n"); pr_info("BAU not initialized; cannot be turned on\n");
return; return;
} }
nobau = 0; nobau = false;
for_each_present_cpu(cpu) { for_each_present_cpu(cpu) {
bcp = &per_cpu(bau_control, cpu); bcp = &per_cpu(bau_control, cpu);
bcp->nobau = 0; bcp->nobau = false;
} }
pr_info("BAU turned on\n"); pr_info("BAU turned on\n");
return; return;
@ -146,10 +161,10 @@ set_bau_off(void)
int cpu; int cpu;
struct bau_control *bcp; struct bau_control *bcp;
nobau = 1; nobau = true;
for_each_present_cpu(cpu) { for_each_present_cpu(cpu) {
bcp = &per_cpu(bau_control, cpu); bcp = &per_cpu(bau_control, cpu);
bcp->nobau = 1; bcp->nobau = true;
} }
pr_info("BAU turned off\n"); pr_info("BAU turned off\n");
return; return;
@ -1886,7 +1901,7 @@ static void __init init_per_cpu_tunables(void)
bcp = &per_cpu(bau_control, cpu); bcp = &per_cpu(bau_control, cpu);
bcp->baudisabled = 0; bcp->baudisabled = 0;
if (nobau) if (nobau)
bcp->nobau = 1; bcp->nobau = true;
bcp->statp = &per_cpu(ptcstats, cpu); bcp->statp = &per_cpu(ptcstats, cpu);
/* time interval to catch a hardware stay-busy bug */ /* time interval to catch a hardware stay-busy bug */
bcp->timeout_interval = usec_2_cycles(2*timeout_us); bcp->timeout_interval = usec_2_cycles(2*timeout_us);