Waiting on Congested Queues

Of course, it's no use marking queues as congested and clearing them when the situation improves — the kernel must also be able to wait until a queue is free again. You have already seen that a wait queue is employed for this purpose, so it remains to discuss how processes are added to the wait queue.

The kernel uses the congestion_wait function for this purpose. It adds a process to the congestion_wqh wait queue when congestion occurs. The function requires two parameters — the direction of data flow (read or write operation) and a time out after which the process is always woken, even if the queue is still congested. The time out is used to prevent excessively long periods of inactivity — after all, a queue may be congested for quite some time.

6This again ignores the possibility that the system administrator fiddles with nr_requests of the queue.

Continue reading here: Mmbackingdevc

Was this article helpful?

0 0