[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dubgo2s3xafoitc2olyjqmkmroiowxbpbswefhdioaeupxoqs2@z3s4uuvojvyu>
Date: Tue, 11 Mar 2025 13:58:24 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Qun-Wei Lin <qun-wei.lin@...iatek.com>
Cc: Nhat Pham <nphamcs@...il.com>, Barry Song <21cnbao@...il.com>,
Jens Axboe <axboe@...nel.dk>, Minchan Kim <minchan@...nel.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>, Vishal Verma <vishal.l.verma@...el.com>,
Dan Williams <dan.j.williams@...el.com>, Dave Jiang <dave.jiang@...el.com>,
Ira Weiny <ira.weiny@...el.com>, Andrew Morton <akpm@...ux-foundation.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, Chris Li <chrisl@...nel.org>,
Ryan Roberts <ryan.roberts@....com>, "Huang, Ying" <ying.huang@...el.com>,
Kairui Song <kasong@...cent.com>, Dan Schatzberg <schatzberg.dan@...il.com>,
Al Viro <viro@...iv.linux.org.uk>, linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
nvdimm@...ts.linux.dev, linux-mm@...ck.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, Casper Li <casper.li@...iatek.com>,
Chinwen Chang <chinwen.chang@...iatek.com>, Andrew Yang <andrew.yang@...iatek.com>,
James Hsu <james.hsu@...iatek.com>
Subject: Re: [PATCH 0/2] Improve Zram by separating compression context from
kswapd
On (25/03/08 18:41), Barry Song wrote:
> On Sat, Mar 8, 2025 at 12:03 PM Nhat Pham <nphamcs@...il.com> wrote:
> >
> > On Fri, Mar 7, 2025 at 4:02 AM Qun-Wei Lin <qun-wei.lin@...iatek.com> wrote:
> > >
> > > This patch series introduces a new mechanism called kcompressd to
> > > improve the efficiency of memory reclaiming in the operating system. The
> > > main goal is to separate the tasks of page scanning and page compression
> > > into distinct processes or threads, thereby reducing the load on the
> > > kswapd thread and enhancing overall system performance under high memory
> > > pressure conditions.
> >
> > Please excuse my ignorance, but from your cover letter I still don't
> > quite get what is the problem here? And how would decouple compression
> > and scanning help?
>
> My understanding is as follows:
>
> When kswapd attempts to reclaim M anonymous folios and N file folios,
> the process involves the following steps:
>
> * t1: Time to scan and unmap anonymous folios
> * t2: Time to compress anonymous folios
> * t3: Time to reclaim file folios
>
> Currently, these steps are executed sequentially, meaning the total time
> required to reclaim M + N folios is t1 + t2 + t3.
>
> However, Qun-Wei's patch enables t1 + t3 and t2 to run in parallel,
> reducing the total time to max(t1 + t3, t2). This likely improves the
> reclamation speed, potentially reducing allocation stalls.
If compression kthread-s can run (have CPUs to be scheduled on).
This looks a bit like a bottleneck. Is there anything that
guarantees forward progress? Also, if compression kthreads
constantly preempt kswapd, then it might not be worth it to
have compression kthreads, I assume?
If we have a pagefault and need to map a page that is still in
the compression queue (not compressed and stored in zram yet, e.g.
dut to scheduling latency + slow compression algorithm) then what
happens?
Powered by blists - more mailing lists