Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110135
b: refs/heads/master
c: 6babc32
h: refs/heads/master
i:
  110133: 431314c
  110131: c911885
  110127: f50a8d0
v: v3
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Oct 2, 2008
1 parent d240fbf commit 75f6c75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 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: 4b19de6d1cb07c8bcb6778e771f9cfd5bcfdfd3e
refs/heads/master: 6babc32c41e3642d875372cb6afbd9ade7a9f311
13 changes: 8 additions & 5 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,14 @@ void prep_compound_page(struct page *page, unsigned long order)
{
int i;
int nr_pages = 1 << order;
struct page *p = page + 1;

set_compound_page_dtor(page, free_compound_page);
set_compound_order(page, order);
__SetPageHead(page);
for (i = 1; i < nr_pages; i++) {
struct page *p = page + i;

for (i = 1; i < nr_pages; i++, p++) {
if (unlikely((i & (MAX_ORDER_NR_PAGES - 1)) == 0))
p = pfn_to_page(page_to_pfn(page) + i);
__SetPageTail(p);
p->first_page = page;
}
Expand All @@ -284,15 +285,17 @@ static void destroy_compound_page(struct page *page, unsigned long order)
{
int i;
int nr_pages = 1 << order;
struct page *p = page + 1;

if (unlikely(compound_order(page) != order))
bad_page(page);

if (unlikely(!PageHead(page)))
bad_page(page);
__ClearPageHead(page);
for (i = 1; i < nr_pages; i++) {
struct page *p = page + i;
for (i = 1; i < nr_pages; i++, p++) {
if (unlikely((i & (MAX_ORDER_NR_PAGES - 1)) == 0))
p = pfn_to_page(page_to_pfn(page) + i);

if (unlikely(!PageTail(p) |
(p->first_page != page)))
Expand Down

0 comments on commit 75f6c75

Please sign in to comment.