Lines Matching full:memory

3  * Memory subsystem support
9 * a SPARSEMEM-memory-model system's physical memory in /sysfs.
19 #include <linux/memory.h>
29 #define MEMORY_CLASS_NAME "memory"
79 * Memory blocks are cached in a local radix tree to avoid
86 * Memory groups, indexed by memory group id (mgid).
119 * Show the first physical section index (number) of this memory block.
191 * they describe (they remain until the memory is unplugged), doing in memory_block_online()
192 * their initialization and accounting at memory onlining/offlining in memory_block_online()
194 * belong to the same zone as the memory they backed. in memory_block_online()
367 * covered by a memory block, allowing for identifying which memory blocks
368 * comprise a storage increment. Since a memory block spans complete
446 * Show the memory block size (shared by all memory blocks).
457 * Memory auto online policy.
526 * Support for offlining pages of memory
572 * A reference for the returned memory block device is acquired.
617 * register_memory - Setup a sysfs device for a memory block
620 int register_memory(struct memory_block *memory) in register_memory() argument
624 memory->dev.bus = &memory_subsys; in register_memory()
625 memory->dev.id = memory->start_section_nr / sections_per_block; in register_memory()
626 memory->dev.release = memory_block_release; in register_memory()
627 memory->dev.groups = memory_memblk_attr_groups; in register_memory()
628 memory->dev.offline = memory->state == MEM_OFFLINE; in register_memory()
630 ret = device_register(&memory->dev); in register_memory()
632 put_device(&memory->dev); in register_memory()
635 ret = xa_err(xa_store(&memory_blocks, memory->dev.id, memory, in register_memory()
638 put_device(&memory->dev); in register_memory()
639 device_unregister(&memory->dev); in register_memory()
692 static void unregister_memory(struct memory_block *memory) in unregister_memory() argument
694 if (WARN_ON_ONCE(memory->dev.bus != &memory_subsys)) in unregister_memory()
697 WARN_ON(xa_erase(&memory_blocks, memory->dev.id) == NULL); in unregister_memory()
699 if (memory->group) { in unregister_memory()
700 list_del(&memory->group_next); in unregister_memory()
701 memory->group = NULL; in unregister_memory()
705 put_device(&memory->dev); in unregister_memory()
706 device_unregister(&memory->dev); in unregister_memory()
710 * Create memory block devices for the given memory area. Start and size
711 * have to be aligned to memory block granularity. Memory block devices
750 * Remove memory block devices for the given memory area. Start and size
751 * have to be aligned to memory block granularity. Memory block devices
776 /* return true if the memory block is offlined, otherwise, return false */
807 * Initialize the sysfs support for memory devices. At the time this function
808 * is called, we cannot have concurrent creation/deletion of memory block
816 /* Validate the configured memory block size */ in memory_dev_init()
819 panic("Memory block size not suitable: 0x%lx\n", block_sz); in memory_dev_init()
827 * Create entries for memory sections that were found in memory_dev_init()
834 panic("%s() failed to add memory block: %d\n", __func__, in memory_dev_init()
840 * walk_memory_blocks - walk through all present memory blocks overlapped
843 * @start: start address of the memory range
844 * @size: size of the memory range
846 * @func: callback for each memory section walked
848 * This function walks through all present memory blocks overlapped by the
849 * range [start, start + size), calling func on each memory block.
895 * for_each_memory_block - walk through all present memory blocks
898 * @func: callback for each memory block walked
900 * This function walks through all present memory blocks, calling func on
901 * each memory block.
919 * memory groups. Note that the passed memory group will be copied to a
920 * dynamically allocated memory group. After this call, the passed
921 * memory group should no longer be used.
950 * memory_group_register_static() - Register a static memory group.
952 * @max_pages: The maximum number of pages we'll have in this static memory
955 * Register a new static memory group and return the memory group id.
956 * All memory in the group belongs to a single unit, such as a DIMM. All
957 * memory belonging to a static memory group is added in one go to be removed
960 * Returns an error if out of memory, if the node id is invalid, if no new
961 * memory groups can be registered, or if max_pages is invalid (0). Otherwise,
962 * returns the new memory group id.
980 * memory_group_register_dynamic() - Register a dynamic memory group.
982 * @unit_pages: Unit in pages in which is memory added/removed in this dynamic
983 * memory group.
985 * Register a new dynamic memory group and return the memory group id.
986 * Memory within a dynamic memory group is added/removed dynamically
989 * Returns an error if out of memory, if the node id is invalid, if no new
990 * memory groups can be registered, or if unit_pages is invalid (0, not a
991 * power of two, smaller than a single memory block). Otherwise, returns the
992 * new memory group id.
1012 * memory_group_unregister() - Unregister a memory group.
1013 * @mgid: the memory group id
1015 * Unregister a memory group. If any memory block still belongs to this
1016 * memory group, unregistering will fail.
1018 * Returns -EINVAL if the memory group id is invalid, returns -EBUSY if some
1019 * memory blocks still belong to this memory group and returns 0 if
1041 * This is an internal helper only to be used in core memory hotplug code to
1042 * lookup a memory group. We don't care about locking, as we don't expect a
1043 * memory group to get unregistered while adding memory to it -- because
1044 * the group and the memory is managed by the same driver.
1052 * This is an internal helper only to be used in core memory hotplug code to
1053 * walk all dynamic memory groups excluding a given memory group, either