Received: from mail.onstor.com ([66.201.51.107]) by onstor-exch02.onstor.net with Microsoft SMTPSVC(6.0.3790.3959);
	 Tue, 23 Sep 2008 10:05:38 -0700
Received: from ausesmta2-3.messageone.com ([64.20.241.45]) by mail.onstor.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Tue, 23 Sep 2008 10:05:38 -0700
Received: from ftp.linux-mips.org (ftp.linux-mips.org [213.58.128.207])
	by ausesmta2-3.messageone.com (8.13.8/8.13.8) with ESMTP id m8NH5aWn018208
	for <andy.sharp@onstor.com>; Tue, 23 Sep 2008 12:05:36 -0500
Received: from localhost.localdomain ([127.0.0.1]:34972 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP
	id S28589880AbYIWPLU (ORCPT <rfc822;andy.sharp@onstor.com>);
	Tue, 23 Sep 2008 16:11:20 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 23 Sep 2008 16:11:03 +0100 (BST)
Received: from mail.windriver.com ([147.11.1.11]:34992 "EHLO mail.wrs.com")
	by ftp.linux-mips.org with ESMTP id S28641160AbYIWOuy (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Tue, 23 Sep 2008 15:50:54 +0100
Received: from ALA-MAIL03.corp.ad.wrs.com (ala-mail03 [147.11.57.144])
	by mail.wrs.com (8.13.6/8.13.6) with ESMTP id m8NEoho3021829;
	Tue, 23 Sep 2008 07:50:43 -0700 (PDT)
Received: from ala-mail06.corp.ad.wrs.com ([147.11.57.147]) by ALA-MAIL03.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 23 Sep 2008 07:50:43 -0700
Received: from localhost.localdomain ([128.224.162.72]) by ala-mail06.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Tue, 23 Sep 2008 07:50:42 -0700
From: jack.tan@windriver.com
To: ralf@linux-mips.com
Cc: linux-mips@linux-mips.org, jack.tan@windriver.com,
        Dajie Tan <jiankemeng@gmail.com>
Subject: [PATCH] Fixed the definition of PTRS_PER_PGD
Date: 	Tue, 23 Sep 2008 22:52:34 +0800
Message-Id: <1222181554-4318-1-git-send-email-jack.tan@windriver.com>
X-Mailer: git-send-email 1.5.6.5
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-OriginalArrivalTime: 23 Sep 2008 14:50:42.0974 (UTC) FILETIME=[C0D6EBE0:01C91D8B]
X-archive-position: 20602
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: jack.tan@windriver.com
Precedence: bulk
X-list: 	linux-mips
X-MessageOne-Virus-Version: vendor=fsecure engine=4.65.7161:2.4.4,1.2.40,4.0.164 definitions=2008-09-23_08:2008-09-19,2008-09-23,2008-09-23 signatures=0
X-MessageOne-Virus-Scanned: Clean
X-MessageOne-Envelope-Sender: linux-mips-bounce@linux-mips.org
X-MessageOne-Spam-Details: rule=m773emszm_notspam policy=m773emszm score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=3.1.0-0805090000 definitions=main-0809230088
X-MessageOne-Spam-Score: 0
X-MessageOne-Spam-Bar: 
Return-Path: linux-mips-bounce@linux-mips.org

From: Jack Tan <jack.tan@windriver.com>

When we use > 4KB's page size the original definition is not consistent
with PGDIR_SIZE. For exeample, if we use 16KB page size the PGDIR_SHIFT is
(14-2) + 14 = 26, PGDIR_SIZE is 2^26，so the PTRS_PER_PGD should be:

	2^32/2^26 = 2^6

but the original definition of PTRS_PER_PGD is 4096 (PGDIR_ORDER = 0).

So, this definition needs to be consistent with the PGDIR_SIZE.

And the new definition is consistent with the PGD init in pagetable_init().

Signed-off-by: Dajie Tan <jiankemeng@gmail.com>
---
 include/asm-mips/pgtable-32.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 4396e9f..55813d6 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -57,7 +57,7 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
 #define PMD_ORDER	1
 #define PTE_ORDER	0
 
-#define PTRS_PER_PGD	((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))
+#define PTRS_PER_PGD	(USER_PTRS_PER_PGD * 2)
 #define PTRS_PER_PTE	((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
 
 #define USER_PTRS_PER_PGD	(0x80000000UL/PGDIR_SIZE)
-- 
1.5.5.4


