From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 0/9] [RFC] fair-lru eviction Date: Wed, 19 May 2010 09:06:52 +0100 Message-ID: <89khjo$ff6kjg@orsmga002.jf.intel.com> References: <1274217111-3882-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1274217111-3882-1-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: Daniel Vetter , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, 18 May 2010 23:11:42 +0200, Daniel Vetter wrote: > Hi all, > > This patch series implements the fair-lru eviction Chris Wilson already > posted with a twist. It's essentially the same idea & algorithm. > Differnences versus his patch: > - Doesn't do any allocations while scanning. > - Implemented in drm_mm.c > > In other words, this should also be usable by ttm. The idea is simple: > Scan through the lru, marking objects as evictable until there is a > large area of memory free/free-able. Then walk through all the scanned > objects in reverse, checking which ones fall into this hole. Finally > evicting them. > > Comments, ideas highly welcome. The next adaptation I did was to clean up evict_something to add objects from the inactive, active&&!pinned&&!write, flushing&&!pinned, active&&!pinned&&write lists. This reduces the logic in evict_something to a single scan over the available objects in LRU order. We still need the move-to-inactive-tail upon access by the CPU, and I think it is acceptable to maintain our preference of the GPU over the CPU. Recovering memory from the CPU is comparatively cheap. Comparing 'while :; do yes > /tmp/yes; done & cairo-perf-trace', there is no significant delta between the fair LRU and current. I'll rebase my evict_something() on top of your drm_mm, and rerun the tests. -- Chris Wilson, Intel Open Source Technology Centre