Skip to content

Commit af370fb

Browse files
Yasunori Gototorvalds
authored andcommitted
memory hotplug: small fixes to bootmem freeing for memory hotremove
- Change some naming * Magic -> types * MIX_INFO -> MIX_SECTION_INFO * Change definition of bootmem type from direct hex value - __free_pages_bootmem() becomes __meminit. Signed-off-by: Yasunori Goto <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Badari Pulavarty <[email protected]> Cc: Yinghai Lu <[email protected]> Cc: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 48c9068 commit af370fb

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

include/linux/memory_hotplug.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ struct mem_section;
1313
#ifdef CONFIG_MEMORY_HOTPLUG
1414

1515
/*
16-
* Magic number for free bootmem.
16+
* Types for free bootmem.
1717
* The normal smallest mapcount is -1. Here is smaller value than it.
1818
*/
19-
#define SECTION_INFO 0xfffffffe
20-
#define MIX_INFO 0xfffffffd
21-
#define NODE_INFO 0xfffffffc
19+
#define SECTION_INFO (-1 - 1)
20+
#define MIX_SECTION_INFO (-1 - 2)
21+
#define NODE_INFO (-1 - 3)
2222

2323
/*
2424
* pgdat resizing functions

mm/memory_hotplug.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,20 @@ static void release_memory_resource(struct resource *res)
6262

6363
#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
6464
#ifndef CONFIG_SPARSEMEM_VMEMMAP
65-
static void get_page_bootmem(unsigned long info, struct page *page, int magic)
65+
static void get_page_bootmem(unsigned long info, struct page *page, int type)
6666
{
67-
atomic_set(&page->_mapcount, magic);
67+
atomic_set(&page->_mapcount, type);
6868
SetPagePrivate(page);
6969
set_page_private(page, info);
7070
atomic_inc(&page->_count);
7171
}
7272

7373
void put_page_bootmem(struct page *page)
7474
{
75-
int magic;
75+
int type;
7676

77-
magic = atomic_read(&page->_mapcount);
78-
BUG_ON(magic >= -1);
77+
type = atomic_read(&page->_mapcount);
78+
BUG_ON(type >= -1);
7979

8080
if (atomic_dec_return(&page->_count) == 1) {
8181
ClearPagePrivate(page);
@@ -119,7 +119,7 @@ static void register_page_bootmem_info_section(unsigned long start_pfn)
119119
mapsize = PAGE_ALIGN(usemap_size()) >> PAGE_SHIFT;
120120

121121
for (i = 0; i < mapsize; i++, page++)
122-
get_page_bootmem(section_nr, page, MIX_INFO);
122+
get_page_bootmem(section_nr, page, MIX_SECTION_INFO);
123123

124124
}
125125

mm/page_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static void __free_pages_ok(struct page *page, unsigned int order)
533533
/*
534534
* permit the bootmem allocator to evade page validation on high-order frees
535535
*/
536-
void __free_pages_bootmem(struct page *page, unsigned int order)
536+
void __meminit __free_pages_bootmem(struct page *page, unsigned int order)
537537
{
538538
if (order == 0) {
539539
__ClearPageReserved(page);

0 commit comments

Comments
 (0)