The WB_WORKFN function of workqueue mechanism analysis

Source: Internet
Author: User

The above article says: The most important thing in Process_one_work is worker->current_func (work);

This is specific to a very specific task, because I want to study the file system, so it is natural to the specific task:

void Wb_workfn (struct work_struct *work)

First, the work variable is just a booster, where is the real master?

struct Bdi_writeback *WB = container_of (to_delayed_work (work),

struct Bdi_writeback, Dwok);

According to Bdi_writeback, we can find this series of dirty Inode, and then write back the data inside [finally take a breath, because we finally have access to some of the file system-related concepts.]

[There is also a point that is particularly enlightening, saying that a work_poll can correspond to multiple kworker, thinking that if there is a lot of dirty pages in the file system, there will be a lot of work, so that different work may be performed by multiple different threads in the pool]

We're more familiar with the code behind it.

The WB_WORKFN function of workqueue mechanism analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.