:: Re: [DNG] use zram for /tmp - how?
Pàgina inicial
Delete this message
Reply to this message
Autor: Didier Kryn
Data:  
A: dng
Assumpte: Re: [DNG] use zram for /tmp - how?
Le 05/06/2016 17:24, emninger@??? a écrit :
> Am Sun, 05 Jun 2016 12:00:01 +0000
> schrieb Didier Kryn <kryn@???>:
>
>>       I have a laptop with 16GB of ram. I configured it like this with
>> the primary goal of not using swap at all. And my /tmp is a tmpfs
>> with a 4G limit. This allows me to use an SSD as hard disk drive. I
>> didn't want to swap to an SSD.

>>
>>       I have never been short of ram in 3 years. I have compiled
>> kernels, GCC, and many other things on this laptop, runing make with
>> multiple threads; I sometimes got stuck by lack of cpu, never by lack
>> of ram.

>>
>>       I understand that you want to go further and increase the size
>> of your /tmp by compressing it. It seems pretty complicated and
>> probably not worth the burden.
> Thank you Didier! Would you mind to put your exact configuration here?

------------- Begin of configuration ------------
     HP EliteBook
     4 cores Intel(R) Core(TM) i7-3687U CPU @ 2.10GHz
     16GB RAM
     SSD disk 256GB
      fstab:
# <file system>                       <mount point> <type>    <options> 
<dump><pass>
# / was on /dev/sda5 during installation
UUID=d91acaa3-5fdc-49e9-9f2b-ba7f3efb33f9   / btrfs     noatime         
0     1
# /home was on /dev/sda10 during installation
UUID=4709a8c2-825d-43fc-83bb-3b7404feb4aa   /home btrfs     
noatime         0     2
# /usr was on /dev/sda6 during installation
UUID=05f9f811-b8b1-445f-ac8c-9537a202a9f9   /usr btrfs     
noatime         0     2
# /var was on /dev/sda7 during installation
UUID=905a0998-c7fc-4544-a73e-44d8d803602c   /var reiserfs  
notail,noatime,nosuid  0  2
tmp                                         /tmp tmpfs     
size=4G         0     0


     My fstab is a mess. I used several partitions not mentionned above 
as chroots. I know it's an error to dispatch the OS into several 
partitions when using btrfs; won't do it next time.
--------------- End of configuration ------------

> Anyway, i went a bit further and around the compressed ram theme.
> Given, that i probably will keep the harddrive swap partition
> (as i said: for hibernation/s2disk) would it be more useful to use
> zswap instead (zswap needs a physical swap device)? And to set the
> percentage of ram given to zswap pretty high? (Activate zswap would be
> some lines in the bootloader).

      I haven't any partition formatted as swap, and, nevertheless, 
hibernation works. I realize this just when writing this email and I now 
wonder where the hell the kernel saves the system image!

>
> So, using tmpfs as parazyd pointed out, would go to be swapped early
> into the compressed swap in ram, when there is no more uncompressed ram
> available. Or is it ingenuous thinking?
>
> If i understand correctly, zswap will, when it really comes to the
> limits swap out the oldest swap pages to the "pysical" swap device,
> zram would kill them (?).

     I guess you can swap to both zram and disk. swapon allows you to 
give priorities, meaning swap could go to disk only when zram is full.


     I would first try to estimate the real need for swap. The common 
practice, for years, was to use a swap partition twice the size of the 
RAM. Since today a typical RAM is around 4GB, this puts a limit of 12GB 
total. But you've got 16! Without swap, you have more than a typical 
laptop with swap.


     Didier