Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65a9da76 authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by Automerger Merge Worker
Browse files

Merge "init: Change extra_free_kbytes.sh to add margin relative to the default...

Merge "init: Change extra_free_kbytes.sh to add margin relative to the default watermark level" am: 633ce78b

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2194880



Change-Id: I35745072b0108994cf084cda46dd994f9279c4a0
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f71d80a1 633ce78b
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -77,7 +77,19 @@ then
    exit
fi

watermark_scale=`cat /proc/sys/vm/watermark_scale_factor`
# record the original watermark_scale_factor value
watermark_scale=$(getprop "ro.kernel.watermark_scale_factor")
if [ -z "$watermark_scale" ]
then
    watermark_scale=$(cat /proc/sys/vm/watermark_scale_factor)
    setprop "ro.kernel.watermark_scale_factor" "$watermark_scale"
    # On older distributions with no policies configured setprop may fail.
    # If that happens, use the kernel default of 10.
    if [ -z $(getprop "ro.kernel.watermark_scale_factor") ]
    then
        watermark_scale=10
    fi
fi

# convert extra_free_kbytes to pages
page_size=$(getconf PAGESIZE)