Blog

Backtracking problems

DSA
Backtracking

127 Word Ladder # SO you are give 2 words one is the starting point and other is the ending point. Since it’s shortest path, you use BFS. So using BFS we are going to store each string in our sequence & then going to have integer value called changes which will be eventually returned from our function, which will keep track of how many changes do we have in sequence. ...

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. ...

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. ...

On Happiness

life
life

Happiness is letting go of what you assume your life is supposed to be like right now and sincerely appreciating it for everything that it is. So, Relax, you are enough, you have enough, you do enough. Breathe deep… Let go and just life right now in the moment. We think that happiness is some elusive state that can only be made possible when a vast constellation of circumstances comes into alignment. ...

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? ...

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? ...

Memory Management in Linux Kernel

linux
linux, kernel, Memory

Introduction # When we say Memory Management in Linux Kernel, there are two parts to it. You have one set of memory management files inside respective architecture folders (low level mm) and one on the top of linux kernel (high level mm). Then ones inside the arch specific folders are memory initializers, these are processor dependent and mm folder at the root of the kernel is the memory manager which is processor independent. ...

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. ...