On Tue, Nov 08, 2011 at 09:11:20AM +0100, Thomas Hellstrom wrote:
On 11/08/2011 12:40 AM, j.glisse@gmail.com wrote:
From: Jerome Glissejglisse@redhat.com
Use the ttm_tt page ptr array for page allocation, move the list to array unwinding into the page allocation functions.
V2 split the fix to use ttm put page as a separate fix properly fill pages array when TTM_PAGE_FLAG_ZERO_ALLOC is not set V3 Added back page_count()==1 check when freeing page
NAK, this patch introduces a DOS vulnerability. It's allowing an arbitrary number of pages to be allocated *before* accounting them. Currently TTM is allowing a "small" (page size) memory size to be allocated before accounting. So page allocation must be interleaved with accounting on a per-page basis unless we can figure out a way to do the accounting *before* allocating the pages.
/Thomas
Just a side note, current ttm_memory code is very likely to loop forever in the kernel (so is DOS compliant too). It will happen it ttm_shrink never succeed at freeing anythings which is not unreliable.
Anyway i am doing a reserve/alloc_pages approach this will more or less follow what current code does.
Cheers, Jerome