You are not logged in.

#1 2011-12-19 17:07:02

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 380
Website

ineffisient swap in the Linux kernel 3.1 comparing to 3.0

Did somebody noticed how the Linux kernel 3.1 ineffectively uses swap? Using the kernel 3.0, performance was acceptable until 0.6*M of the swap were used. Using the kernel 3.1, performance is acceptable until 0.3*M of the swap are used. (M is a size of the physical RAM, here M=1 GB.) I even downgraded to the kernel 3.0, but this is inconvenient because I should downgrade "nvidia", "xorg-server" and so on down the chain. I have no proper measurements, I only judge by an approximate latency of desktop applications (Mozilla Firefox, Mozilla Thunderbird, Mplayer, Liferea, Amule, Libre Office, Abiword).

Last edited by beroal (2011-12-20 14:33:03)


we are not condemned to write ugly code

Offline

#2 2011-12-19 19:14:05

paziul
Member
From: N.C.
Registered: 2011-11-23
Posts: 27

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

so you have 1GB RAM? and it is using let say 300-600MB of swap running the apps you mentioned?

as root:

# echo 20 > /proc/sys/vm/swappiness

and see if you have any performance improvement

EDIT: to get proper measurements and point to the kernel's "inefficient swapping", you will need to downgrade >>JUST<< the kernel...
doing pacman -Syu along with the kernel other apps are being updated which can cause a higher memory usage
you can also prevent the kernel from being updated in pacman.conf ( if you want to stick to the kernel you like the most )
Szczaslýwa

Last edited by paziul (2011-12-19 19:36:21)


"...and it probably never will support anything other than AT-harddisks..."

Offline

#3 2011-12-20 14:21:34

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 380
Website

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

paziul wrote:

# echo 20 > /proc/sys/vm/swappiness

$ cat /proc/sys/vm/swappiness
20

I already had it. Do I need to tune it?


we are not condemned to write ugly code

Offline

#4 2011-12-20 14:27:28

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 380
Website

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

paziul wrote:

to get proper measurements and point to the kernel's "inefficient swapping", you will need to downgrade >>JUST<< the kernel...

I'd like to. But:

warning: downgrading package linux (3.1.5-1 => 3.0.7-1)
warning: downgrading package linux-headers (3.1.5-1 => 3.0.7-1)
warning: downgrading package linux-api-headers (3.1.4-1 => 3.0.1-1)
resolving dependencies...
looking for inter-conflicts...
error: failed to prepare transaction (could not satisfy dependencies)
:: glibc: requires linux-api-headers>=3.1
:: nvidia: requires linux>=3.1

If I downgrade "nvidia", there is a API mismatch with "xorg-server", so I also should downgrade "xorg-server", and so on.

Last edited by beroal (2011-12-20 14:29:44)


we are not condemned to write ugly code

Offline

#5 2011-12-20 14:29:04

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 380
Website

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

paziul wrote:

so you have 1GB RAM? and it is using let say 300-600MB of swap running the apps you mentioned?

Yes.


we are not condemned to write ugly code

Offline

#6 2011-12-20 18:27:40

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

If you are swaping things that are needed somewhat often then you need more ram, unless you are using an ssd hd I'm surprised you found it bearable to be swapping around 600MB.

That said, the swap handling behavior may have changed or it might be a bug either in the kernel or something else that got upgraded at the same time.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#7 2011-12-21 06:59:26

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 380
Website

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

R00KIE wrote:

I'm surprised you found it bearable to be swapping around 600MB.

It was real. smile I have a recent HDD, though not SSD.

R00KIE wrote:

That said, the swap handling behavior may have changed or it might be a bug either in the kernel or something else that got upgraded at the same time.

I'd like to know exactly what have happened in the kernel. sad


we are not condemned to write ugly code

Offline

#8 2011-12-21 17:14:03

paziul
Member
From: N.C.
Registered: 2011-11-23
Posts: 27

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

beroal - the truth is, as ROOKIE said, running that many apps at the same time requires more RAM to prevent the system from abusing the swap area.
but if you REALLY want to have a 3.0.7 kernel running on your system ( without overwriting, downgrading etc the current kernel and the headers ) the suggestion I have is to get the 3.0.7 sources from kernel.org & recompile: ( this also might help you a bit about tweaking your own kernel... )

cd /usr/src 
wget ftp://ftp.kernel.org/pub/linux/kernel/v3.0/linux-3.0.7.tar.xz
xz -dc linux-3.0.7.tar.xz | tar xvf -
cd linux-3.0.7
zcat /proc/config.gz > .config  # create .config from your current running kernel - or use one you prefer
make menuconfig    # here you ESC & save  - or make changes to the kernel configuration ( if you know what you're doing )
make && make modules_install    # take a nap
cp arch/x86_64/boot/bzImage /boot/kernel-3.0.7-ARCH    # move the newly built kernel to /boot  ( this is the 64bit kernel image path - remove _64 for 32 bit )
mkinitcpio -k 3.0.7-ARCH -g /boot/initrd-3.0.7-ARCH.img      # create your new initrd

edit /boot/grub/menu.lst and ADD the new entry at the END of menu.lst - this is my example:

title 3.0.7-ARCH (vanilla)
root (hd0,0)
kernel /boot/kernel-3.0.7-ARCH root=/dev/sda1 ro
initrd /boot/initrd-3.0.7-ARCH.img

reboot the box and choodr your new kernel....

you will need to think how to recompile the nvidia.ko module  - see it you can do it using pacman - otherwise ( I got my ass kicked from suggesting this before ) try the original nvidia release installer ( this is for debugging / testing purpose so make sure you have a backup of your system - it's always good to have a backup :] )
no other X stuff needs to be "downgraded" or changed, just the nvidia driver(s) need to be recompiled for your kernel....

do all that asroot of course ... good luck!


"...and it probably never will support anything other than AT-harddisks..."

Offline

#9 2011-12-21 18:12:51

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

paziul wrote:
cd /usr/src 
wget ftp://ftp.kernel.org/pub/linux/kernel/v3.0/linux-3.0.7.tar.xz
xz -dc linux-3.0.7.tar.xz | tar xvf -
cd linux-3.0.7
zcat /proc/config.gz > .config  # create .config from your current running kernel - or use one you prefer
make menuconfig    # here you ESC & save  - or make changes to the kernel configuration ( if you know what you're doing )
make && make modules_install    # take a nap
cp arch/x86_64/boot/bzImage /boot/kernel-3.0.7-ARCH    # move the newly built kernel to /boot  ( this is the 64bit kernel image path - remove _64 for 32 bit )
mkinitcpio -k 3.0.7-ARCH -g /boot/initrd-3.0.7-ARCH.img      # create your new initrd

edit /boot/grub/menu.lst and ADD the new entry at the END of menu.lst - this is my example:

title 3.0.7-ARCH (vanilla)
root (hd0,0)
kernel /boot/kernel-3.0.7-ARCH root=/dev/sda1 ro
initrd /boot/initrd-3.0.7-ARCH.img

reboot the box and choodr your new kernel....

you will need to think how to recompile the nvidia.ko module  - see it you can do it using pacman - otherwise ( I got my ass kicked from suggesting this before ) try the original nvidia release installer ( this is for debugging / testing purpose so make sure you have a backup of your system - it's always good to have a backup :] )
no other X stuff needs to be "downgraded" or changed, just the nvidia driver(s) need to be recompiled for your kernel....

do all that asroot of course ... good luck!

And you'll get your ass kicked again for suggesting the install of a custom built kernel without having pacman track all the files like you just did, always use a PKGBUILD to make a package and use the package to install things into the system.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#10 2011-12-21 18:33:52

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 380
Website

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

Thank you, paziul, but I do not need you advice because I have the kernel 3.0 in "/var/cache/pacman/pkg".


we are not condemned to write ugly code

Offline

#11 2011-12-21 19:12:16

paziul
Member
From: N.C.
Registered: 2011-11-23
Posts: 27

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

autch


"...and it probably never will support anything other than AT-harddisks..."

Offline

#12 2011-12-21 19:14:32

paziul
Member
From: N.C.
Registered: 2011-11-23
Posts: 27

Re: ineffisient swap in the Linux kernel 3.1 comparing to 3.0

beroal, after going to 3.0 did you notice the swap performing better?


"...and it probably never will support anything other than AT-harddisks..."

Offline

Board footer

Powered by FluxBB