From bec43d11bdb52500bba7d8895c91b5831887a129ac2e49cc3b56165ff8123555 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 23 Jun 2022 21:14:15 +0000 Subject: [PATCH] Accepting request 984708 from home:WernerFink:branches:devel:languages:python - Add patch mem-used-bsc1181475.patch (bsc#1181475) * Adopt change of used memory calculation from upstream of procps OBS-URL: https://build.opensuse.org/request/show/984708 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psutil?expand=0&rev=142 --- mem-used-bsc1181475.patch | 32 ++++++++++++++++++++++++++++++++ python-psutil.changes | 6 ++++++ python-psutil.spec | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 mem-used-bsc1181475.patch diff --git a/mem-used-bsc1181475.patch b/mem-used-bsc1181475.patch new file mode 100644 index 0000000..f98a2a8 --- /dev/null +++ b/mem-used-bsc1181475.patch @@ -0,0 +1,32 @@ +--- + psutil/_pslinux.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/psutil/_pslinux.py ++++ b/psutil/_pslinux.py 2022-06-23 09:43:10.973822573 +0000 +@@ -473,12 +473,6 @@ def virtual_memory(): + except KeyError: + slab = 0 + +- used = total - free - cached - buffers +- if used < 0: +- # May be symptomatic of running within a LCX container where such +- # values will be dramatically distorted over those of the host. +- used = total - free +- + # - starting from 4.4.0 we match free's "available" column. + # Before 4.4.0 we calculated it as (free + buffers + cached) + # which matched htop. +@@ -503,6 +497,12 @@ def virtual_memory(): + if avail > total: + avail = free + ++ used = total - avail ++ if used < 0: ++ # May be symptomatic of running within a LCX container where such ++ # values will be dramatically distorted over those of the host. ++ used = total - free ++ + percent = usage_percent((total - avail), total, round_=1) + + # Warn about missing metrics which are set to 0. diff --git a/python-psutil.changes b/python-psutil.changes index d9b52a3..f6d6591 100644 --- a/python-psutil.changes +++ b/python-psutil.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 23 11:09:31 UTC 2022 - Dr. Werner Fink + +- Add patch mem-used-bsc1181475.patch (bsc#1181475) + * Adopt change of used memory calculation from upstream of procps + ------------------------------------------------------------------- Tue May 24 17:53:52 UTC 2022 - Michael Ströder diff --git a/python-psutil.spec b/python-psutil.spec index a767ef7..98baa18 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -36,6 +36,8 @@ Patch1: skip-obs.patch Patch2: skip_failing_tests.patch # PATCH-FIX-SLE skip_rlimit_tests_on_python2.patch alarrosa@suse.com Patch3: skip_rlimit_tests_on_python2.patch +# PATCH-FIX-SLE adopt change of used memory of procps +Patch4: mem-used-bsc1181475.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes