Giter VIP home page Giter VIP logo

book_linuxkernel_blockdrv's Introduction

First, thank you for taking the time to read my book! I want to point out that English is not my first language and you're welcome to give me any feedback for my poor English.

Multi-queue block device in Linux kernel v4.4

Several years ago, a new concept was merged into the block layer of Linux kernel. Before that every single block device has one queue for IO handling. Every processes inserted an IO request into the queue and block device driver extract a request from the queue. Yes, one queue was shared for many processes and for many processors.

When we used HDD mainly, a single queue did not matter. But these days SSD is so popular that a single queue design has been bottle-neck of performance. Therefore kernel developers implemented the multi-queue design.

That is not just an adding more queues. The architecture of block layer must've re-designed. You can get the theoritical background from this paper:

Bjørling, Matias, et al. "Linux block IO: Introducing multi-queue SSD access on multi-core systems." Proceedings of the 6th International Systems and Storage Conference. ACM, 2013. - http://kernel.dk/systor13-final18.pdf

This document shows the step-by-step process of making mybrd driver that is mimic of brd and null_blk drivers in Linux v4.4. We begin with dummy skeleton driver. And we will make a single queue and see how it works. And also we will see how kernel pass the IO request to driver via the single queue. Finally we will change mybrd driver to have multi-queue and see how it works between kernel block layer and driver.

The final source code is already implemented at https://github.com/gurugio/mybrd/blob/master/mybrd.c. So you can see what this document aim to do now. I'll also describe a few more features of kernel because they are necessary to understand and implement the block device driver.

I hope this document can guide you to the deep inside of Linux kernel.

PS.

This document is not for very beginner of Linux kernel. A small document cannot describe details beginner should know to start Linux kernel. If you already started Linux kernel and read one or two books, but did not know what to do next, this document can be good for you.

PS.

If you are interested in memory management, you'd better start reading Mel Gorman's book.

https://www.kernel.org/doc/gorman/pdf/understand.pdf

INDEX

references

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.