Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11388
b: refs/heads/master
c: c6a57e1
h: refs/heads/master
v: v3
  • Loading branch information
Dave Hansen authored and Linus Torvalds committed Oct 30, 2005
1 parent 0f0acd5 commit 50cab3c
Show file tree
Hide file tree
Showing 2 changed files with 22 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: 4ca644d970bf2542623228a4624af356d20ca267
refs/heads/master: c6a57e19e464db118dc4ab9cfe9e9748c6d630a0
26 changes: 21 additions & 5 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,37 @@ int min_free_kbytes = 1024;
unsigned long __initdata nr_kernel_pages;
unsigned long __initdata nr_all_pages;

/*
* Temporary debugging check for pages not lying within a given zone.
*/
static int bad_range(struct zone *zone, struct page *page)
static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
{
if (page_to_pfn(page) >= zone->zone_start_pfn + zone->spanned_pages)
return 1;
if (page_to_pfn(page) < zone->zone_start_pfn)
return 1;

return 0;
}

static int page_is_consistent(struct zone *zone, struct page *page)
{
#ifdef CONFIG_HOLES_IN_ZONE
if (!pfn_valid(page_to_pfn(page)))
return 1;
return 0;
#endif
if (zone != page_zone(page))
return 0;

return 1;
}
/*
* Temporary debugging check for pages not lying within a given zone.
*/
static int bad_range(struct zone *zone, struct page *page)
{
if (page_outside_zone_boundaries(zone, page))
return 1;
if (!page_is_consistent(zone, page))
return 1;

return 0;
}

Expand Down

0 comments on commit 50cab3c

Please sign in to comment.