函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-mq.c Create Date:2022-07-27 18:46:56
Last Modify:2020-03-17 23:18:05 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:blk_mq_realloc_hw_ctxs

函数原型:static void blk_mq_realloc_hw_ctxs(struct blk_mq_tag_set *set, struct request_queue *q)

返回类型:void

参数:

类型参数名称
struct blk_mq_tag_set *set
struct request_queue *q
2751  hctxs等于 hw dispatch queues
2753  如果nr_hw_queues小于nr_hw_queues
2756  new_hctxs等于kcalloc_node(nr_hw_queues, new_hctxs的长度, GFP_KERNEL, numa_node)
2759  如果非new_hctxs则返回
2761  如果hctxsmemcpy(new_hctxs, hctxs, nr_hw_queues * hctxs的长度)
2764  hw dispatch queues 等于new_hctxs
2765  nr_hw_queues等于nr_hw_queues
2766  释放内存
2767  hctxs等于new_hctxs
2771  mutex_lock( & sysfs_lock)
2772 i小于nr_hw_queues循环
2776  node等于CPU -> queue mappings
2782  如果hctxs[i]且@numa_node: NUMA node the storage adapter has been connected to. 恒等于node则继续下一循环
2785  hctx等于blk_mq_alloc_and_init_hctx(set, q, i, node)
2786  如果hctx
2787  如果hctxs[i]则blk_mq_exit_hctx(q, set, hctxs[i], i)
2789  hctxs[i]等于hctx
2790  否则
2791  如果hctxs[i]则打印警告信息("Allocate new hctx on node %d fails,
2795  否则退出
2803  如果i不等于nr_hw_queues
2804  j等于nr_hw_queues
2805  end等于i
2806  否则
2807  j等于i
2808  end等于nr_hw_queues
2809  nr_hw_queues等于nr_hw_queues
2812 j小于end循环
2813  hctx等于hctxs[j]
2815  如果hctx
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.
调用者
名称描述
blk_mq_init_allocated_queue
__blk_mq_update_nr_hw_queues