[Question] Question on blk_freeze_queue()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have some questions on blk_freeze_queue() and related functions. I
would appreciate if someone could help me.

There's only blk_mq_unfreeze_queue(), without blk_XXX version (e.g.,
blk_unfreeze_queue()).

As the comment (introduced by commit
3ef28e83ab15799742e55fd13243a5f678b04242 ("block: generic request_queue
reference counting")) of blk_freeze_queue says:

```
void blk_freeze_queue(struct request_queue *q)
{
	/*
	 * In the !blk_mq case we are only calling this to kill the
	 * q_usage_counter, otherwise this increases the freeze depth
	 * and waits for it to return to zero.  For this reason there is
	 * no blk_unfreeze_queue(), and blk_freeze_queue() is not
	 * exported to drivers as the only user for unfreeze is blk_mq.
	 */
	blk_freeze_queue_start(q);
	blk_mq_freeze_queue_wait(q);
}
```

I can't understand why blk_unfreeze_queue() is unnecessary for bio-based
devices, in other words, why q->mq_freeze_depth won't be greater than 1
in blk_freeze_queue_start() for !blk_mq cases. Is that because in
!blk_mq cases (bio-based devices, e.g., dm), blk_freeze_queue() won't be
called in a nested way?

If that's the case, then I can see
blk_mq_freeze_queue()/blk_mq_unfreeze_queue() are used in pair in
blk-iolatency.c:iolatency_set_limit() and
blk-sysfs.c:queue_wb_lat_store(), for example. Though I'm not familiar
with iolatency or wbt, an intuition shows that they shall also apply to
bio-based devices (e.g., dm). Please let me know if I'm wrong.


-- 
Thanks,
Jeffle



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux