From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx171.postini.com [74.125.245.171]) by kanga.kvack.org (Postfix) with SMTP id 6CEC06B004D for ; Sun, 10 Mar 2013 04:08:42 -0400 (EDT) Received: by mail-pb0-f54.google.com with SMTP id rr4so2677671pbb.13 for ; Sun, 10 Mar 2013 00:08:41 -0800 (PST) From: Jiang Liu Subject: [PATCH v2, part2 01/10] mm: introduce free_highmem_page() helper to free highmem pages into buddy system Date: Sun, 10 Mar 2013 16:01:01 +0800 Message-Id: <1362902470-25787-2-git-send-email-jiang.liu@huawei.com> In-Reply-To: <1362902470-25787-1-git-send-email-jiang.liu@huawei.com> References: <1362902470-25787-1-git-send-email-jiang.liu@huawei.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , David Rientjes Cc: Jiang Liu , Wen Congyang , Mel Gorman , Minchan Kim , KAMEZAWA Hiroyuki , Michal Hocko , Jianguo Wu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michel Lespinasse , Rik van Riel , Konstantin Khlebnikov , Marek Szyprowski , Michal Nazarewicz , Russell King , David Howells , James Hogan , Michal Simek , Ralf Baechle , David Daney , "David S. Miller" , Sam Ravnborg , Jeff Dike , Richard Weinberger , "H. Peter Anvin" Introduce helper function free_highmem_page(), which will be used by architectures with HIGHMEM enabled to free highmem pages into the buddy system. Signed-off-by: Jiang Liu Cc: Andrew Morton Cc: Mel Gorman Cc: Michel Lespinasse Cc: Rik van Riel Cc: Konstantin Khlebnikov Cc: Minchan Kim Cc: Marek Szyprowski Cc: Michal Nazarewicz Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Cc: Russell King Cc: David Howells Cc: James Hogan Cc: Michal Simek Cc: Ralf Baechle Cc: David Daney Cc: "David S. Miller" Cc: Sam Ravnborg Cc: Jeff Dike Cc: Richard Weinberger Cc: "H. Peter Anvin" --- include/linux/mm.h | 7 +++++++ mm/page_alloc.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index d75c14b..f2fb750 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 0fadb09..37bc8ab 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5133,6 +5133,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 -- 1.7.9.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org