From owner-svn-src-all@freebsd.org Sat Mar 12 11:57:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0B44ACC550; Sat, 12 Mar 2016 11:57:33 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1784921; Sat, 12 Mar 2016 11:57:33 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2CBvWTP034175; Sat, 12 Mar 2016 11:57:32 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2CBvWDd034174; Sat, 12 Mar 2016 11:57:32 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201603121157.u2CBvWDd034174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Sat, 12 Mar 2016 11:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296721 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Mar 2016 11:57:33 -0000 Author: dumbbell Date: Sat Mar 12 11:57:32 2016 New Revision: 296721 URL: https://svnweb.freebsd.org/changeset/base/296721 Log: drm/i915: Call i915_gem_gtt_fini() when the device is detached This fixes several memory leaks. Apparently, this problem exists in Linux 3.8 but the code changed in Linux 3.9 so it may be fixed upstream already. Still, this is something we need to pay attention to. Modified: head/sys/dev/drm2/i915/i915_dma.c Modified: head/sys/dev/drm2/i915/i915_dma.c ============================================================================== --- head/sys/dev/drm2/i915/i915_dma.c Sat Mar 12 11:54:58 2016 (r296720) +++ head/sys/dev/drm2/i915/i915_dma.c Sat Mar 12 11:57:32 2016 (r296721) @@ -1810,6 +1810,12 @@ int i915_driver_unload(struct drm_device if (dev_priv->mmio_map != NULL) drm_rmmap(dev, dev_priv->mmio_map); + /* + * NOTE Linux<->FreeBSD: Linux forgots to call + * i915_gem_gtt_fini(), causing memory leaks. + */ + i915_gem_gtt_fini(dev); + if (dev_priv->wq != NULL) taskqueue_free(dev_priv->wq);