"KVM is disabled by BIOS" messages are seen in logs even-though processor support Virtualization

“KVM is disabled by BIOS” message appears in logs .. Once I noticed, I am not able to use virtualization in my test system . I know my test system support Full virtualization , still no luck.. If you came across something like this , you have to isolate the possibilites one by one . …

Read more

device mapper multipath

Device mapper multipath . Guys, it is true from my heart that understanding a multipath solution ( especially device-mapper-multipath) is a simple process. I am more familiar with the multipath solution “device-mapper-multipath” which shipped with the #1 enterprise release RHEL ( Red Hat Enterprise Linux ) . The mulitpath solution is achieved with the kernel …

Read more

Xen and Kvm

Hey Guys , Thought of sharing some bits on most popular open source virtualization technologies .. Yeah .. it is “Xen” and “Kvm“. Mainly I am focusing more on the hypervisor loading process and features. Xen Xen originated as a research project at the University of Cambridge, led by Ian Pratt, senior lecturer at Cambridge …

Read more

What is virtualization ? and different types of virtualization

What is virtualization? In philosophy virtual means, “something that is not real”. In computer science virtual means, “a hardware environment that is not real”. Here we duplicate the functions of physical hardware and present it to an operating system (OS). The technology that is used to achieve  this environment can be called as Virtualization technology, …

Read more

Kernel module to print process pid, stack..etc information..

When browsing through my filesystem,  I saw a kernel module which I wrote a way back to print information about the current process and its stack, pid..etc.. Also, this module prints all the processes running in the system. So I loaded that into my running system and it was obedient 🙂

I had called him ‘process_informer.ko’..

[root@humbles-lap hello]# make
make -C /lib/modules/2.6.30.10-105.2.23.fc11.x86_64/build M=/misc/my_kernel_modules/hello modules
make[1]: Entering directory `/usr/src/kernels/2.6.30.10-105.2.23.fc11.x86_64′
CC [M]  /misc/my_kernel_modules/hello/process_informer.o
Building modules, stage 2.
MODPOST 1 modules
CC      /misc/my_kernel_modules/hello/process_informer.mod.o
LD [M]  /misc/my_kernel_modules/hello/process_informer.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.30.10-105.2.23.fc11.x86_64′
[root@humbles-lap hello]#

[root@humbles-lap hello]# lsmod |grep process
[root@humbles-lap hello]# insmod process_informer.ko
[root@humbles-lap hello]# lsmod |grep process
process_informer       12427  0
[root@humbles-lap hello]#

[root@humbles-lap hello]# modinfo process_informer.ko
filename:       process_informer.ko
license:        GPL
description:    Module, for fun
version:        1.0.0
author:         Humble Chirammal
srcversion:     C62BE5C41BEC6E733271884
depends:        
vermagic:       2.6.30.10-105.2.23.fc11.x86_64 SMP mod_unload
[root@humbles-lap hello]#

[root@humbles-lap hello]# rmmod process_informer.ko
[root@humbles-lap hello]# lsmod |grep process

Jun  1 00:01:17 humbles-lap kernel: [ 6225.683529]  Hi World, somebody loaded me  ==> __init()
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683533]
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683534]  I am informed to track current process
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683538]
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683539]       Current process is : ‘insmod’
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683540]        pid : ‘8875’
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683541]       Kernel release : ‘2.6.30.10-105.2.23.fc11.x86_64’
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683544]      ‘RUNNABLE’ OR ‘UNRUNNABLE’
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683547]       PRIO : 120  STATE: 0
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683550]
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683551]       My thread_info located at : ffff88009d0dc000
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683552]
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683555]      Process 0 is  : swapper/0     pid :: 0
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683558]      Process 1 is  : systemd     pid :: 1
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683561]      Process 2 is  : kthreadd     pid :: 2
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683565]      Process 3 is  : ksoftirqd/0     pid :: 3
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683568]      Process 4 is  : migration/0     pid :: 6
Jun  1 00:01:17 humbles-lap kernel: [ 6225.683571]      Process 5 is  : watchdog/0     pid :: 7

************Truncated..

Jun  1 00:01:17 humbles-lap kernel: [ 6225.684065]      Process 157 is  : su     pid :: 7296
Jun  1 00:01:17 humbles-lap kernel: [ 6225.684068]      Process 158 is  : bash     pid :: 7306
Jun  1 00:01:17 humbles-lap kernel: [ 6225.684071]      Process 159 is  : bash     pid :: 7398
Jun  1 00:01:17 humbles-lap kernel: [ 6225.684074]      Process 160 is  : su     pid :: 7419

Jun  1 00:02:08 humbles-lap kernel: [ 6225.684117]      Process 174 is  : sleep     pid :: 8856

Jun  1 00:02:08 humbles-lap kernel: [ 6276.449168]   Bye Guys, he is kind enough to unload me      ==> __exit()

Hmmmm.. there are ‘174’ processes in my system …

How can I get a process usage using glibc ( getrusage() ) functions ?

It is always possible to fetch different information about a process from “/proc/” filesystem. I can point some important files from “/proc” filesystem to get statistics about a process. /proc/pid/stat /proc/pid/statm /proc/pid/status You can substitute the “pid” of the process in above and get the status of a process. I can see some of the …

Read more