dcavalca / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
Zbigniew Jędrzejewski-Szmek 11b1c5
From 4b09123e9b0554ed67937ca00a5c4cfd3f9c43ef Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 11b1c5
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Zbigniew Jędrzejewski-Szmek 11b1c5
Date: Fri, 24 Jul 2020 22:05:21 +0200
Zbigniew Jędrzejewski-Szmek 11b1c5
Subject: [PATCH] Bump /tmp size back to 50% of RAM
Zbigniew Jędrzejewski-Szmek 11b1c5
Zbigniew Jędrzejewski-Szmek 11b1c5
This should be enough to fix https://bugzilla.redhat.com/show_bug.cgi?id=1856514.
Zbigniew Jędrzejewski-Szmek 11b1c5
But the limit should be significantly higher than 10% anyway. By setting a
Zbigniew Jędrzejewski-Szmek 11b1c5
limit on /tmp at 10% we'll break many reasonable use cases, even though the
Zbigniew Jędrzejewski-Szmek 11b1c5
machine would deal fine with a much larger fraction devoted to /tmp.
Zbigniew Jędrzejewski-Szmek 11b1c5
(In the first version of this patch I made it 25% with the comment that
Zbigniew Jędrzejewski-Szmek 11b1c5
"Even 25% might be too low.". The kernel default is 50%, and we have been using
Zbigniew Jędrzejewski-Szmek 11b1c5
that seemingly without trouble since https://fedoraproject.org/wiki/Features/tmp-on-tmpfs.
Zbigniew Jędrzejewski-Szmek 11b1c5
So let's just make it 50% again.)
Zbigniew Jędrzejewski-Szmek 11b1c5
Zbigniew Jędrzejewski-Szmek 11b1c5
See 7d85383edbab73274dc81cc888d884bb01070bc2.
Zbigniew Jędrzejewski-Szmek 11b1c5
Zbigniew Jędrzejewski-Szmek 11b1c5
(Another consideration is that we learned from from the whole initiative with
Zbigniew Jędrzejewski-Szmek 11b1c5
zram in Fedora that a reasonable size for zram is 0.5-1.5 of RAM, and that pretty
Zbigniew Jędrzejewski-Szmek 11b1c5
much all systems benefit from having zram or zswap enabled. Thus it is reasonable
Zbigniew Jędrzejewski-Szmek 11b1c5
to assume that it'll become widely used. Taking the usual compression effectiveness
Zbigniew Jędrzejewski-Szmek 11b1c5
of 0.2 into account, machines have effective memory available of between
Zbigniew Jędrzejewski-Szmek 11b1c5
1.0 - 0.2*0.5 + 0.5 = 1.4 (for zram sized to 0.5 of RAM) and
Zbigniew Jędrzejewski-Szmek 11b1c5
1.0 - 0.2*1.5 + 1.5 = 2.2 (for zram 1.5 sized to 1.5 of RAM) times RAM size.
Zbigniew Jędrzejewski-Szmek 11b1c5
This means that the 10% was really like 7-4% of effective memory.)
Zbigniew Jędrzejewski-Szmek 11b1c5
---
Zbigniew Jędrzejewski-Szmek 11b1c5
 units/tmp.mount | 2 +-
Zbigniew Jędrzejewski-Szmek 11b1c5
 1 file changed, 1 insertion(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek 11b1c5
Zbigniew Jędrzejewski-Szmek 11b1c5
diff --git a/units/tmp.mount b/units/tmp.mount
Zbigniew Jędrzejewski-Szmek 11b1c5
index 7066e52261..cf6837852f 100644
Zbigniew Jędrzejewski-Szmek 11b1c5
--- a/units/tmp.mount
Zbigniew Jędrzejewski-Szmek 11b1c5
+++ b/units/tmp.mount
Zbigniew Jędrzejewski-Szmek 11b1c5
@@ -22,4 +22,4 @@ After=swap.target
Zbigniew Jędrzejewski-Szmek 11b1c5
 What=tmpfs
Zbigniew Jędrzejewski-Szmek 11b1c5
 Where=/tmp
Zbigniew Jędrzejewski-Szmek 11b1c5
 Type=tmpfs
Zbigniew Jędrzejewski-Szmek 11b1c5
-Options=mode=1777,strictatime,nosuid,nodev,size=10%,nr_inodes=400k
Zbigniew Jędrzejewski-Szmek 11b1c5
+Options=mode=1777,strictatime,nosuid,nodev,size=50%,nr_inodes=400k