[From nobody Thu Jun 25 05:55:58 2020
Received: from delta.hotplug.ru ([2a04:ac00:1:3dd8::10])
 by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
 id 1joBLk-0007pW-BJ
 for openwrt-devel@lists.openwrt.org; Wed, 24 Jun 2020 19:46:25 +0000
Received: from [192.168.168.60] (0890868029.static.corbina.ru [89.179.126.107])
 by delta.hotplug.ru (Postfix) with ESMTPSA id 87E4C1055AD;
 Wed, 24 Jun 2020 22:30:35 +0300 (MSK)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hotplug.ru; s=mx;
 t=1593027035; bh=BfNRGhusIRS+fjiNmfdxO+bomfDtIJUZVAKfVqntdys=;
 h=Subject:To:Cc:References:From:Date:In-Reply-To;
 b=SWlNxz603dPokjo/4fUPrhb2qscsGw+NYQUutoYGKTJ/dbEwT7e3jQQoHSN1P8mVC
 P1bwAkIJJ05+obVWE93K7WRAwJNmHXAPVPAIeeYPVJUzCyFHCMxVtGMMjpaHmT3JwY
 r1NDi5fz4TNP4vsMk2QMuBwTGC4rc8awm0V4Uc8o=
Subject: Re: [PATCH] zram-swap: enable swap discard
To: Rui Salvaterra &lt;rsalvaterra@gmail.com&gt;, openwrt-devel@lists.openwrt.org
Cc: john@phrozen.org
References: &lt;20200623112953.3454-1-rsalvaterra@gmail.com&gt;
From: Emil Muratov &lt;gpm@hotplug.ru&gt;
Message-ID: &lt;c4539e18-8d09-3e22-055c-502465252e43@hotplug.ru&gt;
Date: Wed, 24 Jun 2020 22:30:34 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.8.0
MIME-Version: 1.0
In-Reply-To: &lt;20200623112953.3454-1-rsalvaterra@gmail.com&gt;
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-GB
X-Spam-Note: CRM114 invocation failed
X-Spam-Score: -0.2 (/)
X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary:
 Content analysis details:   (-0.2 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
 valid
 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from
 envelope-from domain
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
 author's domain

On 23.06.2020 14:29, Rui Salvaterra wrote:

zram swap discard is enabled by default, no need to specify additional 
option. Pls, check for example info output in
https://github.com/openwrt/openwrt/pull/1515

&gt; Zram block devices have supported trim/discard for over six years, let's
&gt; enable it. This allows the zram device to actually free up allocated memory
&gt; when it's marked as unused in the filesystem metadata, as explained in more
&gt; detail in the original commit message [1].
&gt;
&gt; [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/block/zram/zram_drv.c?h=linux-4.14.y&amp;id=f4659d8e620d08bd1a84a8aec5d2f5294a242764
&gt;
&gt; Signed-off-by: Rui Salvaterra &lt;rsalvaterra@gmail.com&gt;
&gt; ---
&gt;   package/system/zram-swap/files/zram.init | 2 +-
&gt;   1 file changed, 1 insertion(+), 1 deletion(-)
&gt;
&gt; diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init
&gt; index 49140ad406..d33e779850 100755
&gt; --- a/package/system/zram-swap/files/zram.init
&gt; +++ b/package/system/zram-swap/files/zram.init
&gt; @@ -182,7 +182,7 @@ start()
&gt;   	zram_comp_streams &quot;$zram_dev&quot;
&gt;   	echo $(( $zram_size * 1024 * 1024 )) &gt;&quot;/sys/block/$( basename &quot;$zram_dev&quot; )/disksize&quot;
&gt;   	mkswap &quot;$zram_dev&quot;
&gt; -	swapon $zram_priority &quot;$zram_dev&quot;
&gt; +	swapon -d $zram_priority &quot;$zram_dev&quot;
&gt;   }
&gt;   
&gt;   stop()



]