From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: Re: [RFC][PATCH 0/2] zram: decouple comp stream and comp buffer
Date: Wed, 7 Feb 2024 18:08:59 +0900 [thread overview]
Message-ID: <20240207090859.GE489524@google.com> (raw)
In-Reply-To: <20240207084720.GD489524@google.com>
On (24/02/07 17:47), Sergey Senozhatsky wrote:
> On (24/02/07 15:57), Sergey Senozhatsky wrote:
> > RFC
> >
> > We keep compression work memory buffer per-comp stream (which
> > is per-CPU), but we don't need that many buffers, because on each
> > CPU only one compression backend can access work memory at any given
> > time. Hence the patch series moves compression work memory to a
> > dedicated per-CPU area, reducing the amount of memory we allocate
> > for those buffers.
> >
> > For instance, assume a 12 CPUs system, 2 compression streams
> > per-CPU (a default and one for deferred recompression). Before
> > we'd allocate 12 * 2 * 2 pages, after we'll allocate 12 * 2 pages.
> >
> > NOTE:
> > The series stops short of moving comp buffers to a global per-CPU
> > area, which all zram devices can share. Compression backends use
> > CPUs exclusively (disable migration and CPU hotplug), so in theory
> > comp work memory can be in global per-CPU data. This can reduce
> > memory usage on systems that init numerous zram devices.
> > E.g. instead of num-zram-devices * num-cpus buffers we'll allocate
> > only num-cpus buffers.
>
> And this is the patch that moves comp buffers to global per-CPU
> area, so that *all* zram devices and *all* comp backends share
> them. It also moves local_lock (which disables migration/preemption
> and CPU-hotplug once taken) to global comp mem per-CPU buffer.
That's a squashed patch. I also have an incremental one, atop of 0002
in the series. So first move comp buffers to device per-CPU, then to
global per-CPU.
prev parent reply other threads:[~2024-02-07 9:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-07 6:57 [RFC][PATCH 0/2] zram: decouple comp stream and comp buffer Sergey Senozhatsky
2024-02-07 6:57 ` [RFC][PATCH 1/2] zram: do not allocate buffer if crypto comp allocation failed Sergey Senozhatsky
2024-02-07 6:57 ` [RFC][PATCH 2/2] zram: move comp buffer to a dedicate per-CPU area Sergey Senozhatsky
2024-02-07 8:47 ` [RFC][PATCH 0/2] zram: decouple comp stream and comp buffer Sergey Senozhatsky
2024-02-07 9:08 ` Sergey Senozhatsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240207090859.GE489524@google.com \
--to=senozhatsky@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).