linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: rmoser <mlmoser@comcast.net>
To: =?UNKNOWN?Q?J=F6rn?= Engel <joern@wohnheim.fh-wedel.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Re:  Swap Compression
Date: Sat, 26 Apr 2003 22:24:04 -0400	[thread overview]
Message-ID: <200304262224040410.031419FD@smtp.comcast.net> (raw)
In-Reply-To: <20030426160920.GC21015@wohnheim.fh-wedel.de>

So what's the best way to do this?  I was originally thinking like this:

Grab some swap data
Stuff it into fcomp_push()
When you have 100k of data, seal it up
Write that 100k block

But does swap compress in 64k blocks?  80x86 has 64k segments.
The calculation for compression performance loss, 256/size_of_input,
gives a loss of 0.003906 (0.3906%) for a dataset 65536 bytes long.
So would it be better to just compress segments, whatever size they
may be, and index those?  This would, of course, be much more efficient
in terms of finding the data to uncompress.  (And system dependant)

The algo is flexible; it doesn't care about the size of the input.  If you
pass full segments at once, you could gain a little more speed.  Best
part, if you rewrite my decompression code to do the forward calculations
for straight data copy (I'll likely do this before the night is up myself),
you will evade a lot of realloc()'s in the data copy between pointers.  This
could also optimize out the decriments of the distance-to-next-pointer
counter, and total this all together gives a lot of speed increase over my
original code.  Since this is a logic change, the compiler can't do this
optimization for you.

Another thing, I did state the additional overhead (which now is going to be
64K + code + 256 byte analysis section + 64k uncompressed data)
before, but you can pull in less than the full block, decompress it, put it
where it goes, and pull in more.  So on REALLY small systems, you
can still do pagefile buffering and not blow out RAM with the extra 128k
you may need.  (heck, all the work could be done in one 64k segment if
you're that determined.  Then you could compress the swap on little 6 MB
boxen).

--Bluefox Icy


  parent reply	other threads:[~2003-04-27  2:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-25 22:48 Re: Swap Compression rmoser
2003-04-26  9:17 ` Jörn Engel
     [not found]   ` <200304261148590300.00CE9372@smtp.comcast.net>
     [not found]     ` <20030426160920.GC21015@wohnheim.fh-wedel.de>
2003-04-26 23:41       ` Some code for " rmoser
2003-04-27  2:24       ` rmoser [this message]
2003-04-27  9:04         ` Jörn Engel
2003-04-27 17:24           ` rmoser
2003-04-27 17:51             ` Jörn Engel
2003-04-27 18:22               ` William Lee Irwin III
2003-04-27 18:31               ` rmoser
2003-04-27 19:04                 ` Jörn Engel
2003-04-27 19:57                   ` Livio Baldini Soares
2003-04-27 20:24                     ` rmoser
     [not found]                   ` <200304271609460030.01FC8C2B@smtp.comcast.net>
2003-04-27 20:10                     ` rmoser
2003-04-27 21:52                   ` rmoser
2003-04-27 21:55                     ` Re: Swap Compression -- Try 2 rmoser
2003-04-28  8:52                   ` Swap Compression Eric W. Biederman
2003-04-28 10:26                     ` Jörn Engel
     [not found]                 ` <3EAE8899.2010208@techsource.com>
     [not found]                   ` <200304291521120230.0462A551@smtp.comcast.net>
2003-04-29 19:21                     ` rmoser
     [not found]         ` <3EADAA5D.1090408@techsource.com>
     [not found]           ` <200304282258310030.00DED562@smtp.comcast.net>
2003-04-29  2:58             ` rmoser
  -- strict thread matches above, loose matches on Subject: below --
2003-04-25 22:32 rmoser

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=200304262224040410.031419FD@smtp.comcast.net \
    --to=mlmoser@comcast.net \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.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).