summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_buddy.h
diff options
context:
space:
mode:
authorJason Ekstrand <jason@jlekstrand.net>2021-07-21 10:23:58 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2021-07-22 12:08:12 +0200
commit0f4651359a235a702b383076fc2ccbd90d9bedb4 (patch)
tree8b29aa4ebdbe91bb2c7cc747a2d554ed6738459d /drivers/gpu/drm/i915/i915_buddy.h
parenta04ea6ae7c6728cd834709f3477e75d4f74583da (diff)
drm/i915: Make the kmem slab for i915_buddy_block a global
There's no reason that I can tell why this should be per-i915_buddy_mm and doing so causes KMEM_CACHE to throw dmesg warnings because it tries to create a debugfs entry with the name i915_buddy_block multiple times. We could handle this by carefully giving each slab its own name but that brings its own pain because then we have to store that string somewhere and manage the lifetimes of the different slabs. The most likely outcome would be a global atomic which we increment to get a new name or something like that. The much easier solution is to use the i915_globals system like we do for every other slab in i915. This ensures that we have exactly one of them for each i915 driver load and it gets neatly created on module load and destroyed on module unload. Using the globals system also means that its now tied into the shrink handler so we can properly respond to low-memory situations. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Fixes: 88be9a0a06b7 ("drm/i915/ttm: add ttm_buddy_man") Reviewed-by: Matthew Auld <matthew.auld@intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Cc: Christian König <christian.koenig@amd.com> [danvet: Rebase against removal of global shrink code] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210721152358.2893314-7-jason@jlekstrand.net
Diffstat (limited to 'drivers/gpu/drm/i915/i915_buddy.h')
-rw-r--r--drivers/gpu/drm/i915/i915_buddy.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_buddy.h b/drivers/gpu/drm/i915/i915_buddy.h
index 37f8c42071d1..d8f26706de52 100644
--- a/drivers/gpu/drm/i915/i915_buddy.h
+++ b/drivers/gpu/drm/i915/i915_buddy.h
@@ -47,7 +47,6 @@ struct i915_buddy_block {
* i915_buddy_alloc* and i915_buddy_free* should suffice.
*/
struct i915_buddy_mm {
- struct kmem_cache *slab_blocks;
/* Maintain a free list for each order. */
struct list_head *free_list;
@@ -130,4 +129,6 @@ void i915_buddy_free(struct i915_buddy_mm *mm, struct i915_buddy_block *block);
void i915_buddy_free_list(struct i915_buddy_mm *mm, struct list_head *objects);
+int i915_global_buddy_init(void);
+
#endif