On Fri, Apr 30, 2021 at 8:09 PM Michael <confabul...@kintzios.com> wrote:

> On Friday, 30 April 2021 02:30:51 BST Adam Carter wrote:
> > On Wed, Apr 28, 2021 at 7:58 PM Kai Peter <k...@lists.qware.org> wrote:
> > > Hi,
> > >
> > > I have an issue with a machine where I'm not able to detect the real
> > > root cause. It hangs up totally. It seems like it was running out of
> > > memory - but why? Hopefully somebody can give me some insight. As far I
> > > can see right now, it hangs up a few hours after an `emerge --update
> > > --newuse --deep --with-bdeps=y @world`.
> > >
> > > The machine is an Intel Atom with 8 GB RAM (physical, max) and 24 GB
> > > swap (a file). So 32 GB RAM in total.
> >
> > Might be worth adding zswap using zstd or lz4 to your config (uses more
> CPU
> > for less IO)
> > https://www.kernel.org/doc/html/latest/vm/zswap.html
>
> Zswap will help optimise the swapping of cold pages out of RAM into the
> compressed zswap cache and eventually push these out to the disk.  This
> won't
> help with the problem of not having enough RAM to start with for compiling
> packages with large resource requirements, like e.g. Chromium.
>

Yep, but the system is already at its full RAM, so we're in
workaround/tactical solution territory. Any system that needs 24gig swap to
support 8gig ram is going to really suck.

>
> With monster packages where more RAM is needed even for a single
> compilation
> job, after all cold pages have been swapped out, hot pages will start
> being
> swapped out/in.  I think at this point the same I/O race condition will
> ensue
> as if no zswap were available, plus a compress/decompress CPU load.  I
> guess
> the point of starting to thrash the on-disk swap trying to free RAM may
> start
> sooner, since RAM which would otherwise be available for the single
> prioritised compilation job is now being used by zswap.  So, there would
> be a
> sweet spot in using zswap to improve I/O performance, but it could end up
> becoming a disbenefit on compilation of RAM hungry packages.
>
> Please correct my reasoning above if I have misunderstood how zswap works.
>

What you've said sounds reasonable to me.

Reply via email to