From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omx1.americas.sgi.com (omx1-ext.sgi.com [192.48.179.11]) by ozlabs.org (Postfix) with ESMTP id 38BBF679E7 for ; Sat, 3 Jun 2006 06:06:52 +1000 (EST) Date: Fri, 2 Jun 2006 13:06:43 -0700 (PDT) From: Christoph Lameter To: Adam Litke Subject: Re: [PATCH] hugetlb: powerpc: Actively close unused htlb regions on vma close In-Reply-To: <1149257287.9693.6.camel@localhost.localdomain> Message-ID: References: <1149257287.9693.6.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: Christoph Lameter Cc: linuxppc-dev@ozlabs.org, David Gibson , linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, 2 Jun 2006, Adam Litke wrote: > The following patch introduces a architecture-specific vm_ops.close() > hook. For all architectures besides powerpc, this is a no-op. On > powerpc, the low and high segments are scanned to locate empty hugetlb > segments which can be made available for normal mappings. Comments? IA64 has similar issues and uses the hook suggested by Hugh. However, we have a permanently reserved memory area. I am a bit surprised about the need to make address space available for normal mappings. Is this for 32 bit powerpc support? void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling) { /* * This is called to free hugetlb page tables. * * The offset of these addresses from the base of the hugetlb * region must be scaled down by HPAGE_SIZE/PAGE_SIZE so that * the standard free_pgd_range will free the right page tables. * * If floor and ceiling are also in the hugetlb region, they * must likewise be scaled down; but if outside, left unchanged. */ addr = htlbpage_to_page(addr); end = htlbpage_to_page(end); if (REGION_NUMBER(floor) == RGN_HPAGE) floor = htlbpage_to_page(floor); if (REGION_NUMBER(ceiling) == RGN_HPAGE) ceiling = htlbpage_to_page(ceiling); free_pgd_range(tlb, addr, end, floor, ceiling); }