[haiku-development] Re: R1A4 RC swap issue - ram * 2

  • From: kallisti5 <kallisti5@xxxxxxxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Thu, 30 Aug 2012 11:14:03 -0500

On 2012-08-30 11:02 am, kallisti5 wrote:
On 2012-08-30 10:39 am, kallisti5 wrote:
I installed the R1A4 RC (hrevr1alpha4-44576) on my beefy laptop with
lots of memory this morning and ran across this bug:
https://dev.haiku-os.org/ticket/7742

It sounds like swap is double the ram by default... but on these
8-16GB systems, the swap file grows larger then the available free
space causing issues.

Confirmed...


http://cgit.haiku-os.org/haiku/tree/src/system/kernel/vm/VMAnonymousCache.cpp#n1343

Is there a swap setting?
  Init it.
Does the swap setting not exist?
  size = (off_t)vm_page_num_pages() * B_PAGE_SIZE * 2;

There are several issues with this:
  * The swap space can be very large without taking into account the
filesystem size
  * The automatically chosen size is never written anywhere so the
swap preference panel
    isn't aware of it.

I'm seeing if there is a logical way to fix this without breaking anything :)

I see two solutions here:

  * Is there a swap setting?
    * Use it.
  * Is there no swap setting defined?
    * Don't set use a swap file.

or

  * Is there a swap setting?
    * Use it.
  * Is there no swap setting defined?
    * Do ram * 2.
    * Is ram * 2 over 1GB? only try a 1GB swap file.


I like the first solution better as we won't have to make the memory preflet aware that the kernel is adjusting the swap space without being told to. This does however
change how Haiku functions... thoughts?


 -- Alex

Other related posts: