Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
0edf334d
Commit
0edf334d
authored
Oct 26, 2009
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change from a while back: adjust some polling constants to account for
10K HZ kernel.
parent
49ce81e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
+33
-7
tmcd/freebsd/delaysetup
tmcd/freebsd/delaysetup
+33
-7
No files found.
tmcd/freebsd/delaysetup
View file @
0edf334d
...
...
@@ -150,6 +150,17 @@ if ($reinstall || $uninstall) {
if
(
$uninstall
);
}
#
# Figure out the current clock rate
#
my
$currenthz
=
0
;
if
(
$FBSD_VERSION
>=
6
)
{
$currenthz
=
`
sysctl -n kern.clockrate 2>/dev/null
`;
if
(
$currenthz
=~
/hz = (\d+),/
)
{
$currenthz
=
int
(
$
1
);
}
}
#
# Update the delays configuration. Also run the the commands to make
# the changes. Since a node cannot be doing delays and linkdelays at the
...
...
@@ -266,8 +277,9 @@ sub DelaySetup
print
DEL
"
ifconfig
$if1
-polling
\n
";
print
DEL
"
ifconfig
$if2
-polling
\n
";
}
}
else
{
print
DEL
"
sysctl -w kern.polling.enable=0
\n
";
}
print
DEL
"
sysctl -w kern.polling.enable=0
\n
";
print
DEL
"
fi
\n
";
print
DEL
"
exit 0
\n
";
...
...
@@ -414,6 +426,22 @@ sub DelaySetup
print
DEL
"
ifconfig
$if1
polling
\n
";
print
DEL
"
ifconfig
$if2
polling
\n
";
}
#
# Our kernel is running hot (10000HZ) so adjust some params.
# XXX this check should be done in the generated shell script,
# but I am too lazy to parse sysctl output with awk/sed and it
# doesn't matter right now as we always rerun this perl wrapper
# to produce the shell script.
#
if
(
$currenthz
>
1000
)
{
print
DEL
"
# adjustments for kernel at
$currenthz
HZ
\n
";
# limit register accesses to 50 times a second
print
DEL
"
sysctl -w kern.polling.reg_frac=200
\n
";
# 80% of CPU can be used for polling activities
print
DEL
"
sysctl -w kern.polling.user_frac=80
\n
";
}
}
else
{
print
DEL
"
sysctl -w kern.polling.enable=1
\n
";
}
...
...
@@ -949,17 +977,15 @@ sub checkkernel($$)
# before that, we had special kernels with hardwired HZ for delay nodes.
#
if
(
$FBSD_VERSION
>=
6
)
{
my
$hz
=
`
sysctl -n kern.clockrate 2>/dev/null
`;
if
(
$hz
=~
/hz = (\d+),/
)
{
$hz
=
int
(
$
1
);
if
(
$hz
!=
$kernelhz
)
{
print
STDOUT
"
Updating kernel HZ (
$hz
->
$kernelhz
) ...
\n
";
if
(
$currenthz
>
0
)
{
if
(
$currenthz
!=
$kernelhz
)
{
print
STDOUT
"
Updating kernel HZ (
$currenthz
->
$kernelhz
) ...
\n
";
#
# See if there is a custom Emulab command line setting.
# If so, warn and do not change.
#
my
$binfo
=
`
$BINDIR
/tmcc bootwhat
`;
if
(
$binfo
=~
/HZ=(\d+)/
&&
int
(
$
1
)
==
$hz
)
{
if
(
$binfo
=~
/HZ=(\d+)/
&&
int
(
$
1
)
==
$
current
hz
)
{
print
"
*** WARNING: custom HZ value on command line,
"
.
"
not changing to
$kernelhz
.
\n
";
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment