How to set process with lowest priority?

Posted on

In system, sometimes, we need backstage threads with very very low priority since it cannot preempt any normal process asks for CPU. SCHED_IDLE class satisfies this requirement which has the priority lower than “nice=19” of CFS. Following code does this. 241 void set_idle_priority(void) { 242 struct sched_param param; 243 param.sched_priority = 0; 244 int s
Read more

How to use ioprio_set in linux c

Posted on

Since there is no glibc wrapper for ioprio_set in linux c, we need to call this API with some definition. Using syscall in linux as follows. syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, pid, IOPRIO_PRIO_CLASS(IOPRIO_CLASS_IDLE)); Some other definitions to declare above macros. 69 enum { 70 IOPRIO_CLASS_NONE, 71 IOPRIO_CLASS_RT, 72 IOPRIO_CLASS_BE, 73 IOPRIO_CLASS_IDLE, 74 }; 75 76 enum { 77
Read more

What is the vruntime of one process after it is moved into another run queue in Linux Kernel

Posted on

When we do migration, one process will be migrated from one source CPU’s runqueue to destination CPU’s run queue. What is the virtual run time (if CFS is used) after it is moved into destination CPU’s run queue? When the process is dequeued from source CPU’s run queue, its vruntime will minus the minimum vruntime
Read more

Libvirt crash when upgrade from version 1.2.2 to version 2.5.0

Posted on

If you install libvirt from ubuntu software library like this sudo apt-get install libvirt-bin The default version is 1.2.2 for Ubuntu Trusty. However, after you upgrade it to version 2.5.0 from its source codes (restart the libvirtd service), you will see following error if you want to install vm with virt-install. # ./installkvm1.sh Starting install…
Read more

Cannot start VM with error “no network with matching name ‘default'”

Posted on

I update libvirt version and want to start VM with the new libvirt tools but I failed as follows. > sudo virsh start kvm1 error: Failed to start domain kvm1 error: Network not found: no network with matching name ‘default’ It seems that the default ‘virbr0’ is missing after I update libvirt so I solve
Read more

What’s the difference between memory coherence and consistency?

Posted on

In memory hierarchical, it needs to be coherence and consistency. However, they are different things. What are the differences? Memory coherence: a memory system is coherent if any read of a data item returns the most recently written value of that data item (what values can be returned by a read). Memory consistency: A memory
Read more

Ubuntu’s GUI response is very slow

Posted on

For Dell PowerEdge T630 server, if you install latest Ubuntu desktop version (16.04) or (14.04), you will get a very slow GUI (X-window). $ inxi -G Graphics: Card: Matrox Systems G200eR2 X.org: 1.15.1 driver: vesa tty size: 205×58 Advanced Data: N/A out of X For Ubuntu 14.04.1, this problem can be solved by following steps.
Read more

How to get the IP addresses of VMs in KVM with virsh

Posted on

When we create VMs in KVM, we may don’t know the IP addresses because they are automatically assigned by DHCP. So we want to get them in VMM so that can login by SSH. Do the commands as follows. $ virsh domiflist hvm1 Interface Type Source Model MAC ——————————————————- vnet0 network default virtio 52:54:00:1c:36:cd $
Read more

How to install PARSEC correctly.

Posted on

PARSEC is the most important CPU-bound benchmark for systems. It is huge and hard to install because it needs lots of 3-part libs. PARSEC download link for 3.0 version: http://parsec.cs.princeton.edu/download.htm#parsec I remembered I added the answer yesterday night but I could not see the answer currently. Anyway, let me add the answer again after I
Read more

How to config Git remote server on Bitbucket or Github

Posted on

For your first push with git, you may get following errors when you use github or bitbucket. $ git push No refs in common and none specified; doing nothing. Perhaps you should specify a branch such as ‘master’. fatal: The remote end hung up unexpectedly Everything up-to-date Just run following command to set your remote
Read more

‘dd’ command cannot support calculation for its parameters

Posted on

$ dd if=/dev/zero of=./4Ktest100M bs=4KB count=25000*9 dd: invalid number `25000*9′ I think ‘dd’ should support calculation for its parameters like ‘bs’, ‘count’ and so on. You can get the effect by using some other tools/commands, like dd if=/dev/zero of=./4Ktest100M bs=4KB count=$((25000*9)) or dd if=/dev/zero of=./4Ktest100M bs=4KB count=$(bc <<< 25000*9) I think it makes sense. Thank
Read more

How to keep master thesis safety and availability on Windows

Posted on

When you write your master thesis (in Chinese) on windows, you may have following worries. a, Be afraid your master thesis is lost (or can not be accessed) when hard disk/udisk is broken (or something other viruses). b, Keep master thesis availability (7×24) and safety. c, Do not want anyone else to access it before
Read more

Git push error under CENTOS 6.7

Posted on

$ git add file $ git commit -m “xxxx” $ git push error: The requested URL returned error: 403 Forbidden while accessing https://github.com fatal: HTTP request failed Change your ~/.gitconfig as follows: $ cat ~/.gitconfig [user] name = xxx email = xxx@gmail.com [remote “origin”] fetch = +refs/heads/*:refs/remotes/origin/* url= https://name@github.com/name/xxx.git

Skype crashes because it cannot read data from “C:Documents and SettingsAdministratorLocal SettingsTemp”

Posted on

On my laptop, I install windows xp because it is user-friendly for me. However, Skype cannot be open because “The system is not unavailable”. At last, I find the “Skype” directory under “C:Documents and SettingsAdministratorLocal SettingsTemp” cannot be accessed. “C:Documents and SettingsAdministratorLocal SettingsTemp” is like temporary directory for specific user under Linux OS. Actually, for
Read more