AGP fix race condition between unmapping and freeing pages

With Andi's clflush fixup, we were getting hangs on server exit, flushing the
mappings after freeing each page helped.

This showed up a race condition where the pages after being freed could be
reused before the agp mappings had been flushed.  Flushing after each single
page is a bad thing for future drm work, so make the page destroy a two pass
unmapping all the pages, flushing the mappings, and then destroying the pages.

Signed-off-by: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Dave Airlie
2007-10-15 10:19:16 +10:00
committed by Dave Airlie
szülő 23fd50450a
commit a2721e998e
6 fájl változott, egészen pontosan 48 új sor hozzáadva és 27 régi sor törölve

Fájl megtekintése

@@ -536,10 +536,10 @@ static void *i460_alloc_page (struct agp_bridge_data *bridge)
return page;
}
static void i460_destroy_page (void *page)
static void i460_destroy_page (void *page, int flags)
{
if (I460_IO_PAGE_SHIFT <= PAGE_SHIFT) {
agp_generic_destroy_page(page);
agp_generic_destroy_page(page, flags);
global_flush_tlb();
}
}