public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Page compression in lieu of swap?
@ 2003-04-12 22:35 Timothy Miller
  2003-04-12 22:50 ` Barry K. Nathan
  2003-04-13  0:06 ` Jan Knutar
  0 siblings, 2 replies; 7+ messages in thread
From: Timothy Miller @ 2003-04-12 22:35 UTC (permalink / raw)
  To: linux-kernel

I did some searching of the kernel archives and the only things related to
the forthcoming idea had to do with compressing pages when writing to swap
and doing compressed disks.  Here's a different idea...

Inspired by my recent experiments in compressing kernel messages, I started
to wonder what else might benefit from compression, and the following idea
occurred to me:

Given the hideous amount of time required to access a disk, especially when
something else wants to access it, could there be a benefit to "swapping"
pages by compressing them to somewhere else in memory?  If we could achieve,
even say, 30% compression on pages, on average, then we could free up RAM
without having to do any I/O.  This would be the first line of defense
against a low-memory situation, finally resorting to actual disk access when
that becomes unworkable or for pages which can't be compressed enough for it
to help (which has a penalty worse than just writing to disk).  And
furthermore, if we were to swap first memory containing compressed pages, we
can reduce the total amount of I/O for swapping.

This would, of course, suck a lot of CPU, and in the case of a server
running many services where the CPU usage is pegged even when there's a lot
of swapping, it would be better to just swap as normal.  But in any case
where swapping is causing an increase in idle time, I would expect a
considerable benefit from being able to free up pages by making LRU pages
simply take up less space in RAM when they're not being used.

Comments?




^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: Page compression in lieu of swap?
@ 2003-04-13  3:36 Perez-Gonzalez, Inaky
  0 siblings, 0 replies; 7+ messages in thread
From: Perez-Gonzalez, Inaky @ 2003-04-13  3:36 UTC (permalink / raw)
  To: 'Timothy Miller', 'linux-kernel@vger.kernel.org'


> -----Original Message-----
> From: Timothy Miller [mailto:tmiller10@cfl.rr.com]
> 
> 
> Given the hideous amount of time required to access a disk, especially
when
> something else wants to access it, could there be a benefit to "swapping"
> pages by compressing them to somewhere else in memory?  If we could
achieve,
> even say, 30% compression on pages, on average, then we could free up RAM

I tried this sometime ago (2.2.x timeframe) for canning mozilla into an
small amount of memory and it was kind of doable - not too complicated,
in fact - the only thing is it would reduce the machine to a crawl some
times (I guess I did not know how to throttle the swap) - I even got it
working with bzip2 -9 [this was a pure exercise].

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-04-13  3:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-12 22:35 Page compression in lieu of swap? Timothy Miller
2003-04-12 22:50 ` Barry K. Nathan
2003-04-13  0:06 ` Jan Knutar
2003-04-13  1:09   ` Con Kolivas
2003-04-13  1:59   ` Timothy Miller
2003-04-13  3:12     ` Jan Knutar
  -- strict thread matches above, loose matches on Subject: below --
2003-04-13  3:36 Perez-Gonzalez, Inaky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox