From: Daniel Vetter Subject: Re: [PATCH 6/9] drm/i915: Allocate context objects from stolen Date: Sat, 10 Aug 2013 11:44:35 +0200 Message-ID: <20130810094435.GJ31670@phenom.ffwll.local> References: <1375969271-4331-1-git-send-email-chris@chris-wilson.co.uk> <1375969271-4331-6-git-send-email-chris@chris-wilson.co.uk> <20130810092546.GI31670@phenom.ffwll.local> <20130810093429.GJ3561@cantiga.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f169.google.com (mail-ea0-f169.google.com [209.85.215.169]) by gabe.freedesktop.org (Postfix) with ESMTP id A1196E6683 for ; Sat, 10 Aug 2013 02:44:28 -0700 (PDT) Received: by mail-ea0-f169.google.com with SMTP id z7so2502687eaf.0 for ; Sat, 10 Aug 2013 02:44:27 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130810093429.GJ3561@cantiga.alporthouse.com> 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: Chris Wilson , Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sat, Aug 10, 2013 at 10:34:29AM +0100, Chris Wilson wrote: > On Sat, Aug 10, 2013 at 11:25:46AM +0200, Daniel Vetter wrote: > > On Thu, Aug 08, 2013 at 02:41:08PM +0100, Chris Wilson wrote: > > > Once again, the CPU PAT bits are irrelevant when considering the GPU > > > cacheing, and context objects are never accessed from the CPU or > > > directly by userspace making them another ideal candidate to allocate > > > from stolen memory. > > > > > > Signed-off-by: Chris Wilson > > > > I think this will break hibernate, since over hibernate stolen get some > > garbage. And userspace (and the gpu) probably don't expect garbage when > > trying to restore a hw context. > > Same will be true for framebuffers, which we definitely want to use > stolen for. Suggests we will need to allocate temporaries across > hibernate or warn userspace that the contents are garbage. Yeah, it's not just an issue for contexts but for everything that we don't fully reinit upon wake-up from hibernate. But I have no idea how allocating a temporary shmem node when we do hibernate interferes with the hibernate's page cache shrinker ... Maybe we need to simply clear to black upon resume. The other solution would be to simply give back all the leftover stolen mem to the linux kernel, maybe as a cma block. And teach our allocation functions more smarts to grab hugepages (or cma junks for the fb compressed buffer). -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch