linux-mips
[Top] [All Lists]

Fwd: [RFC] Calculate exactly how many ptr is needed for pgd

To: linux-mips <linux-mips@linux-mips.org>, Ralf <ralf@linux-mips.org>
Subject: Fwd: [RFC] Calculate exactly how many ptr is needed for pgd
From: "Dajie Tan" <jiankemeng@gmail.com>
Date: Thu, 2 Aug 2007 07:55:48 +0400
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ud7qtqygjYT12dxYt72qHtwfDM4+K+MVoKRd+7Hy9wLtIZc9BXTf9XfqCP14rw0vECAfFqRZ6TQQdfrWW1YdX3w03V0IvTnlYcUtXijcv/bOVFX7lE3OW/FXVz8Mq0AGVr4DqbQ/ns735/kj5U/6yqwDjRBlCcQgHMMmPATdw2g=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PPb7U+TzksNQtB3pwPSoRr2aSeydt8R5iXNtF7mNZTfuWZmR+rHGzUaiKX1TqGAFeKmVHpe4D5oI3pKUNv1EjVD2WXEcRHXr8VldlqM5ZDxz2VYnbsDk7n+Pgdgt/d2CRb7v2JFFNYQvPWqdQRuX8IQz++aMjN+lvLyyHPfLO8Q=
In-reply-to: <5861a7880708012054u404c9b02s7141d1811d4a7fdf@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <46AF4981.1090601@lemote.com> <5861a7880708012054u404c9b02s7141d1811d4a7fdf@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
It works well. If I start xorg+xfce, it can save 2.5MB memory in my system.

Thanks, songmao.

2007/7/31, Songmao Tian <tiansm@lemote.com>:
> Under 32-bit kernel with 4k page, a page is needed for a pgd,
> but when page size > 4k, a page will be too much.
>
> diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
> index 2fbd47e..2a16240 100644
> --- a/include/asm-mips/pgtable-32.h
> +++ b/include/asm-mips/pgtable-32.h
> @@ -67,7 +67,8 @@ extern int add_temporary_entry(unsigned long entrylo0,
> unsigned long entrylo1,
>  #define PTE_ORDER    0
>  #endif
>
> -#define PTRS_PER_PGD    ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))
> +/* Using a page for pgd will be a waste when page size > 4k */
> +#define PTRS_PER_PGD    (1 << (32 - PGDIR_SHIFT))
>  #define PTRS_PER_PTE    ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
>
>  #define USER_PTRS_PER_PGD    (0x80000000UL/PGDIR_SIZE)
>
>


-- 
为天地立心
为生民立命
为往圣继绝学
为万世开太平
<Prev in Thread] Current Thread [Next in Thread>
  • Fwd: [RFC] Calculate exactly how many ptr is needed for pgd, Dajie Tan <=