Inflearn brand logo image
Inflearn brand logo image
Inflearn brand logo image
NEW
Hardware

/

Embedded IoT

Linux Kernel Structure and Principles: Work Queue [Author's Direct Lecture Part 1-7]

The author of "Learning Linux Kernel Structure and Principles through Debugging" properly explains the core concepts of 'workqueue' in the latest Linux kernel (v6.1), which is most widely used in system software.

32 learners are taking this course

  • austinkim
Linux
Operating System
ARM Architecture
linux-kernel
armv8

What you will learn!

  • Basic Concepts and Operating Principles of Work Queues

  • Device Driver Perspective on Workqueue Processing Methods

  • Key Concepts of Delay Work

  • Debugging Work Queues with TRACE32 Memory Dumps

If you're a system software developer in fields such as system semiconductors and automotive

Essential Linux Kernel Knowledge

What is the most widely used operating system in all IT devices? It's the Linux operating system. It is used in smartphones, digital TVs, aviation entertainment systems, and servers. System semiconductor companies use Linux (Linux device drivers) to control the hardware they design. Additionally, 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 considered the content that requires the most essential foundational knowledge currently needed in the system software industry.

Junior developer in Linux system software fields including system semiconductors and electric vehicle sectors (autonomous driving, infotainment)

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

Those hoping to pursue graduate studies in Linux system software fields (memory, file systems, operating systems)

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

However, the Linux kernel is like a massive barrier for beginners in the field of system software. Beginners have likely experienced giving up on learning the Linux kernel multiple times. That difficult Linux kernel is becoming increasingly complex as it evolves through version upgrades.After 2024, the Linux kernel version will be upgraded to v6.6 or higherHowever, the barriers to entry are becoming higher.

Linux system software developers positioned 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's difficult to get a sense of how to learn the Linux kernel and, more importantly, what content they need to know well in practical work.

The Core of the Core in Linux Device Driver Development: Work Queues

When entering as a Linux system software developer, most people develop Linux device drivers. In this process,Essential features you must know about are work queuesHere are a few reasons:

  • Work queues are used as a bottom-half interrupt handling technique.

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

Additionally, many functions that make up the Linux kernel also 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 to allow readers to learn about workqueues through various debugging practices (TRACE32 memory dump analysis, ftrace analysis).

Differentiation Points of the Course

This lecture consists of content that has never been covered on YouTube or any lecture platform before! We debug data structures related to Linux kernel workqueues (system_wq global variable, worker_pool structure, work_struct structure) through Linux kernel memory dumps. Those taking this lecture can download 3 memory dumps and practice hands-on.

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

If you take this course, you can download 3 memory dumps from 'Inflearn Course Materials' and directly debug them using the TRACE32 simulator program. Two of the memory dumps are from Armv8-A based Raspberry Pi, and one memory dump is from RISC-V based VisionFive2. You can learn various workqueue mechanism operations (work item queuing, work item execution, worker pool, global workqueue) by directly debugging them.

*For reference, the TRACE32 simulator program can be downloaded from the following existing Linux kernel course:

  • Linux Kernel Structure and Principles: Debugging - Advanced Practice [Author's Direct Lecture Part 1-3]

  • Linux Kernel Structure and Principles: Processes [Author's Direct Lecture Part 1-4]

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

  • Linux Kernel Structure and Principles: Interrupt Bottom Half [Author's Direct Lecture Part 1-6]

2. Easy and detailed explanation of the basic concepts of work queues

When learning the Linux kernel, we analyze kernel source code. However, we encounter many obstacles in the process of analyzing kernel source code. It's difficult to confirm what flow a particular function is called in, or what actual values the data structures of the routines being analyzed contain. This lecture dismantles all these obstacles.

Analyze Linux kernel source code related to workqueues along with TRACE32 program's call stack and detailed data structures. You can learn workqueue techniques much more efficiently than studying the Linux kernel on your own. Additionally, by analyzing ftrace messages extracted from memory dumps, you can gain a three-dimensional understanding of workqueue operation principles in detail.

3. Explaining Work Queues from Device Driver and Linux Kernel Perspectives

People who are learning about workqueues for the first time say they are too difficult. This is because most books and blogs that explain workqueues are written for developers who already have a good understanding of the Linux kernel, rather than for beginners. This lecture explains workqueues from the following two perspectives so that beginners can understand workqueues well:

  • Device Driver Perspective: Explanation Based on Work Items

  • Linux Kernel Perspective: Explaining the Detailed Data Structures that Compose Workqueues

After taking this course, you can immediately start developing device drivers and subsequently learn the in-depth operational methods 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 emerging recently. How do Linux kernel system developers at global system semiconductor companies debug Linux kernel drivers?

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

5. Explains content not covered in the book

Explains the workqueue watchdog (CONFIG_WQ_WATCHDOG) that is frequently used in practical development along with the following content.

  • How to enable workqueue watchdog (CONFIG_WQ_WATCHDOG) directly on Raspberry Pi

  • Debugging Workqueue Watchdog Behavior with ftrace

The course includes beneficial content that can be applied directly in real-world situations.

You'll learn this content

We first explain the core features and roadmap that make up the work queue. Then we provide a detailed explanation of how to learn work queues effectively.

This explains the data structures that make up the workqueue from a big picture perspective. It provides detailed explanations of the structure of the global workqueue, worker pool, and work items.

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

This introduces data structures related to work and provides detailed explanations of what values each field stores through debugging practice, making it easy to understand.

This provides a detailed explanation of the work item queuing process through kernel code analysis.

This provides a detailed explanation of the data structure (linked list) when work items are queued using TRACE32 memory dump debugging.

This introduces worker threads that execute work items and explains the execution stages of worker threads. It then analyzes the kernel source code where worker threads are created and also explains the call stack (back trace) of this process.

The operational behavior when worker threads execute is explained in detail through kernel source analysis.

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

This provides a detailed explanation of ftrace for tracing workqueues and analyzes related kernel source code along with ftrace messages. ## ftrace Overview for Workqueue Tracing ftrace is a powerful kernel tracing framework in Linux that allows developers to trace various kernel subsystems, including workqueues. Workqueues are kernel mechanisms for deferring work to be executed later in process context. ## Key ftrace Events for Workqueue Tracing ### 1. workqueue_queue_work This event is triggered when work is queued to a workqueue. **Kernel Source Analysis:** ```c // kernel/workqueue.c static void __queue_work(int cpu, struct workqueue_struct *wq, struct work_struct *work) { struct pool_workqueue *pwq; struct worker_pool *pool; // ... code for selecting appropriate pool ... trace_workqueue_queue_work(req_cpu, pwq, work); // ... actual queuing logic ... } ``` **ftrace Message Example:** ``` kworker/0:1-123 [000] .... 123.456789: workqueue_queue_work: work struct=0xffff888012345678 function=flush_to_ldisc workqueue=

This provides an easy-to-understand explanation of delayed work queues, which are frequently used in device drivers.

We will analyze the source code of delayed work and the execution flow of delayed work in detail.

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

This provides a detailed explanation of the workqueue watchdog's operation through ftrace message analysis.


Based on book writing/teaching experience
Deeper and more detailed than anyone else!


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

In the field of domestic system software, this is an unprecedented! author who wrote books on 'Arm Architecture (Armv8-A, Armv7-A)' and 'Linux Kernel' (both books were selected as excellent books by the Korean Academy), and is a global author who was the first in Korea to write the book "Reverse Engineering Armv8-A Systems" (in English) through an overseas publisher (Packt). Above all, they are a working developer who best understands the latest system software trends (electric vehicles, system semiconductors - system software). They are also an educator who is most actively engaged in knowledge dissemination activities in the system software field.

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

  • 'Learning the Structure and Principles of the Linux Kernel through Debugging' (2021 Korea Academy of Sciences Excellence in Books Award) Author

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

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

  • 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 major functions that make up the Linux kernel better than anyone else in Korea.

Pre-enrollment Reference Information

Prerequisites and Important Notes

  • It would be good if you have a rough understanding of how Linux works.

  • It would be good to listen to the 'Linux Kernel Structure and Principles: Debugging - Basic [Author's Direct Lecture Part 1-2]' lecture first if possible.

  • If you have knowledge of operating systems or computer architecture, you can take the class more comfortably.

  • You don't need deep prerequisite knowledge about the Linux kernel.

Recommended for
these people

Who is this course right for?

  • A junior developer who wants to build capabilities in the system software field, including system semiconductors and electric vehicle sectors (autonomous driving, infotainment)

  • Job seekers who want to develop system software in fields such as system semiconductors and electric vehicles

  • A university student aiming for graduate school admission in the field of systems software (memory, file systems, operating systems)

  • A developer from another field looking to transition their career into the systems software field

Need to know before starting?

  • C language

  • Computer Architecture

  • Operating System

Hello
This is

5,437

Learners

148

Reviews

84

Answers

4.9

Rating

21

Courses

글로벌 저자 & 리눅스 시스템 소프트웨어 개발자 (Arm, RISC-V 아키텍처)

국내 시스템 소프트웨어 분야에서 전무후무한! 'Arm 아키텍처(Armv8-A, Armv7-A)'와 '리눅스 커널' 책을 쓴 저자(2권의 책 모두 대한민국 학술원 우수도서에 선정)이며, 국내 최초로 해외 출판사(Packt)를 통해 "Reverse Engineering Armv8-A Systems" 책(영어)을 집필한 글로벌 저자입니다. 무엇보다 최신 시스템 소프트웨어 트렌드(전기자동차, 시스템 반도체- 시스템 소프트웨어)를 가장 잘 알고 있는 현업 개발자입니다. 또한 시스템 소프트웨어 분야에서 가장 지식 전파 활동을 활발하게 하는 교육자입니다. 

  • 'Reverse Engineering Armv8-A Systems: A practical guide to Kernel, Firmware, and TrustZone analysis' 책(영어) 저자, (Packt 출판사)

  • '시스템 소프트웨어 개발을 위한 Arm 아키텍처의 구조와 원리'(2024년, 대한민국 학술원 우수도서상) 저자

  • '디버깅을 통해 배우는 리눅스 커널의 구조와 원리' (2021년, 대한민국 학술원 우수도서상) 저자

  • '프로그래머스 데브 코스: 리눅스 시스템 및 커널 전문가' 메인 강사

  • 2022년 6월, 한국컴퓨터종합학술대회 (KCC2022) - 튜토리얼 발표 [ftrace를 이용해 리눅스 커널 정복하기]

  • LG전자 '리눅스 커널' 및 'Armv8 아키텍처' 사내 강사(국내 및 해외 개발자 포함) - (2020년~현재)

국내에서 어느 누구보다 리눅스 커널과 Arm 아키텍처(Armv8-A, Armv7-A)를 잘 설명할 수 있는 교육자라고 자신있게 말씀드릴 수 있습니다.

강의문의 : austindh.kim@gmail.com

주요 로드맵 🎯

'시스템 소프트웨어 개발자를 위한 Arm - basic course'

'시스템 소프트웨어 개발자를 위한 Arm - advanced course'

시스템 소프트웨어 개발자를 위한 Linux kernel - basic course

Curriculum

All

68 lectures ∙ (8hr 0min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

Limited time deal ends in 6 days

$656,675.00

29%

$34.10

austinkim's other courses

Check out other courses by the instructor!

Similar courses

Explore other courses in the same field!