From: Thomas Hellstrom Date: Thu, 11 Nov 2010 08:41:57 +0000 (+0100) Subject: drm/ttm: Fix up io_mem_reserve / io_mem_free calling X-Git-Tag: v2.6.38-rc1~419^2~42^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eba67093f535322cb4f1c4b737319c0907a0c81d;p=pandora-kernel.git drm/ttm: Fix up io_mem_reserve / io_mem_free calling This patch attempts to fix up shortcomings with the current calling sequences. 1) There's a fastpath where no locking occurs and only io_mem_reserved is called to obtain needed info for mapping. The fastpath is set per memory type manager. 2) If the fastpath is disabled, io_mem_reserve and io_mem_free will be exactly balanced and not called recursively for the same struct ttm_mem_reg. 3) Optionally the driver can choose to enable a per memory type manager LRU eviction mechanism that, when io_mem_reserve returns -EAGAIN will attempt to kill user-space mappings of memory in that manager to free up needed resources Signed-off-by: Thomas Hellstrom Reviewed-by: Ben Skeggs Signed-off-by: Dave Airlie --- Reading git-diff-tree failed