All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: benh@kernel.crashing.org
Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org,
	linux-s390@vger.kernel.org, borntraeger@de.ibm.com
Subject: Re: [patch 2/6] CONFIG_HIGHPTE vs. sub-page page tables.
Date: Fri, 26 Oct 2007 10:06:31 +0200	[thread overview]
Message-ID: <1193385991.31831.11.camel@localhost> (raw)
In-Reply-To: <1193345221.7018.18.camel@pasglop>

> @@ -107,20 +107,21 @@ __init_refok pte_t *pte_alloc_one_kernel
>  	return pte;
>  }
>  
> -struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
> +pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
>  {
>  	struct page *ptepage;
>  
>  #ifdef CONFIG_HIGHPTE
> -	gfp_t flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT;
> +	gfp_t flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT | __GFP_ZERO;
>  #else
> -	gfp_t flags = GFP_KERNEL | __GFP_REPEAT;
> +	gfp_t flags = GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO;
>  #endif
>  
>  	ptepage = alloc_pages(flags, 0);
> -	if (ptepage)
> -		clear_highpage(ptepage);
> -	return ptepage;
> +	if (!ptepage)
> +		return NULL;
> +	pgtable_page_ctor(ptepage);
> +	return page_address(ptepage);
>  }
>  
> void pte_free_kernel(struct mm_struct *mm, pte_t *pte)

Hmpf, where is my brown paper bag? The pte_alloc_one function for 32 bit
powerpc should better return a struct page pointer .. fix below.

-- 
blue skies,
  Martin.

"Reality continues to ruin my life." - Calvin.

---

diff -urpN linux-2.6/arch/powerpc/mm/pgtable_32.c linux-2.6-patched/arch/powerpc/mm/pgtable_32.c
--- linux-2.6/arch/powerpc/mm/pgtable_32.c	2007-10-26 09:38:30.000000000 +0200
+++ linux-2.6-patched/arch/powerpc/mm/pgtable_32.c	2007-10-26 10:01:10.000000000 +0200
@@ -121,7 +121,7 @@ pgtable_t pte_alloc_one(struct mm_struct
 	if (!ptepage)
 		return NULL;
 	pgtable_page_ctor(ptepage);
-	return page_address(ptepage);
+	return ptepage;
 }
 
 void pte_free_kernel(struct mm_struct *mm, pte_t *pte)



WARNING: multiple messages have this Message-ID (diff)
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: benh@kernel.crashing.org
Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org,
	linux-s390@vger.kernel.org, borntraeger@de.ibm.com
Subject: Re: [patch 2/6] CONFIG_HIGHPTE vs. sub-page page tables.
Date: Fri, 26 Oct 2007 10:06:31 +0200	[thread overview]
Message-ID: <1193385991.31831.11.camel@localhost> (raw)
In-Reply-To: <1193345221.7018.18.camel@pasglop>

> @@ -107,20 +107,21 @@ __init_refok pte_t *pte_alloc_one_kernel
>  	return pte;
>  }
>  
> -struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
> +pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
>  {
>  	struct page *ptepage;
>  
>  #ifdef CONFIG_HIGHPTE
> -	gfp_t flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT;
> +	gfp_t flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT | __GFP_ZERO;
>  #else
> -	gfp_t flags = GFP_KERNEL | __GFP_REPEAT;
> +	gfp_t flags = GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO;
>  #endif
>  
>  	ptepage = alloc_pages(flags, 0);
> -	if (ptepage)
> -		clear_highpage(ptepage);
> -	return ptepage;
> +	if (!ptepage)
> +		return NULL;
> +	pgtable_page_ctor(ptepage);
> +	return page_address(ptepage);
>  }
>  
> void pte_free_kernel(struct mm_struct *mm, pte_t *pte)

Hmpf, where is my brown paper bag? The pte_alloc_one function for 32 bit
powerpc should better return a struct page pointer .. fix below.

-- 
blue skies,
  Martin.

"Reality continues to ruin my life." - Calvin.

---

diff -urpN linux-2.6/arch/powerpc/mm/pgtable_32.c linux-2.6-patched/arch/powerpc/mm/pgtable_32.c
--- linux-2.6/arch/powerpc/mm/pgtable_32.c	2007-10-26 09:38:30.000000000 +0200
+++ linux-2.6-patched/arch/powerpc/mm/pgtable_32.c	2007-10-26 10:01:10.000000000 +0200
@@ -121,7 +121,7 @@ pgtable_t pte_alloc_one(struct mm_struct
 	if (!ptepage)
 		return NULL;
 	pgtable_page_ctor(ptepage);
-	return page_address(ptepage);
+	return ptepage;
 }
 
 void pte_free_kernel(struct mm_struct *mm, pte_t *pte)


--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2007-10-26  8:06 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-25 18:15 [patch 0/6] s390 page tables on steroids Martin Schwidefsky
2007-10-25 18:15 ` Martin Schwidefsky
2007-10-25 18:15 ` [patch 1/6] add mm argument to pte/pmd/pud/pgd_free Martin Schwidefsky
2007-10-25 18:15   ` Martin Schwidefsky, Benjamin Herrenschmidt, Martin Schwidefsky
2007-10-25 18:15 ` [patch 2/6] CONFIG_HIGHPTE vs. sub-page page tables Martin Schwidefsky
2007-10-25 18:15   ` Martin Schwidefsky, Martin Schwidefsky
2007-10-25 20:47   ` Benjamin Herrenschmidt
2007-10-25 20:47     ` Benjamin Herrenschmidt
2007-10-26  7:42     ` Martin Schwidefsky
2007-10-26  7:42       ` Martin Schwidefsky
2007-10-26  8:00       ` Benjamin Herrenschmidt
2007-10-26  8:00         ` Benjamin Herrenschmidt
2007-10-26  8:08         ` Martin Schwidefsky
2007-10-26  8:08           ` Martin Schwidefsky
2007-10-26  8:06     ` Martin Schwidefsky [this message]
2007-10-26  8:06       ` Martin Schwidefsky
2007-10-25 18:15 ` [patch 3/6] arch_update_pgd call Martin Schwidefsky
2007-10-25 18:15   ` Martin Schwidefsky, Martin Schwidefsky
2007-10-25 20:48   ` Benjamin Herrenschmidt
2007-10-25 20:48     ` Benjamin Herrenschmidt
2007-10-25 22:49     ` Benjamin Herrenschmidt
2007-10-25 22:49       ` Benjamin Herrenschmidt
2007-10-26  7:40     ` Martin Schwidefsky
2007-10-26  7:40       ` Martin Schwidefsky
2007-10-26  7:59       ` Benjamin Herrenschmidt
2007-10-26  7:59         ` Benjamin Herrenschmidt
2007-10-26  8:22         ` Martin Schwidefsky
2007-10-26  8:22           ` Martin Schwidefsky
2007-10-26 11:28           ` Benjamin Herrenschmidt
2007-10-26 11:28             ` Benjamin Herrenschmidt
2007-10-25 18:15 ` [patch 4/6] s390: 1K/2K page table pages Martin Schwidefsky
2007-10-25 18:15   ` Martin Schwidefsky, Martin Schwidefsky
2007-10-25 18:15 ` [patch 5/6] s390: Add four level page tables for CONFIG_64BIT=y Martin Schwidefsky
2007-10-25 18:15   ` Martin Schwidefsky, Martin Schwidefsky
2007-10-25 18:15 ` [patch 6/6] s390: dynamic page tables Martin Schwidefsky
2007-10-25 18:15   ` Martin Schwidefsky, Martin Schwidefsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1193385991.31831.11.camel@localhost \
    --to=schwidefsky@de.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=borntraeger@de.ibm.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.