From: Chris Wilson Date: Wed, 12 Jan 2011 21:11:33 +0000 (+0000) Subject: drm: Trim the GEM mmap offset hashtab X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4cb81ac2028a18f3f872f56fb7527afe5f5d0278;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: Trim the GEM mmap offset hashtab Using an order 19 drm_ht for the mmap offsets is a little obscene. That means that will a fully populated GTT with every single object mmaped at least once in its lifetime, there will be exactly one object in each bucket. Typically systems only have at most a few thousand objects, though you may see a KDE desktop hit 50000. And most of those should never be mapped... On my systems, just using an order 10 ht would still have an average occupancy less than 1, so apply a small safety factor and use an order 12 ht, like the other mmap offset ht. Signed-off-by: Chris Wilson Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index aa8df2534819..57ce27c9a747 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -101,7 +101,7 @@ drm_gem_init(struct drm_device *dev) dev->mm_private = mm; - if (drm_ht_create(&mm->offset_hash, 19)) { + if (drm_ht_create(&mm->offset_hash, 12)) { kfree(mm); return -ENOMEM; }