mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@sous-sol.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-kernel@vger.kernel.org,
	William Lee Irwin III <wli@holomorphy.com>,
	akpm@linux-foundation.org, jeremy@goop.org, zach@vmware.com
Subject: Re: [RFC] i386: Remove page sized slabs for pgds and pmds
Date: Wed, 28 Mar 2007 15:26:56 -0700	[thread overview]
Message-ID: <20070328222656.GS6602@sequoia.sous-sol.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0703281309210.12985@schroedinger.engr.sgi.com>

* Christoph Lameter (clameter@sgi.com) wrote:
> +#ifdef CONFIG_HIGHMEM64G
> +#define __pgd_alloc()		kmem_cache_alloc(pgd_cache, GFP_KERNEL|__GFP_REPEAT)
> +#define __pgd_free(pgd)		kmem_cache_free(pgd_cache, pgd)

I must've glazed over something, I thought this was removal of slabs?

BTW, this will interact shared_kernel_pmd patch that Jeremy's posted a
few times (I know at least wli has looked over that one).  We need to
make sure that PAE under at least Xen hypervisor has a page-sized pgd,
although the mmlist chaining looks nice to me.

> +static struct kmem_cache *pgd_cache;
> +
> +void __init pgtable_cache_init(void)
> +{
> +	pgd_cache = kmem_cache_create("pgd",
> +				PTRS_PER_PGD*sizeof(pgd_t),
> +				PTRS_PER_PGD*sizeof(pgd_t),
> +				SLAB_PANIC,
> +				NULL,
> +				NULL);
> +}
> +#else /* !CONFIG_HIGHMEM64G */
> +#define __pgd_alloc()		((pgd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT))
> +#define __pgd_free(pgd)		free_page((unsigned long)(pgd))
> +#endif /* !CONFIG_HIGHMEM64G */
>  
>  pgd_t *pgd_alloc(struct mm_struct *mm)
>  {
>  	int i;
> -	pgd_t *pgd = kmem_cache_alloc(pgd_cache, GFP_KERNEL);
> +	pgd_t *pgd = __pgd_alloc();
>  
> -	if (PTRS_PER_PMD == 1 || !pgd)
> +	if (!pgd)
> +		return NULL;
> +	memcpy(&pgd[USER_PTRS_PER_PGD], &swapper_pg_dir[USER_PTRS_PER_PGD],
> +						KERNEL_PGD_PTRS*sizeof(pgd_t));

clone_pgd_range() for consistency?  and it seems we lost a paravirt_alloc_pd_clone()
in there somewhere.

> +	if (PTRS_PER_PMD == 1)
>  		return pgd;

  parent reply	other threads:[~2007-03-28 22:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-28 20:12 Christoph Lameter
2007-03-28 20:45 ` Andrew Morton
2007-03-28 21:05   ` Christoph Lameter
2007-03-28 21:16     ` William Lee Irwin III
2007-03-28 21:20       ` Christoph Lameter
2007-03-28 22:37         ` William Lee Irwin III
2007-03-28 23:44           ` Christoph Lameter
2007-03-29  0:53             ` William Lee Irwin III
2007-03-29  1:09               ` Christoph Lameter
2007-03-29  1:17     ` Benjamin LaHaise
2007-03-28 20:50 ` William Lee Irwin III
2007-03-28 21:00   ` Christoph Lameter
2007-03-28 21:24     ` William Lee Irwin III
2007-03-28 21:38       ` Christoph Lameter
2007-03-28 22:01         ` William Lee Irwin III
2007-03-28 22:22           ` Christoph Lameter
2007-03-29  0:28           ` Alan Cox
2007-03-29  0:59             ` William Lee Irwin III
2007-03-28 22:26 ` Chris Wright [this message]
2007-03-28 22:33   ` William Lee Irwin III
2007-03-28 22:45     ` Chris Wright
2007-03-28 23:42     ` Zachary Amsden
2007-03-28 22:47       ` Chris Wright

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=20070328222656.GS6602@sequoia.sous-sol.org \
    --to=chrisw@sous-sol.org \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wli@holomorphy.com \
    --cc=zach@vmware.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®