函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory_hotplug.c Create Date:2022-07-27 17:31:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:NOTE: The caller must call lock_device_hotplug() to serialize hotplug* and online/offline operations (triggered e.g. by sysfs).* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG

函数原型:int __ref add_memory_resource(int nid, struct resource *res)

返回类型:int

参数:

类型参数名称
intnid
struct resource *res
1036  struct mhp_restrictions restrictions = {}
1038  bool new_node = false
1041  start等于start
1042  size等于resource_size(res)
1044  ret等于check_hotplug_memory_range(start, size)
1045  如果ret则返回:ret
1048  mem_hotplug_begin()
1056  memblock_add_node(start, size, nid)
1058  ret等于ry_online_node - online a node if offlined*@nid: the node ID*@start: start addr of the node*@set_node_online: Whether we want to online the node* called by cpu_up() to online a node without onlined memory
1059  如果ret小于0则转到:error
1061  new_node等于ret
1064  ret等于arch_add_memory(nid, start, size, & restrictions)
1065  如果ret小于0则转到:error
1069  ret等于create_memory_block_devices(start, size)
1070  如果ret
1071  arch_remove_memory(nid, start, size, NULL)
1072  转到:error
1075  如果new_node
1081  node_set_online(nid)
1082  ret等于Core of the node registration - only memory hotplug should use this
1083  BUG_ON(ret)
1087  ret等于link_mem_sections(nid, PFN_DOWN(start), PFN_UP(start + size - 1))
1088  BUG_ON(ret)
1091  firmware_map_add_hotplug(start, start + size, "System RAM")
1094  mem_hotplug_done()
1097  如果memhp_auto_onlinewalk_memory_blocks(start, size, NULL, online_memory_block)
1100  返回:ret
1101  error :
1103  如果new_noderollback_node_hotadd(nid)
1105  memblock_remove(start, size)
1106  mem_hotplug_done()
1107  返回:ret
调用者
名称描述
__add_memoryquires device_hotplug_lock, see add_memory_resource()