From ec284233ea2aa801376690313ab97473f84fc2f6 Mon Sep 17 00:00:00 2001 From: Christof Schulze Date: Wed, 15 Feb 2017 20:30:36 +0100 Subject: [PATCH] gluon-core: limit memory that may be used by fq_codel to 1MB per AP on devices with less than 48MB RAM to avoid OOM --- .../etc/hotplug.d/ieee80211/01-gluon-core-codel-memusage | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 package/gluon-core/files/etc/hotplug.d/ieee80211/01-gluon-core-codel-memusage diff --git a/package/gluon-core/files/etc/hotplug.d/ieee80211/01-gluon-core-codel-memusage b/package/gluon-core/files/etc/hotplug.d/ieee80211/01-gluon-core-codel-memusage new file mode 100755 index 00000000..ba37b142 --- /dev/null +++ b/package/gluon-core/files/etc/hotplug.d/ieee80211/01-gluon-core-codel-memusage @@ -0,0 +1,8 @@ +#!/bin/sh +if [ "${ACTION}" = "add" ]; then + + RAM=$(grep MemTotal /proc/meminfo |awk '{print $2}') + if [ "$RAM" -lt $((48*1024)) ]; then + echo "fq_memory_limit 1048576" > "/sys/kernel/debug/ieee80211/$DEVICENAME/aqm" + fi +fi