Blog

Scheduling in Linux Kernel

linux
linux, kernel, scheduler

There are two ways that you can set priorities in scheduling. sched_setscheduler sched_getscheduler You can do man sched_setscheduler to know more. sched_setscheduler sets scheduling policy and parameters. The other option is to use setpriority- This sets the nice value. A brief guide to priority and nice value In Linux system priorities are 0 to 139 in which 0 to 99 for real-time and 100 to 139 for users. Nice value — Nice values are user-space values that we can use to control the priority of a process. ...

Synchronization in Linux Kernel

linux
linux, kernel, synchronization

Introduction # This is my understanding of Synchronization concepts in the Linux Kernel. The need for synchronization? # Imagine that there are multiple threads that are trying to write to a global/shared data at a given point in time. Which thread is going to update the data first? What happens to shared data in case of a race condition? So how do we guarantee that in the case of concurrent execution the writable shared data is accessed by only one thread? ...

Writing a KVM client

linux
linux, kernel, kvm

Major steps required in the workflow # Open /dev/kvm Obtain KVM API version Check extension if Needed Create a virtual machines Allocate memory for the virtual machines Create virtual CPUs Initialize registers Run guest code The documentation for KVM API is available at Link. The KVM provides an API via a special node /device/kvm. We use this node and ioctl interface to communicate and setup the VM. The ioctl’s can be differentiated into KVM System API, Virtual machine API, vCPU API and device API The /dev/kvm node is used to control the KVM system and to create new VM’s. ...

Atomicity and Atomic Instructions in Linux

linux
linux, kernel, synchronization

Introduction # This is my understanding of Synchronization concepts in the Linux Kernel. The need for synchronization? # Imagine that there are multiple threads that are trying to write to a global/shared data at a given point in time. Which thread is going to update the data first? What happens to shared data in case of a race condition? So how do we guarantee that in the case of concurrent execution the writable shared data is accessed by only one thread? ...

Pointer alignment to memory

programming
c-programming, pointer alignment

Pointer alignment to memory # Why do you need to alignment at all? # In terms of memory accesses, there are two types of CPUs - ones that support unaligned memory access and others which don’t. On most architectures, memory accesses(load/store instructions) support different byte sizes 1 byte, 2 byte, 4 byte, 8 byte, 16 byte etc. Unaligned memory access is a load/store that is trying to access an address location which is not aligned to the access size. ...

Rahu Kala Calculation

hora
rahu, kala, calculation

Calculation of Rahu Kala # To calculate Rahu Kala, Gulika Kala and Yama Ghanta Kala we first consider the sunrise and the sunset time. We divide the time between sunrise and sunset into 8 equal parts. Considering the 7 planets (excluding Chaya Grahas - Rahu and Ketu), each planet is assigned to a slot and the remaining slot(8th Slot) is assigned to Rahu and this slot comes to be known as Rahu Kala. ...

Interviews and Appraisals

tech

Triumph your Appraisals # Advance prep # Frist you need to determine what is the actual industry standard for your experience and position. Now there are avenues like glass door through which we can determine this. Once this is know we can set ourselfs a target of what we want to achieve. This also helps you to determine what is the increment that you can expect. Understanding the Appraisal Cycle For example say that the appraisal cycle of company XYZ starts from Jan and ends in Dec. ...