Computers/Xen

Xen 스케줄러 변경하기 - how to change Xen scheduler on Xen command line

emzei 2015. 1. 18. 23:12


Xen documentation 에는 xen 스케줄러 바꾸는 방법이 이렇게 나와있음.

 SCHEDULER SUBCOMMANDS

     Xen ships with a number of domain schedulers, which can be set at boot

     time with the sched= parameter on the Xen command line. By default           

     credit is used for scheduling.




/boot/grub/grub.cfg에서 sched=credit, sched=credit2, sched=sedf 등을 넣으라는 건데...

멍2 말로만 나와있어서 혼자 많이 해멨음.


Menu entry 중에 xen 으로 부팅 하는 엔트리부분에서 수정해주면 됩니다.


Xen의 Command line 부분이  (빨간 줄-Red line)로 표시해놓은 부분입니다. 저 부분에 추가로 설정해주면 됩니다.

menuentry 'Debian GNU/Linux, with Xen 4.5-unstable and Linux 3.2.0-4-amd64' --class debian --class gnu-linux --class gnu --class os --class xen {

    insmod part_msdos

insmod ext2

set root='(hd1,msdos1)'

search --no-floppy --fs-uuid --set=root 3926927c-5821-403b-a7bf-e8acf96d7cd8

echo 'Loading Xen 4.5-unstable ...'

multiboot /boot/xen-4.5-unstable.gz placeholder <--- Xen command line

echo 'Loading Linux 3.2.0-4-amd64 ...'

module /boot/vmlinuz-3.2.0-4-amd64 placeholder root=UUID=3926927c-5821-403b-a7bf-e8acf96d7cd8 ro initrd=/install/gtk/initrd.gz quiet

echo 'Loading initial ramdisk ...'

module /boot/initrd.img-3.2.0-4-amd64

}



설정한 예시

menuentry 'Debian GNU/Linux, with Xen 4.5-unstable and Linux 3.2.0-4-amd64' --class debian --class gnu-linux --class gnu --class os --class xen {

    insmod part_msdos

insmod ext2

set root='(hd1,msdos1)'

search --no-floppy --fs-uuid --set=root 3926927c-5821-403b-a7bf-e8acf96d7cd8

echo 'Loading Xen 4.5-unstable ...'

multiboot /boot/xen-4.5-unstable.gz placeholder sched=credit2

echo 'Loading Linux 3.2.0-4-amd64 ...'

module /boot/vmlinuz-3.2.0-4-amd64 placeholder root=UUID=3926927c-5821-403b-a7bf-e8acf96d7cd8 ro initrd=/install/gtk/initrd.gz quiet

echo 'Loading initial ramdisk ...'

module /boot/initrd.img-3.2.0-4-amd64

}


placeholder 뒤에 parameter를 설정해주면 됩니다 :)



(+) xen의 command line 부분 찾은 방법... info에 command line 요소가 있었음... (몰랐음 ㅠㅠ)

(+) 변경된 스케줄러 확인가능!

root@debian:~# xl info

host                   : debian

release                : 3.2.0-4-amd64

version                : #1 SMP Debian 3.2.57-3

machine                : x86_64

nr_cpus                : 8

max_cpu_id             : 7

nr_nodes               : 1

cores_per_socket       : 4

threads_per_core       : 2

cpu_mhz                : 3392

hw_caps                : bfebfbff:28100800:00000000:00003f00:17bae3ff:00000000:00000001:00000000

virt_caps              : hvm

total_memory           : 8075

free_memory            : 1242

sharing_freed_memory   : 0

sharing_used_memory    : 0

outstanding_claims     : 0

free_cpus              : 0

xen_major              : 4

xen_minor              : 5

xen_extra              : -unstable

xen_version            : 4.5-unstable

xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 

xen_scheduler          : credit2

xen_pagesize           : 4096

platform_params        : virt_start=0xffff800000000000

xen_changeset          : 

xen_commandline        : placeholder sched=credit2

cc_compiler            : gcc (Debian 4.7.2-5) 4.7.2

cc_compile_by          : root

cc_compile_domain      : 

cc_compile_date        : Sat Jan 17 02:17:02 KST 2015

xend_config_format     : 4