alloc_workqueue() + WQ_MEM_RECLAIM

Snippet from my patch:

/drivers/net/ethernet/synopsys/dwc_eth_qos.c

–       lp->txtimeout_handler_wq = create_singlethread_workqueue(DRIVER_NAME);

+       lp->txtimeout_handler_wq = alloc_workqueue(DRIVER_NAME,

+                                                  WQ_MEM_RECLAIM, 0);

  • A dedicated workqueue has been used since the work item viz lp->txtimeout_reinit is involved in packet TX/RX path .

 

  • As a network device can be used during memory reclaim, the workqueue needs forward progress guarantee under memory pressure. WQ_MEM_RECLAIM has been set to ensure this.

 

  • Since there is only a single work item, explicit concurrency limit is unnecessary here.

Tip..

Used when the work items are on a memory reclaim path.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s