Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-mq.c Create Date:2022-07-28 17:11:35
Last Modify:2020-03-17 23:18:05 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:blk_mq_realloc_hw_ctxs

Proto:static void blk_mq_realloc_hw_ctxs(struct blk_mq_tag_set *set, struct request_queue *q)

Type:void

Parameter:

TypeParameterName
struct blk_mq_tag_set *set
struct request_queue *q
2751  hctxs = hw dispatch queues
2753  If nr_hw_queues < nr_hw_queues Then
2756  new_hctxs = kcalloc_node(nr_hw_queues, size of new_hctxs , GFP_KERNEL, numa_node)
2759  If Not new_hctxs Then Return
2761  If hctxs Then memcpy(new_hctxs, hctxs, nr_hw_queues * size of hctxs )
2764  hw dispatch queues = new_hctxs
2765  nr_hw_queues = nr_hw_queues
2766  kfree(hctxs)
2767  hctxs = new_hctxs
2771  mutex_lock( & sysfs_lock)
2772  When i < nr_hw_queues cycle
2776  node = CPU -> queue mappings
2782  If hctxs[i] && @numa_node: NUMA node the storage adapter has been connected to. == node Then Continue
2785  hctx = blk_mq_alloc_and_init_hctx(set, q, i, node)
2786  If hctx Then
2787  If hctxs[i] Then blk_mq_exit_hctx(q, set, hctxs[i], i)
2789  hctxs[i] = hctx
2790  Else
2791  If hctxs[i] Then pr_warn("Allocate new hctx on node %d fails,
2795  Else Break
2803  If i != nr_hw_queues Then
2804  j = nr_hw_queues
2805  end = i
2806  Else
2807  j = i
2808  end = nr_hw_queues
2809  nr_hw_queues = nr_hw_queues
2812  When j < end cycle
2813  hctx = hctxs[j]
2815  If hctx Then
2818  blk_mq_exit_hctx(q, set, hctx, j)
2819  hctxs[j] = NULL
2822  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
Caller
NameDescribe
blk_mq_init_allocated_queue
__blk_mq_update_nr_hw_queues