From patchwork Wed May 21 12:16:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 4216471 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4AE0ABEEAB for ; Wed, 21 May 2014 12:16:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 322CD2015E for ; Wed, 21 May 2014 12:16:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7007420108 for ; Wed, 21 May 2014 12:16:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D5AAA6E889; Wed, 21 May 2014 05:16:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 282116E889 for ; Wed, 21 May 2014 05:16:42 -0700 (PDT) Received: by mail-ee0-f52.google.com with SMTP id e53so1562413eek.11 for ; Wed, 21 May 2014 05:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=gLWuOa2IXneP5vi+Q5Jye7nTaJJidM1oSjDFt2H6wJ0=; b=zjs/AmhVRo07mcfwaCwid9Eo/EdDve1NPus/q3GJOaL5f3LDIotqMWsCuN93BQOMIR zsrtv7LcmtgQmvTe7Z0OsMGDCdsCDwPx30rpe4EbrPqV3DGfCFiiru9wHItLLO/KD0gP im4QYfOdr2wiZFqmbMyC2+/owtWT4Hl9DR8xKpWd/RYxSSw3i2Sugy3vMTBWU3b1m/S3 DyuHzw8BK+Gi6AgmvhOWLFhB9jBQ1+2XUbGReGhyXSotdh9z7KfjVhs8wA+2mU5qm2hE 736vORwJTKlZSM9y9eWY4Tjg/TgYWBngTh9GdppCeh3ezGXeBCjd3iMcDLOvv6l6mnKY qt2w== X-Received: by 10.14.215.5 with SMTP id d5mr3610581eep.62.1400674601179; Wed, 21 May 2014 05:16:41 -0700 (PDT) Received: from david-tp.localdomain (stgt-5f70253f.pool.mediaWays.net. [95.112.37.63]) by mx.google.com with ESMTPSA id 44sm11495522eer.35.2014.05.21.05.16.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 May 2014 05:16:40 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/gem: remove obsolete BUG_ON Date: Wed, 21 May 2014 14:16:26 +0200 Message-Id: <1400674586-17968-1-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.9.3 Cc: daniel.vetter@ffwll.ch, hughd@google.com, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The shmem subsystem supports relocating pages on swap-in in case it was loaded into the wrong zone. This was implemented 2 years ago in: commit bde05d1ccd512696b09db9dd2e5f33ad19152605 Author: Hugh Dickins Date: Tue May 29 15:06:38 2012 -0700 shmem: replace page if mapping excludes its zone If a driver requires pages to be in a specific zone, they _must_ set the correct GFP flags (like __GFP_DMA32) in mapping_gfp_mask(mapping). shmem will make sure that any page leaving the swap-cache is located in a compatible zone. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_gem.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 9909bef..a6146ab 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -473,25 +473,6 @@ struct page **drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask) if (IS_ERR(p)) goto fail; pages[i] = p; - - /* There is a hypothetical issue w/ drivers that require - * buffer memory in the low 4GB.. if the pages are un- - * pinned, and swapped out, they can end up swapped back - * in above 4GB. If pages are already in memory, then - * shmem_read_mapping_page_gfp will ignore the gfpmask, - * even if the already in-memory page disobeys the mask. - * - * It is only a theoretical issue today, because none of - * the devices with this limitation can be populated with - * enough memory to trigger the issue. But this BUG_ON() - * is here as a reminder in case the problem with - * shmem_read_mapping_page_gfp() isn't solved by the time - * it does become a real issue. - * - * See this thread: http://lkml.org/lkml/2011/7/11/238 - */ - BUG_ON((gfpmask & __GFP_DMA32) && - (page_to_pfn(p) >= 0x00100000UL)); } return pages;