From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 3/5] drm/i915: use shmem helpers if possible Date: Mon, 2 Jun 2014 17:00:03 +0200 Message-ID: <20140602150003.GR19050@phenom.ffwll.local> References: <1401021252-29006-1-git-send-email-dh.herrmann@gmail.com> <1401021252-29006-3-git-send-email-dh.herrmann@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by gabe.freedesktop.org (Postfix) with ESMTP id 254856E5A4 for ; Mon, 2 Jun 2014 08:00:10 -0700 (PDT) Received: by mail-we0-f169.google.com with SMTP id u56so5389980wes.0 for ; Mon, 02 Jun 2014 08:00:09 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1401021252-29006-3-git-send-email-dh.herrmann@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: David Herrmann Cc: Daniel Vetter , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Sun, May 25, 2014 at 02:34:10PM +0200, David Herrmann wrote: > Instead of shuffling gfp-masks all the time, use the > shmem_read_mapping_page() helper. Note that __GFP_IO and __GFP_WAIT are > set in mapping_gfp_mask() for i915, so the behavior is still the same. > > Cc: Daniel Vetter > Cc: Jani Nikula > Signed-off-by: David Herrmann Queued for -next, thanks for the patch. -Daniel > --- > drivers/gpu/drm/i915/i915_gem.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > index e1fa919..1a72aad 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -1925,16 +1925,10 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) > * our own buffer, now let the real VM do its job and > * go down in flames if truly OOM. > */ > - gfp &= ~(__GFP_NORETRY | __GFP_NOWARN | __GFP_NO_KSWAPD); > - gfp |= __GFP_IO | __GFP_WAIT; > - > i915_gem_shrink_all(dev_priv); > - page = shmem_read_mapping_page_gfp(mapping, i, gfp); > + page = shmem_read_mapping_page(mapping, i); > if (IS_ERR(page)) > goto err_pages; > - > - gfp |= __GFP_NORETRY | __GFP_NOWARN | __GFP_NO_KSWAPD; > - gfp &= ~(__GFP_IO | __GFP_WAIT); > } > #ifdef CONFIG_SWIOTLB > if (swiotlb_nr_tbl()) { > -- > 1.9.3 > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch