From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e36.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id l8RK91sj032695 for ; Thu, 27 Sep 2007 16:09:01 -0400 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l8RK914D427360 for ; Thu, 27 Sep 2007 14:09:01 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l8RK91fd015869 for ; Thu, 27 Sep 2007 14:09:01 -0600 From: Adam Litke Subject: [PATCH 1/4] hugetlb: Move update_and_free_page Date: Thu, 27 Sep 2007 13:08:59 -0700 Message-Id: <20070927200858.14951.39075.stgit@kernel> In-Reply-To: <20070927200848.14951.26553.stgit@kernel> References: <20070927200848.14951.26553.stgit@kernel> Content-Type: text/plain; charset=utf-8; format=fixed Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org Return-Path: To: linux-mm@kvack.org Cc: libhugetlbfs-devel@lists.sourceforge.net, Adam Litke , Andy Whitcroft , Mel Gorman , Bill Irwin , Ken Chen , Dave McCracken List-ID: This patch simply moves update_and_free_page() so that it can be reused later in this patch series. The implementation is not changed. Signed-off-by: Adam Litke Acked-by: Andy Whitcroft Acked-by: Dave McCracken --- mm/hugetlb.c | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index de4cf45..eb5b9f4 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -90,6 +90,21 @@ static struct page *dequeue_huge_page(struct vm_area_struct *vma, return page; } +static void update_and_free_page(struct page *page) +{ + int i; + nr_huge_pages--; + nr_huge_pages_node[page_to_nid(page)]--; + for (i = 0; i < (HPAGE_SIZE / PAGE_SIZE); i++) { + page[i].flags &= ~(1 << PG_locked | 1 << PG_error | 1 << PG_referenced | + 1 << PG_dirty | 1 << PG_active | 1 << PG_reserved | + 1 << PG_private | 1<< PG_writeback); + } + set_compound_page_dtor(page, NULL); + set_page_refcounted(page); + __free_pages(page, HUGETLB_PAGE_ORDER); +} + static void free_huge_page(struct page *page) { BUG_ON(page_count(page)); @@ -199,21 +214,6 @@ static unsigned int cpuset_mems_nr(unsigned int *array) } #ifdef CONFIG_SYSCTL -static void update_and_free_page(struct page *page) -{ - int i; - nr_huge_pages--; - nr_huge_pages_node[page_to_nid(page)]--; - for (i = 0; i < (HPAGE_SIZE / PAGE_SIZE); i++) { - page[i].flags &= ~(1 << PG_locked | 1 << PG_error | 1 << PG_referenced | - 1 << PG_dirty | 1 << PG_active | 1 << PG_reserved | - 1 << PG_private | 1<< PG_writeback); - } - set_compound_page_dtor(page, NULL); - set_page_refcounted(page); - __free_pages(page, HUGETLB_PAGE_ORDER); -} - #ifdef CONFIG_HIGHMEM static void try_to_free_low(unsigned long count) { -- 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