From patchwork Fri Apr 28 23:47:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 98378 Delivered-To: patches@linaro.org Received: by 10.140.109.52 with SMTP id k49csp494068qgf; Fri, 28 Apr 2017 16:47:20 -0700 (PDT) X-Received: by 10.98.37.198 with SMTP id l189mr14877656pfl.38.1493423240238; Fri, 28 Apr 2017 16:47:20 -0700 (PDT) Return-Path: Received: from mail-pg0-x22f.google.com (mail-pg0-x22f.google.com. [2607:f8b0:400e:c05::22f]) by mx.google.com with ESMTPS id m8si7677261pgc.224.2017.04.28.16.47.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Apr 2017 16:47:20 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::22f as permitted sender) client-ip=2607:f8b0:400e:c05::22f; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::22f as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-pg0-x22f.google.com with SMTP id t7so21579561pgt.3 for ; Fri, 28 Apr 2017 16:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=6zOvAr7w9Je+JMAWiqEx9jw1+Hwl40rH/1Q9qQB4GlA=; b=fjZnGZH+Cd95rfdjx9glQw7GoIUjOkHdyAwxilOqVs95vWcGfBj3gdfZy8w3s3eSs3 1YwIl8nTm/7Ya3ffTzvAmaR2CE9u/5Zh9uViQRwxST2h0NAPgwifiOMUK+CNppOqTx/7 lt3/Ot7e+e0pD3vzhMSJ7t4lQt5y/rhYvK804= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6zOvAr7w9Je+JMAWiqEx9jw1+Hwl40rH/1Q9qQB4GlA=; b=OfyknoJT3nnPYOHAwRVbbKO/Y4+jXrWBpx2haqN50V8fjam0mJrcqfdOv1SZ/ocy1G qbD9Qsan9Bt5nY37QEfpC8+ABfeRSRwWzDAKBRYAEhvLJySEvUGiSJLDOFSHfClMkr94 sIvlAVeUmaZR1EuBUzHABd6qjSDaAwxEWLdkH+uIw9fB3bgFeKKSzR6X8hSiegiq/AlY l3hI63z8QNrNjvz6TLPEY19Fpqy5FvgYiKfIkHSR8B0YMrffUjF471v2iu9ZlTI7af5i 2TA9FsiQGBDF+vrlOM2KVkXq4rodE188bdVb6TKUCW/fSnBO2ZUiZ8s/h6PIh0ppfqNk lbEA== X-Gm-Message-State: AN3rC/4Ap0v4TujDxsuL7MA6ZDDjbfnX46Islo6cl4hnqBHca25e057/ cJNsStwB7CoSzFDFXCc= X-Received: by 10.98.87.203 with SMTP id i72mr15114298pfj.151.1493423239838; Fri, 28 Apr 2017 16:47:19 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id o5sm15114695pga.64.2017.04.28.16.47.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Apr 2017 16:47:18 -0700 (PDT) From: John Stultz To: Cc: John Stultz , Rob Herring , Sumit Semwal , Vishal Bhoj , Amit Pundir Subject: [PATCH v3] device.mk: Add options to make things perform a bit better in lowmemory situations Date: Fri, 28 Apr 2017 16:47:16 -0700 Message-Id: <1493423236-22257-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 With the db410c especially, the memory constraints are very tight, so try to eek out a bit more memory by setting some options suggested by Bero. Cc: Rob Herring Cc: Sumit Semwal Cc: Vishal Bhoj Cc: Amit Pundir Signed-off-by: John Stultz --- Kconfig | 7 +++++++ configs/db410c_defconfig | 1 + device.mk | 1 + lowmem/Android.mk | 11 +++++++++++ lowmem/device.mk | 8 ++++++++ lowmem/lowmem.rc | 5 +++++ 6 files changed, 33 insertions(+) create mode 100644 lowmem/Android.mk create mode 100644 lowmem/device.mk create mode 100644 lowmem/lowmem.rc -- 2.7.4 diff --git a/Kconfig b/Kconfig index 555127a..b0b48f3 100644 --- a/Kconfig +++ b/Kconfig @@ -143,6 +143,13 @@ config DALVIK_VM_HEAPGROWTHLIMIT help Typically this is less than half the heap size. +config LOWMEM_CONFIG + bool "Enable Lowmem Configuration" + default false + help + Enables some of the reccomended low-memory options for devices + with 1GB or less RAM. + endmenu menu "Image Configuration" diff --git a/configs/db410c_defconfig b/configs/db410c_defconfig index 2923287..e13ad04 100644 --- a/configs/db410c_defconfig +++ b/configs/db410c_defconfig @@ -1,5 +1,6 @@ CONFIG_PRODUCT_DEVICE="db410c" CONFIG_DALVIK_VM_HEAPSIZE=32 +CONFIG_LOWMEM_CONFIG=y CONFIG_BOARD_SYSTEMIMAGE_PARTITION_SIZE=1288491008 CONFIG_BOARD_USERDATAIMAGE_PARTITION_SIZE=5653544960 CONFIG_KERNEL=y diff --git a/device.mk b/device.mk index 1071301..3a1bad7 100644 --- a/device.mk +++ b/device.mk @@ -76,6 +76,7 @@ PRODUCT_PROPERTY_OVERRIDES += \ dalvik.vm.heapmaxfree=$(CONFIG_DALVIK_VM_HEAPMAXFREE)m subdirs-true := lights graphics +subdirs-$(CONFIG_LOWMEM_CONFIG) += lowmem subdirs-$(CONFIG_WIFI) += wifi subdirs-$(CONFIG_ETHERNET) += ethernet subdirs-$(CONFIG_SENSOR) += sensor diff --git a/lowmem/Android.mk b/lowmem/Android.mk new file mode 100644 index 0000000..92dd75a --- /dev/null +++ b/lowmem/Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE:= lowmem.rc + +LOCAL_INIT_RC := $(LOCAL_MODULE) + +include $(BUILD_PHONY_PACKAGE) + +include $(call first-makefiles-under,$(LOCAL_PATH)) diff --git a/lowmem/device.mk b/lowmem/device.mk new file mode 100644 index 0000000..77afd59 --- /dev/null +++ b/lowmem/device.mk @@ -0,0 +1,8 @@ +#lowmem items +PRODUCT_PACKAGES := \ + lowmem.rc \ + +PRODUCT_PROPERTY_OVERRIDES += \ + ro.config.low_ram=true \ + dalvik.vm.jit.codecachesize=0 \ + diff --git a/lowmem/lowmem.rc b/lowmem/lowmem.rc new file mode 100644 index 0000000..dbccba2 --- /dev/null +++ b/lowmem/lowmem.rc @@ -0,0 +1,5 @@ +on boot + write /sys/kernel/mm/ksm/pages_to_scan 100 + write /sys/kernel/mm/ksm/sleep_millisecs 500 + write /sys/kernel/mm/ksm/run 1 + write /proc/sys/vm/page-cluster 0