FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 01-22-2012, 08:58 AM
Boris shtrasman
 
Default How to avoid hangups when I use zram ?

Hi ,

I took zram for a try on a 1gb laptop running kde 4.7 (debian sid), I
used a clean debian kernel.

The problem is sometimes my systems is hanged up for a while (15 mins
nothing except magic sysrq works). this happens with FF and gimp
(memory issues). so I actually get worse useability then without it.

any ideas how to avoid the hangups ?

zram init script :
#!/bin/bash
### BEGIN INIT INFO
# Provides: zram
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Increased Performance In Linux With zRam (Virtual
Swap Compressed in RAM)
# Description: Adapted from systemd scripts at
https://github.com/mystilleef/FedoraZram
### END INIT INFO

start() {
# get the number of CPUs
num_cpus=$(grep -c processor /proc/cpuinfo)
# if something goes wrong, assume we have 1
[ "$num_cpus" != 0 ] || num_cpus=1

# set decremented number of CPUs
decr_num_cpus=$((num_cpus - 1))

# get the amount of memory in the machine
mem_total_kb=$(grep MemTotal /proc/meminfo | grep -E
--only-matching '[[:digit:]]+')
mem_total=$((mem_total_kb * 1024))

# load dependency modules
modprobe zram num_devices=$num_cpus

# initialize the devices
for i in $(seq 0 $decr_num_cpus); do
echo $((mem_total / num_cpus)) > /sys/block/zram$i/disksize
done

# Creating swap filesystems
for i in $(seq 0 $decr_num_cpus); do
mkswap /dev/zram$i
done

# Switch the swaps on
for i in $(seq 0 $decr_num_cpus); do
swapon -p 100 /dev/zram$i
done
}

stop() {
# get the number of CPUs
num_cpus=$(grep -c processor /proc/cpuinfo)

# set decremented number of CPUs
decr_num_cpus=$((num_cpus - 1))

# Switching off swap
for i in $(seq 0 $decr_num_cpus); do
if [ "$(grep /dev/zram$i /proc/swaps)" != "" ]; then
swapoff /dev/zram$i
sleep 1
fi
done

sleep 1
rmmod zram
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 3
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL

zram.conf ( I have two cores):
options zram num_devices=2

hardware :
two cores (AMD64 Turion 64x2).
1Gb of ram.

3.1.0-1-amd64


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAPM6V6PA79CfpO2NUCQ=FRzN_6L69PLdaGnXCjHOmDDZ3bV_= Q@mail.gmail.com">http://lists.debian.org/CAPM6V6PA79CfpO2NUCQ=FRzN_6L69PLdaGnXCjHOmDDZ3bV_= Q@mail.gmail.com
 
Old 01-22-2012, 10:41 AM
Dean Evans
 
Default How to avoid hangups when I use zram ?

On Sun, 22 Jan 2012 11:58:49 +0200
Boris shtrasman <borissh1983@gmail.com> wrote:

> Hi ,
>
> I took zram for a try on a 1gb laptop running kde 4.7 (debian sid), I
> used a clean debian kernel.
>

Hi,

The debian-devel list is for discussion of developing Debian.

For help with your question please send it to the debian-user
list.

Thanks,
Dean


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120123004113.50dac807@sidspace">http://lists.debian.org/20120123004113.50dac807@sidspace
 

Thread Tools




All times are GMT. The time now is 04:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org