執行人: williamlin0518
專題解說影片
改進 kHTTPd 的並行處理能力,予以量化並有效管理連線。
著重 concurrency, workqueue, CMWQ
充分予以量化分析
a synchronization mechanism handle read-mostly situations
Reading without Locks
Grace Period
Deferred Updates
Make improve on original wq both concurrency and resource usage
Trace the steps from a connection is initiated to when it is processed:
kecho_init_module
is called. Sets up the listening socket and starts the echo server daemon thread.echo_server_daemon
function runs in a loop, handling the server logic. It uses kernel_accept
to accept incoming connections on the listening socket.create_work
, a struct kecho
instance is initialized and a work structure (struct work_struct
) is prepared. This is enqueued into kecho_wq
.echo_server_worker
is the function assigned to this work structure. When the workqueue decides to execute this task, echo_server_worker
processes the data from the connected socketdaemon
全域變數,用來存放目前服務是否已停止和 worker 的 linked list