Commit e86ff3c7 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Clear dirty bits etc on compound frees

From: "Martin J. Bligh" <mbligh@aracnet.com>,
      Guillaume Morin <guillaume@morinfr.org>

We need to clear the software dirty bit on the tail pages of a compound page
when freeing it up.

The tail pages can become dirtied by mmap'ing /dev/mem, and writing into
any clustered page group (that a driver might have created or whatever).

Plus it's better to run all these pages through the free_pages_check checks
anyway.
parent 3182fe92
......@@ -267,9 +267,11 @@ free_pages_bulk(struct zone *zone, int count,
void __free_pages_ok(struct page *page, unsigned int order)
{
LIST_HEAD(list);
int i;
mod_page_state(pgfree, 1 << order);
free_pages_check(__FUNCTION__, page);
for (i = 0 ; i < (1 << order) ; ++i)
free_pages_check(__FUNCTION__, page + i);
list_add(&page->list, &list);
kernel_map_pages(page, 1<<order, 0);
free_pages_bulk(page_zone(page), 1, &list, order);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment