lkml.org 
[lkml]   [2022]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1] zram: add size class equals check into recompression
On (22/10/24 13:59), Andrew Morton wrote:
> > It makes no sense for us to recompress the object if it will
> > be in the same size class. We anyway don't get any memory gain.
> > But, at the same time, we get a CPU time overhead when inserting
> > this object into zspage and decompressing it afterwards.
> >
>
> Dumb question: is it ever possible for compression to result in an
> increase in size?

That's a good question. Re-compressed object can be bigger than the
original compressed one, but this should already be taken care of.
We do
if (comp_len_next >= huge_class_size ||
comp_len_next >= comp_len_prev ||

This checks whether recompressed object is above huge-size watermark and
whether recompressed size is larger than the original size.

\
 
 \ /
  Last update: 2022-10-25 03:41    [W:0.056 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site