linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Question] Question on blk_freeze_queue()
@ 2021-02-23  7:12 JeffleXu
  0 siblings, 0 replies; only message in thread
From: JeffleXu @ 2021-02-23  7:12 UTC (permalink / raw)
  To: linux-block, dan.j.williams

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-23  7:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23  7:12 [Question] Question on blk_freeze_queue() JeffleXu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).