Skip to content

Commit

Permalink
Do not show usable memory if KDUMP_AUTO_RESIZE is set
Browse files Browse the repository at this point in the history
The number is confusing, because it only shows how much memory is
available at early boot (before kdump-early.service is started). It
is impossible to know exactly how much memory will be allocated at
that time. Rather than making a wild guess, I prefer to avoid
showing any value, so people at least realize that something works
very differently when this option is selected.
  • Loading branch information
Petr Tesarik committed Feb 4, 2022
1 parent 8ce1b66 commit e22e021
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/include/kdump/uifunctions.rb
Expand Up @@ -1333,7 +1333,11 @@ def allocated_memory

# Updates the free memory displayed in the UI
def update_usable_memory
value = Kdump.total_memory - allocated_memory
value = if UI.QueryWidget(Id(:auto_resize), :Value)
"---"
else
Kdump.total_memory - allocated_memory
end
UI.ChangeWidget(Id("usable_memory"), :Value, value.to_s)
end

Expand Down Expand Up @@ -1382,6 +1386,8 @@ def HandleKdumpMemory(_key, event)
UI.ChangeWidget(Id(ret), :Value, send(ret.to_sym) + remaining)
end
update_usable_memory
elsif ret == :auto_resize
update_usable_memory
end

nil
Expand Down

0 comments on commit e22e021

Please sign in to comment.