From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915: Protect mmaped buffers from casual eviction. Date: Tue, 11 May 2010 23:57:06 +0100 Message-ID: <89k304$ig3ed2@orsmga001.jf.intel.com> References: <1273593327-3051-1-git-send-email-chris@chris-wilson.co.uk> <87fx1yqtpv.fsf@pollan.anholt.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id C040D9E7EF for ; Tue, 11 May 2010 15:57:09 -0700 (PDT) In-Reply-To: <87fx1yqtpv.fsf@pollan.anholt.net> 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: Eric Anholt , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, 11 May 2010 09:38:36 -0700, Eric Anholt wrote: > Couldn't this be more easily handled by the times where you would move > to the tail of mmap, just move to the tail of inactive? Since inactive > is "obj_priv->gtt_space && !obj_priv->active" already. The real issue is the inactive list is no longer evicted in LRU, otherwise just moving to the end of inactive list would be ideal. In benchmarks it is faster to evict the appropriately sized object rather than iterate over the inactive list until enough contiguous space has been freed. The consequence is that the page-fault-of-doom is reintroduced unless some measure is taken to avoid it. I don't have any figures to suggest what the average size of the mmap_list will be. As an object is only on the list until it is used or evict-everything, then the list should be kept quite short. As our drivers improve, the frequency at which we have to mmap buffers should reduce as well... -ickle -- Chris Wilson, Intel Open Source Technology Centre