Linux Device Driver - Interview Questions
LDD - Memory Management
Linux Memory Management Interview Questions
- When is that we we want to use "user virtual address" instead of "kernel virtual address"?
- List some situations when we cannot go with kernel virtual address.?
- How mb differ from wmb in Linux? Is mb equal to wmb & rmb ?
- how to manage memory in linux kernel?
- what is bus error? common causes of bus errors?
- what is memory leak ?
- Write code for page fault handler in Linux
- What is cache ? How it is used and mapped the physical address cache and virtual address cache ?
- DMA controller.
- Write a pseudo code for page fault handler.
- What is virtual memory ? What is the pre-requisite in hardware for supporting virtual memory ?
- What are the differences between vmalloc and kmalloc? Which is preferred to use in device drivers?
- What are the differences between slab allocator and slub allocator?
- What is boot memory allocator?
- How do you reserve block of memory?
- What is virtual memory and what are the advanatages of using virtual memory?
- What's paging and swapping?
- Is it better to enable swapping in embedded systems? and why?
- What is the page size in Linux kernel in case of 32-bit ARM architecture?
- What is page frame?
- What are the different memory zones and why does different zones exist?
- What is high memory and when is it needed?
- Why is high memory zone not needed in case of 64-bit machine?
- How to allocate a page frame from high memory?
- In ARM, an abort exception if generated, if the page table doesn't contain a virtual
to physical map for a particular page. How exactly does the MMU know that a virtual to
physical map is present in the pagetable or not?
- What's a segementation fault and what are the scenarios in which
segmentation fault is triggered?
- If the scenarios which triggers the segmentation fault has occurred, how
the kernel identifies it and what
- are the actions that the kernel takes?
- memory leak deduction and various ways of handling
- How to write own malloc call
- About memory mapped files
- what is cache coherence?
- what is protection mechanism?
- what is DMA?
- what is a page fault?
- What is page write back?
- why not directly the physical address?
- What is MMU?
- Memory map of RAM
- When cahche is enabled in a operating system ,DMA is enabled,how does DMA access the cache?
- Explane MM - Segmentation, paging, swapping
- Paging vs swapping
- Different segments in a program
- Does linux use segmentation
- Memory alloc in linux - kmalloc vs vmalloc
- Physical Virtual and logical addresses
- Thrashing
- What is DMA. Modes - cycle stealing/burst (blk transfer)/transparent
- Cache coherency during dma. Which component handles it
- Explain MMU in Linux
- What is concept of virtual address or physical address?
- what is the entry points in kernel?
- how to create a major number dynamically?
- Diff of Kmalloc and Vmalloc
- How Memory Management works in KERNEL?(In total about Kernel Memory management)
- What are the possible ways that memory leaks can happen in a program ?(Apart from allocation and not freeing )
- How a memory leak can happen in a linked list?
- What is the difference between kmalloc and vmalloc?
- how to get physically contiguousness memory allocation if kmalloc is giving logical contiguousness allocations?
- How do a driver get registered to kernel?
- What is page fault? How page fault exception raises?
- Tell about the Memory Layout of a Process in Linux .
- How will you trace the system calls made into the kernel of lInux ?
- What is mmap ? MMAP & malloc ? MMAP & brk ? MMAP adv & dis-adv.
- Tell the relation between Malloc and MMAP
- Advantages of MMAP over Read ?
- Tell the role of brk() in malloc / Tell the relation between heap and brk?
- Example of using MMAP and MUNMAP in C ?
- Tell about the method/steps in Linux Kernel Compilation.
- What is Kmalloc and how does it differ from normal malloc ? or Why can't we use malloc in kernel code ?