All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Armin Kuster" <akuster808@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: [hardknott 12/14] zram: add support for mem_limit
Date: Mon,  3 May 2021 12:12:05 -0700	[thread overview]
Message-ID: <ef6adcba6f45ff84b5150c372c50f270edc3cc76.1620069042.git.akuster808@gmail.com> (raw)
In-Reply-To: <cover.1620069041.git.akuster808@gmail.com>

From: Sinan Kaya <okaya@kernel.org>

Some targets might be interested in limiting how big
zram can grow. If the variable is set in /etc/default/zram file,
configure it in mem_limit sysfs attribute.

Signed-off-by: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit cb1cf053785bcb5670b2eca7051aa11f29ef80b1)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
 meta-oe/recipes-extended/zram/zram/zram-swap-init | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta-oe/recipes-extended/zram/zram/zram-swap-init b/meta-oe/recipes-extended/zram/zram/zram-swap-init
index ccc3aafe3a..28082f7ff0 100755
--- a/meta-oe/recipes-extended/zram/zram/zram-swap-init
+++ b/meta-oe/recipes-extended/zram/zram/zram-swap-init
@@ -24,3 +24,8 @@ modprobe -q zram || true
 
 zramctl -a ${ZRAM_ALGORITHM} -s ${memzram}KB $device
 mkswap -L "zram-swap" $device
+
+devname="${device##*/}"
+if [ ! -z ${ZRAM_SIZE_LIMIT+x} ]; then
+	echo ${ZRAM_SIZE_LIMIT} > /sys/block/$devname/mem_limit
+fi
-- 
2.17.1


  parent reply	other threads:[~2021-05-03 19:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 19:11 [hardknott 00/14] Patch review May 3 Armin Kuster
2021-05-03 19:11 ` [hardknott 01/14] freeradius: check existence of openssl's commands in bootstrap Armin Kuster
2021-05-03 19:11 ` [hardknott 02/14] tbb: Re-introduce PE Armin Kuster
2021-05-03 19:11 ` [hardknott 03/14] python3-pysonos: Upgrade 0.0.42 -> 0.0.43 Armin Kuster
2021-05-03 19:11 ` [hardknott 04/14] python3-asttokens: Upgrade 2.0.4 -> 2.0.5 Armin Kuster
2021-05-03 19:11 ` [hardknott 05/14] python3-hyperframe: Upgrade 6.0.0 -> 6.0.1 Armin Kuster
2021-05-03 19:11 ` [hardknott 06/14] networkmanager: upgrade 1.30.2 -> 1.30.4 Armin Kuster
2021-05-03 19:12 ` [hardknott 07/14] libdvdread: upgrade 6.1.1 -> 6.1.2 Armin Kuster
2021-05-03 19:12 ` [hardknott 08/14] redis: upgrade 6.2.1 -> 6.2.2 Armin Kuster
2021-05-03 19:12 ` [hardknott 09/14] gimp: Disable vector icons on musl/x86 Armin Kuster
2021-05-03 19:12 ` [hardknott 10/14] gvfs: rdepend on gsettings-desktop-schemas Armin Kuster
2021-05-03 19:12 ` [hardknott 11/14] nss: upgrade 3.63 -> 3.64 Armin Kuster
2021-05-03 19:12 ` Armin Kuster [this message]
2021-05-03 19:12 ` [hardknott 13/14] nostromo: Blacklist and exclude from world builds Armin Kuster
2021-05-03 19:12 ` [hardknott 14/14] packagegroup-meta-webserver: remove nostromo from pkg grp Armin Kuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef6adcba6f45ff84b5150c372c50f270edc3cc76.1620069042.git.akuster808@gmail.com \
    --to=akuster808@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.