inflearn logo

Structure and Principles of the Linux Kernel: Workqueues [Author's Lecture Part 1-7]

The author of "Learning the Structure and Principles of the Linux Kernel Through Debugging" provides a proper explanation of the core concepts of 'Workqueues' in the latest Linux kernel (v6.1), which is most widely used in system software.

(5.0) 2 reviews

79 learners

Level Beginner

Course period Unlimited

Linux
Linux
Operating System
Operating System
ARM Architecture
ARM Architecture
linux-kernel
linux-kernel
armv8
armv8
Linux
Linux
Operating System
Operating System
ARM Architecture
ARM Architecture
linux-kernel
linux-kernel
armv8
armv8

What you will gain after the course

  • Basic concepts and operating principles of a work queue

  • Workqueue processing from a device driver perspective

  • Key concepts of Delay Work

  • Debugging workqueues with TRACE32 memory dumps

<Notice>

1. Issuing a 40% discount coupon to celebrate reaching 500 students🙏

To celebrate surpassing 500 students for the Linux Kernel course, we are issuing a 40% discount coupon. Thank you. Limited to the first 100 people.

2. Roadmap Guide 🎯

This lecture, 'Linux kernel for system software developers - basic course', is part of the roadmap <Structure and Principles of the Linux Kernel: Workqueue [Author's Lecture Part 1-7]>.

If you are a system software developer in fields such as system semiconductors or automotive,

Linux Kernel Essentials You Must Know

What is the most widely used operating system across all IT devices? It is the Linux operating system. It is used in smartphones, digital TVs, in-flight entertainment systems, and servers. System semiconductor companies use Linux (Linux device drivers) to control the hardware they design. Furthermore, Linux is extensively utilized in various components of electric vehicles (Automotive), such as infotainment, autonomous driving, and telematics.

The core of the Linux operating system is the Linux kernel. Along with the Armv8-A architecture, the Linux kernel can be seen as the area requiring the most essential foundational knowledge currently in demand within the system software industry.

Junior developers in the Linux system software field, including system semiconductors and electric vehicles (autonomous driving, infotainment)

Job seekers who want to work in Linux system software development fields such as system semiconductors and electric vehicles

Prospective graduate students in the field of Linux system software (memory, file systems, operating systems)

Developers from other fields who want to change their career to the Linux system software field

However, the Linux kernel acts as a massive barrier for beginners in the field of system software. Many beginners have likely experienced giving up multiple times while trying to learn it. As the already difficult Linux kernel versions upgrade, they are evolving to become increasingly complex. Since 2024, Linux kernel versions have been upgrading to v6.6 and above, and the barrier to entry is rising even higher.

Linux system software developers in various fields, including system semiconductors and electric vehicles, know that they need to understand the Linux kernel well to enhance their development capabilities. However, it is difficult to get a sense of how to learn the Linux kernel and, above all, what specific content is essential for practical work.

The core of the core in Linux device driver development: Workqueues

When you start your career as a Linux system software developer, you will mostly develop Linux device drivers. In this process, the feature you must know is the workqueue. To name a few reasons why;

  • Workqueues are used as a bottom-half mechanism for interrupts.

  • Many features of device drivers are implemented using the APIs provided by workqueues.

Additionally, many features that make up the Linux kernel operate using APIs provided by workqueues. Therefore, in Chapter 7 of my book, 'Structure and Principles of the Linux Kernel,' I explain 'workqueues' as follows.

This lecture is structured so that readers can learn about workqueues through various debugging exercises (TRACE32 memory dump analysis, ftrace analysis).

Key Differentiating Points of the Lecture

This course consists of content that has never been covered on YouTube or any other lecture platform before! We will debug data structures related to the Linux kernel's workqueue (system_wq global variables, worker_pool structures, work_struct structures) using Linux kernel memory dumps. Those who take this course can download three memory dumps and practice directly.

1. Providing Linux kernel dumps for workqueue debugging (3 types)

If you take this course, you can download three memory dumps from the 'Inflearn Course Materials' and perform hands-on debugging using the TRACE32 simulator program. Two of the memory dumps were obtained from an Armv8-A based Raspberry Pi, and one was obtained from a RISC-V based VisionFive2. You can learn various operations of the workqueue mechanism (work item queuing, work item execution, worker pools, global workqueues) by debugging them yourself.

*Note: You can download the TRACE32 simulator program from the following existing Linux kernel courses:

  • Structure and Principles of the Linux Kernel: Debugging - Advanced Practice [Author-led Lecture Part 1-3]

  • Structure and Principles of the Linux Kernel: Process [Author's Lecture Part 1-4]

  • Structure and Principles of the Linux Kernel: Interrupts [Author's Lecture Part 1-5]

  • Structure and Principles of the Linux Kernel: Interrupts Part 2 [Author's Lecture Part 1-6]

2. Explaining the basic concepts of workqueues easily and in detail

When learning the Linux kernel, you analyze the kernel source code. However, you encounter many obstacles during this process. It is difficult to determine the flow in which a specific function is called or to verify the actual values within the data structures of the routine you are analyzing. This lecture breaks down all of these obstacles.

We analyze the Linux kernel source code related to workqueues along with TRACE32 call stacks and detailed data structures. You can learn workqueue techniques much more efficiently than studying the Linux kernel on your own. Furthermore, by analyzing ftrace messages extracted from memory dumps, you can gain a multi-dimensional and granular understanding of how workqueues operate.

3. Explaining Workqueues from the Perspectives of Device Drivers and the Linux Kernel

Those who are learning workqueues for the first time often say they are too difficult. This is because most books or blogs explaining workqueues are structured for developers who already have a good understanding of the Linux kernel, rather than for beginners. In this lecture, to help beginners understand workqueues clearly, I will explain them from the following two perspectives:

  • Device driver perspective: Explained based on work items

  • Linux kernel perspective: Explaining the detailed data structures that make up the workqueue

After listening to this lecture, you can immediately start developing device drivers and subsequently learn the in-depth operational mechanisms of workqueue techniques.

4. Introduction to debugging methods used by Linux kernel BSP developers at global system semiconductor companies

The system semiconductor industry has been on the rise lately. How do Linux kernel system developers at global system semiconductor companies debug Linux kernel drivers?

This lecture covers the following topics: We will debug kernel data structures related to processes using the TRACE32 simulator for Linux kernel memory dumps, and analyze key kernel operations by loading memory dumps with the crash-utility.

5. Explaining content not covered in the book

We explain the Workqueue Watchdog (CONFIG_WQ_WATCHDOG), which is widely used in real-world development, along with the following content.

  • How to directly enable the Workqueue Watchdog (CONFIG_WQ_WATCHDOG) on a Raspberry Pi

  • Debugging the operation of the workqueue watchdog with ftrace

I have also included practical and beneficial content in the lecture that can be applied immediately in real-world scenarios.

What you will learn

First, we will explain the core functions and roadmap that make up the workqueue. Following that, we will provide a detailed explanation of how to effectively learn workqueues.

I will explain the data structures that make up the workqueue from a big-picture perspective. I will provide a detailed explanation of the structures of the global workqueue, worker pools, and work items.

It explains how work (work items) are used from a device driver perspective.

I will introduce the data structures related to work and explain in an easy-to-understand manner what values each field stores through hands-on debugging.

Explains the process of work items being queued in detail through kernel code analysis.

Explains in detail the data structure (linked list) when a work item is queued through TRACE32 memory dump debugging.

We introduce the worker threads that execute work items and explain their execution stages. Next, we analyze the kernel source code where worker threads are created and explain the call stack (backtrace) of this process.

It explains in detail the operational mechanism of worker threads during execution through kernel source analysis.

Explains how work items are executed through worker threads using TRACE32 debugging. (3 memory dumps)

Explains ftrace for tracing workqueues in detail and analyzes the relevant kernel source code along with ftrace messages.

Explains delayed workqueues, which are widely used in device drivers, in an easy-to-understand manner.

We will perform a detailed analysis of the delayed work source code and its execution flow.

This explains the workqueue watchdog, which is not covered in the book but is frequently used in real-world projects. It explains how to enable CONFIG_WQ_WATCHDOG and analyzes the relevant kernel source code.

It explains the operation of the workqueue watchdog in detail through ftrace message analysis.


Based on my book writing and lecturing experience,
deeper and more detailed than anyone else!


Global Author & Linux System Software Developer (Arm, RISC-V Architecture)

An unprecedented author in the domestic system software field who has written books on 'Arm Architecture (Armv8-A, Armv7-A)' and the 'Linux Kernel' (both books were selected as Excellent Academic Books by the National Academy of Sciences, Republic of Korea), and a global author who wrote the book "Reverse Engineering Armv8-A Systems" (in English) through an overseas publisher (Packt) for the first time in Korea. Above all, I am an active developer who is most well-versed in the latest system software trends (Electric Vehicles, System Semiconductors - System Software). I am also an educator who is most actively engaged in knowledge-sharing activities within the system software field.

  • Author of the book (English) 'Reverse Engineering Armv8-A Systems: A practical guide to Kernel, Firmware, and TrustZone analysis', (Packt Publishing)

  • 'Structure and Principles of the Linux Kernel Learned Through Debugging' (2021, National Academy of Sciences Excellent Scholarly Book Award) Author

  • Author of 'Structure and Principles of Arm Architecture for System Software Development' (2024, National Academy of Sciences Outstanding Scholarly Book Award)

  • 'Programmers Dev Course: Linux System and Kernel Expert' Main Instructor (1st~2nd batches)

  • June 2022, Korea Computer Congress (KCC2022) - Tutorial Presentation [Conquering the Linux Kernel Using ftrace]

  • LG Electronics 'Linux Kernel' and 'Armv8 Architecture' In-house Instructor (including domestic and overseas developers) - (2020–2024)


I can confidently say that I am an educator who can explain the core functions of the Linux kernel better than anyone else in the country.

Notes before taking the course

Prerequisites and Important Notes

  • It is helpful to have a general understanding of how Linux operates.

  • It is recommended that you take the 'Structure and Principles of the Linux Kernel: Debugging - Basic [Author's Lecture Part 1-2]' course first if possible.

  • It will be easier to follow the class if you have knowledge of operating systems or computer architecture.

  • In-depth prior knowledge of the Linux kernel is not required.

Recommended for
these people

Who is this course right for?

  • A junior developer who wants to build expertise in the field of system software, including system semiconductors and electric vehicles (autonomous driving, infotainment).

  • A job seeker who wants to develop system software in fields such as system semiconductors and electric vehicles

  • An undergraduate student aiming to pursue graduate studies in the field of system software (memory, file systems, operating systems).

  • A developer from another field seeking to transition their career into system software.

Need to know before starting?

  • C Language

  • Computer Architecture

  • Operating System

Hello
This is austinkim

6,316

Learners

241

Reviews

96

Answers

4.9

Rating

22

Courses

Global Author & Linux System Software Developer (Arm, RISC-V Architecture)

A global author who has written unprecedented books on 'Arm Architecture (Armv8-A, Armv7-A)' and the 'Linux Kernel' in the domestic system software field (both books were selected as Excellent Academic Books by the National Academy of Sciences of the Republic of Korea), and is the first in Korea to author the book (in English) "Reverse Engineering Armv8-A Systems" through an international publisher (Packt). Above all, he is an active developer who is most well-versed in the latest system software trends (electric vehicles, system semiconductors-system software). He is also an educator who is most actively engaged in spreading knowledge within the system software field.

  • Author of the book (English) 'Reverse Engineering Armv8-A Systems: A practical guide to Kernel, Firmware, and TrustZone analysis', (Packt Publishing)

  • Author of 'Structure and Principles of Arm Architecture for System Software Development' (2024 National Academy of Sciences Outstanding Book Award)

  • Author of 'Structure and Principles of the Linux Kernel Learned Through Debugging' (2021, National Academy of Sciences Outstanding Scholarly Book Award)

  • Main Instructor for 'Programmers Dev Course: Linux System and Kernel Expert'

  • June 2022, Korea Computer Congress (KCC2022) - Tutorial Presentation [Conquering the Linux Kernel Using ftrace]

  • LG Electronics 'Linux Kernel' and 'Armv8 Architecture' internal instructor (including domestic and overseas developers) - (2020–Present)

I can confidently say that I am an educator who can explain the Linux kernel and Arm architecture (Armv8-A, Armv7-A) better than anyone else in Korea.

Lecture Inquiries: austindh.kim@gmail.com

Main Roadmap 🎯

'Arm for System Software Developers - basic course'

'Arm for System Software Developers - advanced course'

Linux kernel for system software developers - basic course

More

Curriculum

All

68 lectures ∙ (8hr 2min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

All

2 reviews

5.0

2 reviews

  • dlrbcnvk님의 프로필 이미지
    dlrbcnvk

    Reviews 19

    Average Rating 4.9

    5

    60% enrolled

    • ioniakim2638님의 프로필 이미지
      ioniakim2638

      Reviews 9

      Average Rating 4.9

      5

      100% enrolled

      austinkim's other courses

      Check out other courses by the instructor!

      Similar courses

      Explore other courses in the same field!

      $34.10