Forráskód Böngészése

qmemman: clear "not responding" flags when VM require more memory

Clear slow_memset_react/no_progress flags when VM request more memory
than it have assigned. If there is some available, it may be given to
such VM, solving the original problem (not reacting to balloon down
request). In any case, qmemman algorithm should not try to take away
memory from under-provisioned VM.

Fixes QubesOS/qubes-issues#3265
Marek Marczykowski-Górecki 6 éve
szülő
commit
bf4306b815
1 módosított fájl, 9 hozzáadás és 7 törlés
  1. 9 7
      qubes/qmemman/__init__.py

+ 9 - 7
qubes/qmemman/__init__.py

@@ -140,14 +140,16 @@ class SystemState(object):
     def clear_outdated_error_markers(self):
         # Clear outdated errors
         for i in self.domdict.keys():
-            if self.domdict[i].slow_memset_react and \
-                    self.domdict[i].memory_actual <= \
-                    self.domdict[i].last_target + self.XEN_FREE_MEM_LEFT/4:
+            # clear markers excluding VM from memory balance, if:
+            #  - VM have responded to previous request (with some safety margin)
+            #  - VM request more memory than it has assigned
+            # The second condition avoids starving a VM, even when there is
+            # some free memory available
+            if self.domdict[i].memory_actual <= \
+                    self.domdict[i].last_target + self.XEN_FREE_MEM_LEFT/2 or \
+                    self.domdict[i].memory_actual < \
+                    qubes.qmemman.algo.prefmem(self.domdict[i]):
                 self.domdict[i].slow_memset_react = False
-
-            if self.domdict[i].no_progress and \
-                    self.domdict[i].memory_actual <= \
-                    self.domdict[i].last_target + self.XEN_FREE_MEM_LEFT/4:
                 self.domdict[i].no_progress = False
 
     # the below works (and is fast), but then 'xm list' shows unchanged