Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove memreport to Xen to avoid Qubes trying to get back some memory… #176

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-with-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ docker build -t qubes-mirage-firewall .
echo Building Firewall...
docker run --rm -i -v `pwd`:/tmp/orb-build qubes-mirage-firewall
echo "SHA2 of build: $(sha256sum ./dist/qubes-firewall.xen)"
echo "SHA2 last known: 55a2f823d66473c7d0be66a93289d48b6557f18c9257c6f98aa5a4583663d3c2"
echo "SHA2 last known: d9f7827e2f2c8150ac97a4d348a29f5ee0810a455dbab9233490fff97470f7b8"
echo "(hashes should match for released versions)"
19 changes: 3 additions & 16 deletions memory_pressure.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,8 @@ let meminfo stats =
SwapTotal: 0 kB\n\
SwapFree: 0 kB\n" (mem_total / 1024) (mem_free / 1024)

let report_mem_usage stats =
Lwt.async (fun () ->
let open Xen_os in
Xs.make () >>= fun xs ->
Xs.immediate xs (fun h ->
Xs.write h "memory/meminfo" (meminfo stats)
)
)

let init () =
Gc.full_major ();
let stats = Xen_os.Memory.quick_stat () in
report_mem_usage stats
Gc.full_major ()

let status () =
let stats = Xen_os.Memory.quick_stat () in
Expand All @@ -48,8 +37,6 @@ let status () =
Gc.full_major ();
Xen_os.Memory.trim ();
let stats = Xen_os.Memory.quick_stat () in
if fraction_free stats < 0.6 then begin
report_mem_usage stats;
`Memory_critical
end else `Ok
if fraction_free stats < 0.6 then `Memory_critical
else `Ok
)