– glob->swap_queue = create_singlethread_workqueue(“ttm_swap”);
– queue_work(glob->swap_queue, &glob->work);
+ schedule_work(glob->swap_queue, &glob->work);
- swap_queue was created to handle shrinking in low memory situations.
- Earlier, a separate workqueue was used in order to avoid other workqueue tasks from being blocked since work items on swap_queue spend a lot of time waiting for the GPU.
- Since these long-running work items aren’t involved in memory reclaim in any way, system_long_wq has been used.
- Work item has been flushed in ttm_mem_global_release() to ensure that nothing is pending when the driver is disconnected.
Used when the queued work items are long running and don’t require any special flags.