Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22469
b: refs/heads/master
c: 84d1c05
h: refs/heads/master
i:
  22467: 133d669
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Mar 22, 2006
1 parent c7c5d79 commit 554cfca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 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: f9aed0e2537174b95908f48b6052ae37196c9390
refs/heads/master: 84d1c054b1c408c6c92676069fa678d55d5f0033
20 changes: 13 additions & 7 deletions trunk/arch/i386/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot,
if (!base)
return NULL;

/*
* page_private is used to track the number of entries in
* the page table page that have non standard attributes.
*/
SetPagePrivate(base);
page_private(base) = 0;

address = __pa(address);
addr = address & LARGE_PAGE_MASK;
pbase = (pte_t *)page_address(base);
Expand Down Expand Up @@ -143,11 +150,12 @@ __change_page_attr(struct page *page, pgprot_t prot)
return -ENOMEM;
set_pmd_pte(kpte,address,mk_pte(split, ref_prot));
kpte_page = split;
}
get_page(kpte_page);
}
page_private(kpte_page)++;
} else if ((pte_val(*kpte) & _PAGE_PSE) == 0) {
set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL));
__put_page(kpte_page);
BUG_ON(page_private(kpte_page) == 0);
page_private(kpte_page)--;
} else
BUG();

Expand All @@ -157,10 +165,8 @@ __change_page_attr(struct page *page, pgprot_t prot)
* replace it with a largepage.
*/
if (!PageReserved(kpte_page)) {
/* memleak and potential failed 2M page regeneration */
BUG_ON(!page_count(kpte_page));

if (cpu_has_pse && (page_count(kpte_page) == 1)) {
if (cpu_has_pse && (page_private(kpte_page) == 0)) {
ClearPagePrivate(kpte_page);
list_add(&kpte_page->lru, &df_list);
revert_page(kpte_page, address);
}
Expand Down

0 comments on commit 554cfca

Please sign in to comment.