Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-04-03 Thread Michael Chapman
On Mon, 3 Apr 2023, Lennart Poettering wrote: > On Sa, 01.04.23 06:16, Michael Chapman (m...@very.puzzling.org) wrote: > > > > Well, in larger environments the goal is typically to saturate all > > > hosts, but not overload them. i.e. maximizing your ROI. No need to > > > fall from one extreme

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-04-03 Thread Lennart Poettering
On Sa, 01.04.23 06:16, Michael Chapman (m...@very.puzzling.org) wrote: > > Well, in larger environments the goal is typically to saturate all > > hosts, but not overload them. i.e. maximizing your ROI. No need to > > fall from one extreme into the other. Today's Linux can actually > > achieve

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-04-03 Thread Lennart Poettering
On Fr, 31.03.23 13:34, Christoph Anton Mitterer (cales...@scientia.org) wrote: > Hey. > > Just for better understanding: > > AFAIU, the main idea of having swap despite enough memory was the > following: > > Unless when processes explicitly release memory (or get stopped), the > kernel can mostly

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Michael Chapman
On Sat, 1 Apr 2023, Uoti Urpala wrote: > On Sat, 2023-04-01 at 06:16 +1100, Michael Chapman wrote: > > On Fri, 31 Mar 2023, Lennart Poettering wrote: > > [...] > > > Presumably your system mmaps ELF binaries, VM images, and similar > > > stuff into memory. if you don't allow anonymous memory to

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Uoti Urpala
On Sat, 2023-04-01 at 06:16 +1100, Michael Chapman wrote: > On Fri, 31 Mar 2023, Lennart Poettering wrote: > [...] > > Presumably your system mmaps ELF binaries, VM images, and similar > > stuff into memory. if you don't allow anonymous memory to backed out > > onto swap, then you basically

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Michael Chapman
On Fri, 31 Mar 2023, Lennart Poettering wrote: [...] > Presumably your system mmaps ELF binaries, VM images, and similar > stuff into memory. if you don't allow anonymous memory to backed out > onto swap, then you basically telling the kernel "please page out > my program code out instead". Which

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Richard Purdie
On Fri, 2023-03-31 at 12:50 +0200, Lennart Poettering wrote: > On Do, 30.03.23 13:16, Phillip Susi (ph...@thesusis.net) wrote: > > > > > Lennart Poettering writes: > > > > > oomd/PSI looks at memory allocation latencies to determine memory > > > pressure. Since you disallow anonymous memory to

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Lennart Poettering
On Fr, 31.03.23 21:54, Michael Chapman (m...@very.puzzling.org) wrote: > > because otherwise you just remove the latencies from anonymous memory > > but you amplify the latencies on file-backed memory. Which is overall > > worse, not better. > > The host isn't doing much IO. Just a bit of logging

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Christoph Anton Mitterer
Hey. Just for better understanding: AFAIU, the main idea of having swap despite enough memory was the following: Unless when processes explicitly release memory (or get stopped), the kernel can mostly reclaim only cached memory,... but if swap is available it can also reclaim anonymous memory.

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Michael Chapman
On Fri, 31 Mar 2023, Lennart Poettering wrote: > On Fr, 31.03.23 07:57, Michael Chapman (m...@very.puzzling.org) wrote: > > > On Fri, 31 Mar 2023, Luca Boccassi wrote: > > [...] > > > No, it does not make "little difference", there are entire subsystems > > > which are much worse off, if not

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Michael Chapman
On Fri, 31 Mar 2023, Lennart Poettering wrote: > On Fr, 31.03.23 18:24, Michael Chapman (m...@very.puzzling.org) wrote: > > > On Fri, 31 Mar 2023, Barry wrote: > > [...] > > > If you want to run in ram only then you must turn off the kernel > > > overcommit. > > > Have you done that? If not then

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Lennart Poettering
On Do, 30.03.23 13:16, Phillip Susi (ph...@thesusis.net) wrote: > > Lennart Poettering writes: > > > oomd/PSI looks at memory allocation latencies to determine memory > > pressure. Since you disallow anonymous memory to be paged out and thus > > increase IO on file backed memory you increase the

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Lennart Poettering
On Fr, 31.03.23 07:57, Michael Chapman (m...@very.puzzling.org) wrote: > On Fri, 31 Mar 2023, Luca Boccassi wrote: > [...] > > No, it does not make "little difference", there are entire subsystems > > which are much worse off, if not completely useless, without swap. > > Post-cgroupsv2 memory

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Lennart Poettering
On Fr, 31.03.23 18:24, Michael Chapman (m...@very.puzzling.org) wrote: > On Fri, 31 Mar 2023, Barry wrote: > [...] > > If you want to run in ram only then you must turn off the kernel overcommit. > > Have you done that? If not then you risk processes getting SEGV signals. > > Seriously. It's

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Michael Chapman
On Fri, 31 Mar 2023, Lennart Poettering wrote: > On Do, 30.03.23 18:56, Michael Chapman (m...@very.puzzling.org) wrote: > > > On Thu, 30 Mar 2023, Lennart Poettering wrote: > > > On Mi, 29.03.23 13:53, Christoph Anton Mitterer (cales...@scientia.org) > > > wrote: > > > > > > > > > That's a bad

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Lennart Poettering
On Do, 30.03.23 18:56, Michael Chapman (m...@very.puzzling.org) wrote: > On Thu, 30 Mar 2023, Lennart Poettering wrote: > > On Mi, 29.03.23 13:53, Christoph Anton Mitterer (cales...@scientia.org) > > wrote: > > > > > > > That's a bad idea btw. I'd advise you not to do that: on modern > > > > >

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Lennart Poettering
On Do, 30.03.23 01:39, Christoph Anton Mitterer (cales...@scientia.org) wrote: > Well that's clear, it's just that on my systems (both servers and > workstations) I've never really run into the need to reclaim lots of > anonymous memory. It's the Linux kernel that reclaims memory for you. You

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Michael Chapman
On Fri, 31 Mar 2023, Tomasz Torcz wrote: > On Fri, Mar 31, 2023 at 06:24:09PM +1100, Michael Chapman wrote: > > On Fri, 31 Mar 2023, Barry wrote: > > [...] > > > If you want to run in ram only then you must turn off the kernel > > > overcommit. > > > Have you done that? If not then you risk

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Tomasz Torcz
On Fri, Mar 31, 2023 at 06:24:09PM +1100, Michael Chapman wrote: > On Fri, 31 Mar 2023, Barry wrote: > [...] > > If you want to run in ram only then you must turn off the kernel overcommit. > > Have you done that? If not then you risk processes getting SEGV signals. > > Seriously. It's almost as

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Michael Chapman
On Fri, 31 Mar 2023, Barry wrote: [...] > If you want to run in ram only then you must turn off the kernel overcommit. > Have you done that? If not then you risk processes getting SEGV signals. Seriously. It's almost as if nobody here is actually reading anything of what I've written!

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-31 Thread Barry
> On 31 Mar 2023, at 00:51, Michael Chapman wrote: > > On Fri, 31 Mar 2023, Phillip Susi wrote: >> >> Michael Chapman writes: >> >>> What specifically is the difference between: >>> >>> * swap does not exist at all; >>> * swap is full of data that will not be swapped in for weeks or

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-30 Thread Michael Chapman
On Fri, 31 Mar 2023, Phillip Susi wrote: > > Michael Chapman writes: > > > What specifically is the difference between: > > > > * swap does not exist at all; > > * swap is full of data that will not be swapped in for weeks or months; > > That's the wrong question. Nevertheless it was the

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-30 Thread Phillip Susi
Michael Chapman writes: > What specifically is the difference between: > > * swap does not exist at all; > * swap is full of data that will not be swapped in for weeks or months; That's the wrong question. The question is, what is the difference between having NO swap, and having some swap

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-30 Thread Michael Chapman
On Fri, 31 Mar 2023, Luca Boccassi wrote: [...] > No, it does not make "little difference", there are entire subsystems > which are much worse off, if not completely useless, without swap. > Post-cgroupsv2 memory controller things are considerably different on > this front, and old "common wisdom"

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-30 Thread Phillip Susi
Lennart Poettering writes: > oomd/PSI looks at memory allocation latencies to determine memory > pressure. Since you disallow anonymous memory to be paged out and thus > increase IO on file backed memory you increase the latencies > unnecessarily, thus making oomd trigger earlier. Did this

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-30 Thread Luca Boccassi
On Thu, 30 Mar 2023 at 11:09, Michael Chapman wrote: > > On Thu, 30 Mar 2023, Luca Boccassi wrote: > > On Thu, 30 Mar 2023 at 10:15, Michael Chapman > > wrote: > > > > > > On Thu, 30 Mar 2023, Lennart Poettering wrote: > > > > On Mi, 29.03.23 13:53, Christoph Anton Mitterer

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-30 Thread Michael Chapman
On Thu, 30 Mar 2023, Greg KH wrote: > On Thu, Mar 30, 2023 at 09:09:19PM +1100, Michael Chapman wrote: > > On Thu, 30 Mar 2023, Luca Boccassi wrote: > > > On Thu, 30 Mar 2023 at 10:15, Michael Chapman > > > wrote: > > > > > > > > On Thu, 30 Mar 2023, Lennart Poettering wrote: > > > > > On Mi,

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-30 Thread Greg KH
On Thu, Mar 30, 2023 at 09:09:19PM +1100, Michael Chapman wrote: > On Thu, 30 Mar 2023, Luca Boccassi wrote: > > On Thu, 30 Mar 2023 at 10:15, Michael Chapman > > wrote: > > > > > > On Thu, 30 Mar 2023, Lennart Poettering wrote: > > > > On Mi, 29.03.23 13:53, Christoph Anton Mitterer

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-30 Thread Michael Chapman
On Thu, 30 Mar 2023, Luca Boccassi wrote: > On Thu, 30 Mar 2023 at 10:15, Michael Chapman wrote: > > > > On Thu, 30 Mar 2023, Lennart Poettering wrote: > > > On Mi, 29.03.23 13:53, Christoph Anton Mitterer (cales...@scientia.org) > > > wrote: > > > > > > > > > That's a bad idea btw. I'd advise

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-30 Thread Luca Boccassi
On Thu, 30 Mar 2023 at 10:15, Michael Chapman wrote: > > On Thu, 30 Mar 2023, Lennart Poettering wrote: > > On Mi, 29.03.23 13:53, Christoph Anton Mitterer (cales...@scientia.org) > > wrote: > > > > > > > That's a bad idea btw. I'd advise you not to do that: on modern > > > > > systems you want

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-30 Thread Michael Chapman
On Thu, 30 Mar 2023, Lennart Poettering wrote: > On Mi, 29.03.23 13:53, Christoph Anton Mitterer (cales...@scientia.org) wrote: > > > > > That's a bad idea btw. I'd advise you not to do that: on modern > > > > systems you want swap, since it makes anonymous memory reclaimable. > > > > I > > > >

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-29 Thread Christoph Anton Mitterer
Hey Lennart. On Wed, 2023-03-29 at 16:35 +0200, Lennart Poettering wrote: > In almost all scenarios you want swap, regardless if little RAM or a > lot. For specialist cases where you run everything from memory, and > not even programs are backed by disk there might be exceptions. Similar to the

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-29 Thread Lennart Poettering
On Mi, 29.03.23 14:07, Christoph Anton Mitterer (cales...@scientia.org) wrote: > When I use  >systemd.log_level=debug systemd.log_target=console > in the kernel parameters, and then do systemctl hibernate during the > system I get: > Mar 29 12:04:48 hbt systemd-logind[780]: Got message

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-29 Thread Lennart Poettering
On Mi, 29.03.23 13:53, Christoph Anton Mitterer (cales...@scientia.org) wrote: > > > That's a bad idea btw. I'd advise you not to do that: on modern > > > systems you want swap, since it makes anonymous memory reclaimable. > > > I > > > am not sure where you are getting this idea from that swap

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-29 Thread Christoph Anton Mitterer
When I use  systemd.log_level=debug systemd.log_target=console in the kernel parameters, and then do systemctl hibernate during the system I get: Mar 29 12:04:48 hbt systemd-logind[780]: Got message type=method_call sender=:1.9 destination=org.freedesktop.login1 path=/org/freedesktop/login1

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-29 Thread Christoph Anton Mitterer
Hey. On Wed, 2023-03-29 at 10:20 +0200, Lennart Poettering wrote: > > That's a bad idea btw. I'd advise you not to do that: on modern > > systems you want swap, since it makes anonymous memory reclaimable. > > I > > am not sure where you are getting this idea from that swap was > > bad. Well I

Re: [systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-29 Thread Lennart Poettering
On Mi, 29.03.23 04:43, Christoph Anton Mitterer (cales...@scientia.org) wrote: Hi! > I guess many people nowadays will run without any swap for the normal > paging use, but only have it for hibernation (at least on laptops). That's a bad idea btw. I'd advise you not to do that: on modern

[systemd-devel] how to let systemd hibernate start/stop the swap area?

2023-03-28 Thread Christoph Anton Mitterer
Hey folks. I guess many people nowadays will run without any swap for the normal paging use, but only have it for hibernation (at least on laptops). Since there's nothing yet like [0] I wanted to set up systemd to automatically start/stop the swap right before/after hibernate/resume. And I also