diff --git a/include/linux/mm.h b/include/linux/mm.h index d064c73c925e17130dcb08614a071e75d5571e6a..43b70d5f82019b08d3f42c4b68c9b43fc4eb2b2d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1303,6 +1303,13 @@ extern void free_initmem(void); */ extern unsigned long free_reserved_area(unsigned long start, unsigned long end, int poison, char *s); +#ifdef CONFIG_HIGHMEM +/* + * Free a highmem page into the buddy system, adjusting totalhigh_pages + * and totalram_pages. + */ +extern void free_highmem_page(struct page *page); +#endif static inline void adjust_managed_page_count(struct page *page, long count) { diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5c660f5ba3d340a5cb55901c0147ccba6b7a1ab7..72da11c6804d203e38d77d2cd7688b9dd73fcdd2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5141,6 +5141,15 @@ unsigned long free_reserved_area(unsigned long start, unsigned long end, return pages; } +#ifdef CONFIG_HIGHMEM +void free_highmem_page(struct page *page) +{ + __free_reserved_page(page); + totalram_pages++; + totalhigh_pages++; +} +#endif + /** * set_dma_reserve - set the specified number of pages reserved in the first zone * @new_dma_reserve: The number of pages to mark reserved