aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-05-25 08:34:08 -0400
committerDave Airlie <airlied@redhat.com>2014-05-27 01:50:57 -0400
commit2123000b01792e182fc4122fdb612ed641f3385e (patch)
tree6c3ec1eb99982fee7f44d95654d7867db04898a3
parent89086bca67f04a538765faf39ea7c1b718beaf34 (diff)
drm/gem: replace misleading comment
shmem supports page-relocations during swapin since quite some time. It was implemented in: commit bde05d1ccd512696b09db9dd2e5f33ad19152605 Author: Hugh Dickins <hughd@google.com> Date: Tue May 29 15:06:38 2012 -0700 shmem: replace page if mapping excludes its zone The gem-comment about wrongly placed DMA32 pages is no longer valid. Replace it with a proper comment but keep the BUG_ON() to verify correct shmem behavior. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_gem.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 9909bef59800..f7d71190aad5 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -474,21 +474,10 @@ struct page **drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask)
474 goto fail; 474 goto fail;
475 pages[i] = p; 475 pages[i] = p;
476 476
477 /* There is a hypothetical issue w/ drivers that require 477 /* Make sure shmem keeps __GFP_DMA32 allocated pages in the
478 * buffer memory in the low 4GB.. if the pages are un- 478 * correct region during swapin. Note that this requires
479 * pinned, and swapped out, they can end up swapped back 479 * __GFP_DMA32 to be set in mapping_gfp_mask(inode->i_mapping)
480 * in above 4GB. If pages are already in memory, then 480 * so shmem can relocate pages during swapin if required.
481 * shmem_read_mapping_page_gfp will ignore the gfpmask,
482 * even if the already in-memory page disobeys the mask.
483 *
484 * It is only a theoretical issue today, because none of
485 * the devices with this limitation can be populated with
486 * enough memory to trigger the issue. But this BUG_ON()
487 * is here as a reminder in case the problem with
488 * shmem_read_mapping_page_gfp() isn't solved by the time
489 * it does become a real issue.
490 *
491 * See this thread: http://lkml.org/lkml/2011/7/11/238
492 */ 481 */
493 BUG_ON((gfpmask & __GFP_DMA32) && 482 BUG_ON((gfpmask & __GFP_DMA32) &&
494 (page_to_pfn(p) >= 0x00100000UL)); 483 (page_to_pfn(p) >= 0x00100000UL));