drm/i915: Make request allocation caches global
As kmem_caches share the same properties (size, allocation/free behaviour) for all potential devices, we can use global caches. While this potential has worse fragmentation behaviour (one can argue that different devices would have different activity lifetimes, but you can also argue that activity is temporal across the system) it is the default behaviour of the system at large to amalgamate matching caches. The benefit for us is much reduced pointer dancing along the frequent allocation paths. v2: Defer shrinking until after a global grace period for futureproofing multiple consumers of the slab caches, similar to the current strategy for avoiding shrinking too early. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190228102035.5857-1-chris@chris-wilson.co.uk
This commit is contained in:
@@ -28,8 +28,8 @@
|
||||
|
||||
#include <drm/drm_drv.h>
|
||||
|
||||
#include "i915_active.h"
|
||||
#include "i915_drv.h"
|
||||
#include "i915_globals.h"
|
||||
#include "i915_selftest.h"
|
||||
|
||||
#define PLATFORM(x) .platform = (x), .platform_mask = BIT(x)
|
||||
@@ -802,7 +802,9 @@ static int __init i915_init(void)
|
||||
bool use_kms = true;
|
||||
int err;
|
||||
|
||||
i915_global_active_init();
|
||||
err = i915_globals_init();
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = i915_mock_selftests();
|
||||
if (err)
|
||||
@@ -835,7 +837,7 @@ static void __exit i915_exit(void)
|
||||
return;
|
||||
|
||||
pci_unregister_driver(&i915_pci_driver);
|
||||
i915_global_active_exit();
|
||||
i915_globals_exit();
|
||||
}
|
||||
|
||||
module_init(i915_init);
|
||||
|
Reference in New Issue
Block a user