struct request_queue {

unsigned long nr_requests; /* Max # of requests */

unsigned int nr_congestion_on; unsigned int nr_congestion_off; unsigned int nr_batching;

The nr_requests element is used to define the number of request structures per queue. Typically, this number is set to blkdev_max_rq, which equates to 128 but can be changed using /sys/block/<device>/queue/nr_requests. A lower bound on the number of requests is given by blkdev_min_rq, which equates to 4.

□ nr_congestion_on denotes the limit value at which a queue is regarded as congested. There must be fewer free request structures than specified by the value for this state to occur.

□ nr_congestion_off (note the ''off'') also specifies a limit value at which a queue is regarded as no longer congested. When there are more free requests than indicated by this number, the kernel regards the queue as free.

The functions queue_congestion_on_threshold and queue_congestion_off_threshold are provided to read the current threshold values. Although the functions are trivial, they must be used instead of reading the values directly. Should the implementation change in future kernel versions, the user will nevertheless be able to enjoy the same interface and will not require modifications.

The congestion thresholds are computed by blk_congestion_threshold:

Continue reading here: Blockllrwblkc

Was this article helpful?

0 0