/* Types for control the zone type of onlined and offlined memory */ enum { /* Offline the memory. */
MMOP_OFFLINE = 0, /* Online the memory. Zone depends, see default_zone_for_pfn(). */
MMOP_ONLINE, /* Online the memory to ZONE_NORMAL. */
MMOP_ONLINE_KERNEL, /* Online the memory to ZONE_MOVABLE. */
MMOP_ONLINE_MOVABLE,
};
/* Flags for add_memory() and friends to specify memory hotplug details. */ typedefint __bitwise mhp_t;
/* No special request */ #define MHP_NONE ((__force mhp_t)0) /* * Allow merging of the added System RAM resource with adjacent, * mergeable resources. After a successful call to add_memory_resource() * with this flag set, the resource pointer must no longer be used as it * might be stale, or the resource might have changed.
*/ #define MHP_MERGE_RESOURCE ((__force mhp_t)BIT(0))
/* * We want memmap (struct page array) to be self contained. * To do so, we will use the beginning of the hot-added range to build * the page tables for the memmap array that describes the entire range. * Only selected architectures support it with SPARSE_VMEMMAP. * This is only a hint, the core kernel can decide to not do this based on * different alignment checks.
*/ #define MHP_MEMMAP_ON_MEMORY ((__force mhp_t)BIT(1)) /* * The nid field specifies a memory group id (mgid) instead. The memory group * implies the node id (nid).
*/ #define MHP_NID_IS_MGID ((__force mhp_t)BIT(2)) /* * The hotplugged memory is completely inaccessible while the memory is * offline. The memory provider will handle MEM_PREPARE_ONLINE / * MEM_FINISH_OFFLINE notifications and make the memory accessible. * * This flag is only relevant when used along with MHP_MEMMAP_ON_MEMORY, * because the altmap cannot be written (e.g., poisoned) when adding * memory -- before it is set online. * * This allows for adding memory with an altmap that is not currently * made available by a hypervisor. When onlining that memory, the * hypervisor can be instructed to make that memory available, and * the onlining phase will not require any memory allocations, which is * helpful in low-memory situations.
*/ #define MHP_OFFLINE_INACCESSIBLE ((__force mhp_t)BIT(3))
/* * Extended parameters for memory hotplug: * altmap: alternative allocator for memmap array (optional) * pgprot: page protection flags to apply to newly created page tables * (required)
*/ struct mhp_params { struct vmem_altmap *altmap;
pgprot_t pgprot; struct dev_pagemap *pgmap;
};
/* * Zone resizing functions * * Note: any attempt to resize a zone should has pgdat_resize_lock() * zone_span_writelock() both held. This ensure the size of a zone * can't be changed while pgdat_resize_lock() held.
*/ staticinlineunsigned zone_span_seqbegin(struct zone *zone)
{ return read_seqbegin(&zone->span_seqlock);
} staticinlineint zone_span_seqretry(struct zone *zone, unsigned iv)
{ return read_seqretry(&zone->span_seqlock, iv);
} staticinlinevoid zone_span_writelock(struct zone *zone)
{
write_seqlock(&zone->span_seqlock);
} staticinlinevoid zone_span_writeunlock(struct zone *zone)
{
write_sequnlock(&zone->span_seqlock);
} staticinlinevoid zone_seqlock_init(struct zone *zone)
{
seqlock_init(&zone->span_seqlock);
} externvoid adjust_present_page_count(struct page *page, struct memory_group *group, long nr_pages); /* VM interface that may be used by firmware interface */ externint mhp_init_memmap_on_memory(unsignedlong pfn, unsignedlong nr_pages, struct zone *zone, bool mhp_off_inaccessible); externvoid mhp_deinit_memmap_on_memory(unsignedlong pfn, unsignedlong nr_pages); externint online_pages(unsignedlong pfn, unsignedlong nr_pages, struct zone *zone, struct memory_group *group); externunsignedlong __offline_isolated_pages(unsignedlong start_pfn, unsignedlong end_pfn);
/* * Keep this declaration outside CONFIG_MEMORY_HOTPLUG as some * platforms might override and use arch_get_mappable_range() * for internal non memory hotplug purposes.
*/ struct range arch_get_mappable_range(void);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.