forked from xapi-project/xen-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parent for all active dev branches. To check for conflicts, for easy testing, etc. Autorebased by jj.
- Loading branch information
Showing
65 changed files
with
999 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ | |
xapi-stdext-std | ||
xapi-stdext-threads | ||
xapi-stdext-unix | ||
xapi_timeslice | ||
xml-light2 | ||
xmlm | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(executable | ||
(public_name xshwtune) | ||
(libraries xapi_timeslice unix xapi-log) | ||
(package xapi) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
(* Tunes parameters for the hardware and kernel that we are currently running on. *) | ||
|
||
module D = Debug.Make (struct let name = "xshwtune" end) | ||
|
||
let () = | ||
Debug.log_to_stdout () ; | ||
let recommended = Xapi_timeslice.Recommended.measure () in | ||
D.debug "Recommended OCaml timeslice: %.6fs" recommended ; | ||
|
||
let itimer_min = | ||
Sys.set_signal Sys.sigvtalrm Sys.Signal_ignore ; | ||
let _ = | ||
Unix.setitimer Unix.ITIMER_VIRTUAL | ||
Unix.{it_value= 1e-6; it_interval= 1e-6} | ||
in | ||
let actual = Unix.getitimer Unix.ITIMER_VIRTUAL in | ||
actual.Unix.it_value | ||
in | ||
|
||
D.debug "POSIX itimer granularity: %.6fs" itimer_min ; | ||
let recommended = Float.max itimer_min recommended in | ||
|
||
(* just in case something goes very wrong, ensure it is not too small or big *) | ||
let recommended = recommended |> Float.max 0.001 |> Float.min 0.050 in | ||
D.debug "Adjusted timeslice: %.6fs" recommended ; | ||
|
||
(* Use consistent rounding in debug messages and conf file, | ||
by converting to string in a single place. | ||
*) | ||
let recommended = Printf.sprintf "%.3f" recommended in | ||
|
||
D.info "OCaml timeslice: %s" recommended ; | ||
|
||
let write_conf path = | ||
Out_channel.with_open_text path @@ fun ch -> | ||
Printf.fprintf ch "timeslice=%s" recommended | ||
in | ||
|
||
Array.iteri | ||
(fun i arg -> | ||
if i > 0 then | ||
write_conf arg | ||
) | ||
Sys.argv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.