abount paging and swapping

(or Pagefiles vs. Swap / Swapfiles)

Swapfiles

Source: lkml.iu.edu/hypermail/linux/kernel/9907.2/0462.html

Linux will swap existing pages to disk on a per process basis. In principle, a process might allocate 1 Gb of buffer, but always be using the same one physical page.

Source: stackoverflow.com

The advantage of this is that it is relatively simple to grasp and memory for a program is always allocated contiguously, the downside is that performance on a machine can become absolutely abysmal when the system ends up in a state where things are constantly swapping. The algorithm also involves the repeated swapping in and out of data that will not be used in the foreseeable future.

(…)

With swapping, parts of memory which are not in use are written to disk; this enables one to run several programs whose total memory consumption is greater than the amount of physical memory. When a program makes a request for a part of memory that was written to the disk, that part has to be loaded into memory. To make room for it, another part has to be written to the disk (effectively the two parts swap places – hence the name). This “extension” of physical memory is generally known as “virtual memory”.

(…)

Modern systems use both paging and swapping, and pages are what is being swapped in and out of memory.

Pagefiles

Source: techarp.com

In contrast, paging files function by moving “pages” of a program from system memory into the paging file. These pages are 4KB in size. The entire program does not get swapped wholesale into the paging file.

While swapping occurs when there is heavy demand on the system memory, paging can occur preemptively. This means that the operating system can page out parts of a program when it is minimized or left idle for some time.

Swapfiles were used in old iterations of Microsoft Windows, prior to Windows 95. From Windows 95 onwards, all Windows versions use only paging files.

Source: helpdeskgeek.com

Windows 8 supports both paging and swapping. Paging will hold items that haven’t been accessed in a long time whereas swapping holds items that were recently taken out of memory. The items in pagingfile may not be accessed again for a long time whereas the items in swapfile might be accessed much sooner.

Conclusion

  1. “swapping” means put a whole program / process to swapspace on disk, while during “paging” only pages of memory are put onto disk (page = 4kb)
  2. because of its granularity, paging is often more efficient than swapping out the whoule process
  3. both mechanism can lead to performance degradation because content must be read out of multiple time slower disk storage instead of memory
  4. Windows 8 has both, pagefile and swapfile; the c:\swapfile.sys is used for the apps only

Fedora Notebook Installation Notes

I just wanted to have a look on another Linux distribution, so I decided to change from Mint to Fedora. This were my Installation Notes for Tools I installed on my Notebook, and what I needed to do to install them.

I found some useful tips on the following Website:
http://http://www.fedorafaq.org

System Settings

x Tell Fedora to forward root Emails to me:
– create a file /root/.forward
– content: “name@domain.com” <- my emailaddress here

x Configure Desktop to show Icons:
– start “dconf-editor”
– activate show-desktop-icons in org->gnome->desktop-background

x Install basic Tools:
– patch
– wget

x Configure Swappiness
  Swappiness defines how fast Linux swap’s out Programs to swapfile.
  – nano /etc/sysctl.conf
  – add a new line with “vm.swappiness=10” (default=80)

Get CIFS Shares automatically mounted on Boot

x Edit /etc/fstab and add a line for each share:
//ip.addr/share  /mnt/share  cifs  username=user,password=pw,uid=1000,gid=1000,_netdev  0 0

x Create a startup skript
– nano /etc/init.d/after.local
– enter this skript:
#! /bin/sh
mount -a
– chmod a+x /etc/init.d/after.local

This is a list of my tools, and how to install them correctly

x Various Software
– yum erase evolution
– yum install thunderbird

x Adobe Flash Installation
– Download RPM File from Adobe Website
– yum install adobe-release-x86_64-1.0.-1.noarch.rpm
– yum install flash-plugin

x Adobe Reader Installation
  – Download “bin” File from Adobe Website (getReader)
  – mark “*.bin” File as executable
  – start bin File using su / sudo

x Remote Desktop Software
– yum install remmina
– yum install remmina-plugins-rdp

x VMware Player
– Download Player from Website
– Set “VMware-Player-4.0.3-703057.x86_64.bundle” as executable
– sudo VMware-Player-4.0.3-703057.x86_64.bundle
– sudo yum install kernel-headers kernel-devel gcc
– unpack patch vmware802fixlinux320.tar.gz to /tmp
– sudo ./patch-modules_3.2.0.sh
– vmplayer (erster Start)

Futher Information for Player 4.0.3 on Kernel 3.3:
http://ask.fedoraproject.org/question/1613/vmware-player-403-on-kernel-334

x Gimp and Nikon NEF Plugin
– yum install gimp
– yum install ufraw-gimp

x VLC Player
RPMFusion must be installed to get vlc player, actual link and version is on the RPMFusion Website
– rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
– yum install vlc
– yum install mozilla-vlc (optional)
  To remove the existing totem Media Player:
  – remove totem*

x Dropbox
– a Dropbox package is available in many distributions, but Dropbox itself recommends to download the installer from the Webpage directly.


Tools to try:
– nmon (disk activity)

change Linux Mint window placement

When running an application without maximized window, Linux Mint always puts a new opened window it in the left-top corner of the desktop. This and other behaviors can be changed as follow:

Install the CompizConfig Settings Manager (ccsm):

sudo apt-get install compizconfig-settings-manager

  • Start the Config manager by pressing ALT+F2, then enter “ccsm
  • Go To “windows management” in the left pane
  • Click on “place windows”
  • change the placement method from “smart” to “centered”

done!

Create Icons on your Linux Desktop

On Windows, you can right click on your Desktop to select New->Shortcut. On Linux, it isn’t as easy like this.

To be faster, I recommend to open a shell without root privileges. As an example, we’re goint to create a Desktop File that opens a Remote Desktop Session to “server2” using the “rdesktop” executable. To do so, we create a file, set it as executable and open it in gedit with the following commands:

  • cd /home/username/Desktop
  • touch server2.desktop
  • chmod +x server2.desktop

A new Windows appears, where we now can insert the following text template:

—insert-from-here—
[Desktop Entry]
Type=Application
Version=1.0
Icon=/home/username/Icons/rdp.ico
TryExec=rdesktop
Terminal=false
StartupNotify=false
NoDisplay=true
Name=server2 (RDP)
Exec=rdesktop -g 1280×900 servername
Comment=Start Remote Desktop Session
—stop-insert—

Save the file and check out the new Icon on your Desktop. The Icon file defined in Line 4 can be created by searching for any Icon on Google Images and covert it using the following online Tool:

http://converticon.com/

Icon created !

Useful Linux Commands and Tools (Ubuntu)

These are just some notes on commands and hints I’ve found using Google during my Linux installation and daily tasks. Some of them are related to my Linux Mint Distribution, but should also work on others.

Helpful Commands

aptitude resp. apt-get
To search for a software bundle:
$> apt-cache search
To install a software bundle from the search above:
$> apt-get install

Install downloaded .deb or .pkg files

$> sudo dpkg -i software.deb
$> sudo aptitude install software.deb
$> sudo rpm -i software.rpm

Drivers
A lot of drivers are only available as i386 (32-bit) Installation Packages. If you have luck, the Vendors  made a Linux driver for their Device, but normally this is not the case. If you find one, the next problem could be that it is a 32-bit driver, that can only be used on 32-bit systems (I wasn’t able to install a 32-bit one on my 64-bit system).

Tools

Disktrim A Disk Trimming Program
http://disktrim.sourceforge.net/  

Good Settings

/etc/fstab file
-> add the “discard” option to a filesystem to enable SSD Trim function
-> use “sudo blkid” to get a filesystem’s UUID
Information to fstab:  https://help.ubuntu.com/community/Fstab
Information to SSD’s: http://www.howtogeek.com/(…)

VMware Workstation with Linux Mint Kernel 3.0.0

Since Christmas 2011 I’m trining to work on Linux Mint at home. It was clear that it isn’t possible living without any Windows Operation system installed, so I’ve decided to use Windows 7 in a virtual Machine. In VMware Workstation there’s a very useful feature called “Unity”, that makes all Windows Applications seamless available in the host operation system. That’s what I need to have the best feeling in the daily business.

After installing VMware Workstation, the first start already stopped with a error message, that I had to search in /tmp/vmware-root/setup-xxxx.log. At the end of the Logfile was a message like “Failed to compile module vmmon!”.

Google told me this is a known error under different Kernel Versions. In my case, I’m using this version:

# uname -a
Linux laptop7 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

In VMware’s communities was a post explaining how to Patch my problem:
http://communities.vmware.com/thread/326180

Here’s how to in quick steps:

After this steps, the VMware modules can be compiled into the Kernel using the following command or by starting VMware Workstation again.

  • vmware-modconfig –console –install-all