Bug 2097433 - Change the default value for the DefaultMemoryAccounting variable from 'yes' to 'no'
Summary: Change the default value for the DefaultMemoryAccounting variable from 'yes' ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: systemd
Version: 8.7
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-15 16:43 UTC by Nico Pache
Modified: 2023-08-08 03:08 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-30 11:46:08 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-125373 0 None None None 2022-06-15 16:51:50 UTC

Comment 2 Michal Sekletar 2022-06-29 09:34:48 UTC
Actually, changing the default in systemd might not help because MemoryAccounting can be enabled implicitly when some units contains memory cgroup related limit option (e.g. MemoryMax). I think that proposed kernel solution is better approach and would be consistent with how this works with cgroup v2, i.e. no per cgroup swappiness.

Comment 3 Rafael Aquini 2022-06-29 12:37:54 UTC
(In reply to Michal Sekletar from comment #2)
> Actually, changing the default in systemd might not help because
> MemoryAccounting can be enabled implicitly when some units contains memory
> cgroup related limit option (e.g. MemoryMax). I think that proposed kernel
> solution is better approach and would be consistent with how this works with
> cgroup v2, i.e. no per cgroup swappiness.

The fundamental problem, as I understand it, in this case is the fact that
systemd slices are initially created with the default vm.swappiness value,
instead of picking the value set up in sysctl.conf.

The problem that systemd slices are creating affect users that still think
they're running their apps without cgroups, and tuning the system in a global
fashion (by tweaking sysctl knobs directly, as opposed to using units). 
So, I think a better approach, perhaps, would be making sure systemd does not
create its slices before the sysctls are adjusted accordingly to what is set in
sysctl.conf by the user 

We should try avoid patching the kernel to band-aid this corner case created
by the decision that everything concealed runs within a cgroup.

Comment 4 Lukáš Nykrýn 2022-06-29 13:36:48 UTC
(In reply to Rafael Aquini from comment #3)
> (In reply to Michal Sekletar from comment #2)
> > Actually, changing the default in systemd might not help because
> > MemoryAccounting can be enabled implicitly when some units contains memory
> > cgroup related limit option (e.g. MemoryMax). I think that proposed kernel
> > solution is better approach and would be consistent with how this works with
> > cgroup v2, i.e. no per cgroup swappiness.
> 
> The fundamental problem, as I understand it, in this case is the fact that
> systemd slices are initially created with the default vm.swappiness value,
> instead of picking the value set up in sysctl.conf.
> 
> The problem that systemd slices are creating affect users that still think
> they're running their apps without cgroups, and tuning the system in a global
> fashion (by tweaking sysctl knobs directly, as opposed to using units). 
> So, I think a better approach, perhaps, would be making sure systemd does not
> create its slices before the sysctls are adjusted accordingly to what is set
> in
> sysctl.conf by the user 

This is unfortunately not possible to do due to systemd's design. We need to create the root cgroup before we run anything, that includes systemd-sysctl.


> 
> We should try avoid patching the kernel to band-aid this corner case created
> by the decision that everything concealed runs within a cgroup.

Comment 5 Barry Marson 2022-06-30 00:24:51 UTC
Additionally, this is not just about getting vm.swappiness from a sysctl.conf.  Tuned actually sets it in key profiles and of course the value can be changed at anytime.

/usr/lib/tuned/accelerator-performance/tuned.conf:vm.swappiness=10
/usr/lib/tuned/latency-performance/tuned.conf:vm.swappiness=10
/usr/lib/tuned/throughput-performance/tuned.conf:vm.swappiness=10

Barry


Note You need to log in before you can comment on or make changes to this bug.