Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80428
b: refs/heads/master
c: 508bebb
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and Ingo Molnar committed Jan 30, 2008
1 parent 40f0e42 commit 7fa1f98
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fe3deef013bebdbed1f75ae59ef9707fb6e5cc7
refs/heads/master: 508bebbb1f211fbf3f392feea44218045096f240
14 changes: 11 additions & 3 deletions trunk/arch/x86/mm/pgtable_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ static void pgd_mop_up_pmds(pgd_t *pgdp)
{
int i;

for(i = 0; i < USER_PTRS_PER_PGD; i++) {
for(i = 0; i < UNSHARED_PTRS_PER_PGD; i++) {
pgd_t pgd = pgdp[i];

if (pgd_val(pgd) != 0) {
Expand All @@ -325,6 +325,10 @@ static void pgd_mop_up_pmds(pgd_t *pgdp)
* processor notices the update. Since this is expensive, and
* all 4 top-level entries are used almost immediately in a
* new process's life, we just pre-populate them here.
*
* Also, if we're in a paravirt environment where the kernel pmd is
* not shared between pagetables (!SHARED_KERNEL_PMDS), we allocate
* and initialize the kernel pmds here.
*/
static int pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd)
{
Expand All @@ -333,14 +337,19 @@ static int pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd)
int i;

pud = pud_offset(pgd, 0);
for (addr = i = 0; i < USER_PTRS_PER_PGD; i++, pud++, addr += PUD_SIZE) {
for (addr = i = 0; i < UNSHARED_PTRS_PER_PGD;
i++, pud++, addr += PUD_SIZE) {
pmd_t *pmd = pmd_alloc_one(mm, addr);

if (!pmd) {
pgd_mop_up_pmds(pgd);
return 0;
}

if (i >= USER_PTRS_PER_PGD)
memcpy(pmd, (pmd_t *)pgd_page_vaddr(swapper_pg_dir[i]),
sizeof(pmd_t) * PTRS_PER_PMD);

pud_populate(mm, pud, pmd);
}

Expand Down Expand Up @@ -444,4 +453,3 @@ void check_pgt_cache(void)
{
quicklist_trim(0, pgd_dtor, 25, 16);
}

0 comments on commit 7fa1f98

Please sign in to comment.