memory_hotplug.c (d0dc12e86b3197a14a908d4fe7cb35b73dda82b5) memory_hotplug.c (e8b098fc5747a7c871f113c9eb65453cc2d86e6f)
1/*
2 * linux/mm/memory_hotplug.c
3 *
4 * Copyright (C)
5 */
6
7#include <linux/stddef.h>
8#include <linux/mm.h>

--- 527 unchanged lines hidden (view full) ---

536 return 0;
537}
538
539/**
540 * __remove_pages() - remove sections of pages from a zone
541 * @zone: zone from which pages need to be removed
542 * @phys_start_pfn: starting pageframe (must be aligned to start of a section)
543 * @nr_pages: number of pages to remove (must be multiple of section size)
1/*
2 * linux/mm/memory_hotplug.c
3 *
4 * Copyright (C)
5 */
6
7#include <linux/stddef.h>
8#include <linux/mm.h>

--- 527 unchanged lines hidden (view full) ---

536 return 0;
537}
538
539/**
540 * __remove_pages() - remove sections of pages from a zone
541 * @zone: zone from which pages need to be removed
542 * @phys_start_pfn: starting pageframe (must be aligned to start of a section)
543 * @nr_pages: number of pages to remove (must be multiple of section size)
544 * @altmap: alternative device page map or %NULL if default memmap is used
544 *
545 * Generic helper function to remove section mappings and sysfs entries
546 * for the section of the memory we are removing. Caller needs to make
547 * sure that pages are marked reserved and zones are adjust properly by
548 * calling offline_pages().
549 */
550int __remove_pages(struct zone *zone, unsigned long phys_start_pfn,
551 unsigned long nr_pages, struct vmem_altmap *altmap)

--- 487 unchanged lines hidden (view full) ---

1039 free_percpu(pgdat->per_cpu_nodestats);
1040 arch_free_nodedata(pgdat);
1041 return;
1042}
1043
1044
1045/**
1046 * try_online_node - online a node if offlined
545 *
546 * Generic helper function to remove section mappings and sysfs entries
547 * for the section of the memory we are removing. Caller needs to make
548 * sure that pages are marked reserved and zones are adjust properly by
549 * calling offline_pages().
550 */
551int __remove_pages(struct zone *zone, unsigned long phys_start_pfn,
552 unsigned long nr_pages, struct vmem_altmap *altmap)

--- 487 unchanged lines hidden (view full) ---

1040 free_percpu(pgdat->per_cpu_nodestats);
1041 arch_free_nodedata(pgdat);
1042 return;
1043}
1044
1045
1046/**
1047 * try_online_node - online a node if offlined
1048 * @nid: the node ID
1047 *
1048 * called by cpu_up() to online a node without onlined memory.
1049 */
1050int try_online_node(int nid)
1051{
1052 pg_data_t *pgdat;
1053 int ret;
1054

--- 744 unchanged lines hidden (view full) ---

1799 */
1800
1801 unmap_cpu_on_node(pgdat);
1802 return 0;
1803}
1804
1805/**
1806 * try_offline_node
1049 *
1050 * called by cpu_up() to online a node without onlined memory.
1051 */
1052int try_online_node(int nid)
1053{
1054 pg_data_t *pgdat;
1055 int ret;
1056

--- 744 unchanged lines hidden (view full) ---

1801 */
1802
1803 unmap_cpu_on_node(pgdat);
1804 return 0;
1805}
1806
1807/**
1808 * try_offline_node
1809 * @nid: the node ID
1807 *
1808 * Offline a node if all memory sections and cpus of the node are removed.
1809 *
1810 * NOTE: The caller must call lock_device_hotplug() to serialize hotplug
1811 * and online/offline operations before this call.
1812 */
1813void try_offline_node(int nid)
1814{

--- 27 unchanged lines hidden (view full) ---

1842 */
1843 node_set_offline(nid);
1844 unregister_one_node(nid);
1845}
1846EXPORT_SYMBOL(try_offline_node);
1847
1848/**
1849 * remove_memory
1810 *
1811 * Offline a node if all memory sections and cpus of the node are removed.
1812 *
1813 * NOTE: The caller must call lock_device_hotplug() to serialize hotplug
1814 * and online/offline operations before this call.
1815 */
1816void try_offline_node(int nid)
1817{

--- 27 unchanged lines hidden (view full) ---

1845 */
1846 node_set_offline(nid);
1847 unregister_one_node(nid);
1848}
1849EXPORT_SYMBOL(try_offline_node);
1850
1851/**
1852 * remove_memory
1853 * @nid: the node ID
1854 * @start: physical address of the region to remove
1855 * @size: size of the region to remove
1850 *
1851 * NOTE: The caller must call lock_device_hotplug() to serialize hotplug
1852 * and online/offline operations before this call, as required by
1853 * try_offline_node().
1854 */
1855void __ref remove_memory(int nid, u64 start, u64 size)
1856{
1857 int ret;

--- 28 unchanged lines hidden ---
1856 *
1857 * NOTE: The caller must call lock_device_hotplug() to serialize hotplug
1858 * and online/offline operations before this call, as required by
1859 * try_offline_node().
1860 */
1861void __ref remove_memory(int nid, u64 start, u64 size)
1862{
1863 int ret;

--- 28 unchanged lines hidden ---