diff mbox series

[ACT] UBUNTU: SAUCE: ubuntu_lttng_smoke_test: adjust memory limit to fix OOM

Message ID 20210615121517.27517-1-krzysztof.kozlowski@canonical.com
State New
Headers show
Series [ACT] UBUNTU: SAUCE: ubuntu_lttng_smoke_test: adjust memory limit to fix OOM | expand

Commit Message

Krzysztof Kozlowski June 15, 2021, 12:15 p.m. UTC
The test was failing on Azure Standard_B1ms instance due to OOM killer:

    utils:0153| [stdout] gcc: fatal error: Killed signal terminated program cc1

In journalctl:

    kernel: cc1 invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
    ...
    kernel: Free swap  = 0kB
    kernel: Total swap = 0kB
    kernel: 524174 pages RAM

The test sets up a swap on low-memory machines, however the detected
total memory on Standard_B1ms was 1.878 GB, so slightly below the 1.8
threshold and the swap was not setup.

Bump the threshold to really higher value, so this lack of memory won't
hit us.  Setting up swap (when not needed) should not impact the test,
except making setup() slightly slower.

BugLink: https://bugs.launchpad.net/bugs/1847989
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 ubuntu_lttng_smoke_test/ubuntu_lttng_smoke_test.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Krzysztof Kozlowski June 15, 2021, 12:20 p.m. UTC | #1
On 15/06/2021 14:15, Krzysztof Kozlowski wrote:
> The test was failing on Azure Standard_B1ms instance due to OOM killer:
> 
>     utils:0153| [stdout] gcc: fatal error: Killed signal terminated program cc1
> 
> In journalctl:
> 
>     kernel: cc1 invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
>     ...
>     kernel: Free swap  = 0kB
>     kernel: Total swap = 0kB
>     kernel: 524174 pages RAM
> 
> The test sets up a swap on low-memory machines, however the detected
> total memory on Standard_B1ms was 1.878 GB, so slightly below the 1.8

s/below/above/

Maybe this can be corrected when applying...


Best regards,
Krzysztof
Po-Hsu Lin June 16, 2021, 6:29 a.m. UTC | #2
Looks reasonable to me.
Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Applied with s/below/above/ and pushed.

Thanks
Sam
diff mbox series

Patch

diff --git a/ubuntu_lttng_smoke_test/ubuntu_lttng_smoke_test.py b/ubuntu_lttng_smoke_test/ubuntu_lttng_smoke_test.py
index 434a5ac2e5b0..899d91652162 100755
--- a/ubuntu_lttng_smoke_test/ubuntu_lttng_smoke_test.py
+++ b/ubuntu_lttng_smoke_test/ubuntu_lttng_smoke_test.py
@@ -40,7 +40,7 @@  class ubuntu_lttng_smoke_test(test.test):
             df_gb = os.statvfs('/').f_bsize * os.statvfs('/').f_bavail / (1024.**3)
             cmd = 'swapon --show'
             swapon = utils.system_output(cmd)
-            if mem_gb < 1.8 and df_gb > 4.0 and swapon == '':
+            if mem_gb < 3.0 and df_gb > 4.0 and swapon == '':
                 swap_file = '/tmp/swapfile'
                 cmd = 'fallocate -l 2G %s' % swap_file
                 utils.system(cmd)