diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-10-11 05:45:34 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-10-11 05:45:34 +0000 |
commit | 8ffd9bd0b4dcade9f006648b9fbfdd29919be12e (patch) | |
tree | 7bf5618d4a1131b42a21a7e0ceb2e0de4ed156a6 /sys/dev/pci/drm | |
parent | bd7e866240e812ce3b8ea40f542d2e79c315ba68 (diff) |
Align pool items on CACHELINESIZE when replacing linux kmem_cache with
SLAB_HWCACHE_ALIGN flag.
tested by semarie@
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/amdgpu_fence.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/amdgpu_sync.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/gem/i915_gem_object.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/gt/intel_context.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_active.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_buddy.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_request.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_scheduler.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_vma.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/include/linux/processor.h | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/include/linux/slab.h | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/scheduler/sched_fence.c | 2 |
12 files changed, 18 insertions, 12 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_fence.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_fence.c index db3f288a633..7e6c107c244 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_fence.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_fence.c @@ -69,7 +69,7 @@ int amdgpu_fence_slab_init(void) return -ENOMEM; #else pool_init(&amdgpu_fence_slab, sizeof(struct amdgpu_fence), - 0, IPL_TTY, 0, "amdgpu_fence", NULL); + CACHELINESIZE, IPL_TTY, 0, "amdgpu_fence", NULL); #endif return 0; } diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_sync.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_sync.c index dd5c1002024..610f1270f8d 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_sync.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_sync.c @@ -467,7 +467,7 @@ int amdgpu_sync_init(void) return -ENOMEM; #else pool_init(&amdgpu_sync_slab, sizeof(struct amdgpu_sync_entry), - 0, IPL_TTY, 0, "amdgpu_sync", NULL); + CACHELINESIZE, IPL_TTY, 0, "amdgpu_sync", NULL); #endif return 0; diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_object.c b/sys/dev/pci/drm/i915/gem/i915_gem_object.c index 4138bb19600..7511a515a4d 100644 --- a/sys/dev/pci/drm/i915/gem/i915_gem_object.c +++ b/sys/dev/pci/drm/i915/gem/i915_gem_object.c @@ -410,7 +410,7 @@ int __init i915_global_objects_init(void) return -ENOMEM; #else pool_init(&global.slab_objects, sizeof(struct drm_i915_gem_object), - 0, IPL_NONE, 0, "drmobj", NULL); + CACHELINESIZE, IPL_NONE, 0, "drmobj", NULL); #endif i915_global_register(&global.base); diff --git a/sys/dev/pci/drm/i915/gt/intel_context.c b/sys/dev/pci/drm/i915/gt/intel_context.c index 49b8a04ec71..3c5eafd61ff 100644 --- a/sys/dev/pci/drm/i915/gt/intel_context.c +++ b/sys/dev/pci/drm/i915/gt/intel_context.c @@ -354,7 +354,7 @@ int __init i915_global_context_init(void) return -ENOMEM; #else pool_init(&global.slab_ce, sizeof(struct intel_context), - 0, IPL_TTY, 0, "ictx", NULL); + CACHELINESIZE, IPL_TTY, 0, "ictx", NULL); #endif i915_global_register(&global.base); diff --git a/sys/dev/pci/drm/i915/i915_active.c b/sys/dev/pci/drm/i915/i915_active.c index 1763cb92dd9..313bfb40b4f 100644 --- a/sys/dev/pci/drm/i915/i915_active.c +++ b/sys/dev/pci/drm/i915/i915_active.c @@ -998,7 +998,7 @@ int __init i915_global_active_init(void) return -ENOMEM; #else pool_init(&global.slab_cache, sizeof(struct active_node), - 0, IPL_TTY, 0, "drmsc", NULL); + CACHELINESIZE, IPL_TTY, 0, "drmsc", NULL); #endif i915_global_register(&global.base); diff --git a/sys/dev/pci/drm/i915/i915_buddy.c b/sys/dev/pci/drm/i915/i915_buddy.c index 6fffdcfde93..873a27c4036 100644 --- a/sys/dev/pci/drm/i915/i915_buddy.c +++ b/sys/dev/pci/drm/i915/i915_buddy.c @@ -50,7 +50,7 @@ int __init i915_global_buddy_init(void) return -ENOMEM; #else pool_init(&global.slab_blocks, sizeof(struct i915_buddy_block), - 0, IPL_NONE, 0, "i915bb", NULL); + CACHELINESIZE, IPL_NONE, 0, "i915bb", NULL); #endif i915_global_register(&global.base); diff --git a/sys/dev/pci/drm/i915/i915_request.c b/sys/dev/pci/drm/i915/i915_request.c index 971c9d7ce37..2cd4082b046 100644 --- a/sys/dev/pci/drm/i915/i915_request.c +++ b/sys/dev/pci/drm/i915/i915_request.c @@ -1788,9 +1788,9 @@ int __init i915_global_request_init(void) goto err_requests; #else pool_init(&global.slab_requests, sizeof(struct i915_request), - 0, IPL_TTY, 0, "i915_request", NULL); + CACHELINESIZE, IPL_TTY, 0, "i915_request", NULL); pool_init(&global.slab_execute_cbs, sizeof(struct execute_cb), - 0, IPL_TTY, 0, "i915_exec", NULL); + CACHELINESIZE, IPL_TTY, 0, "i915_exec", NULL); #endif i915_global_register(&global.base); diff --git a/sys/dev/pci/drm/i915/i915_scheduler.c b/sys/dev/pci/drm/i915/i915_scheduler.c index 7501722b7c9..05ec8b53a0e 100644 --- a/sys/dev/pci/drm/i915/i915_scheduler.c +++ b/sys/dev/pci/drm/i915/i915_scheduler.c @@ -574,9 +574,9 @@ err_priorities: return -ENOMEM; #else pool_init(&global.slab_dependencies, sizeof(struct i915_dependency), - 0, IPL_TTY, 0, "gsdep", NULL); + CACHELINESIZE, IPL_TTY, 0, "gsdep", NULL); pool_init(&global.slab_priorities, sizeof(struct i915_priolist), - 0, IPL_TTY, 0, "gspri", NULL); + CACHELINESIZE, IPL_TTY, 0, "gspri", NULL); i915_global_register(&global.base); return 0; diff --git a/sys/dev/pci/drm/i915/i915_vma.c b/sys/dev/pci/drm/i915/i915_vma.c index ea322f38909..2bf2292ae31 100644 --- a/sys/dev/pci/drm/i915/i915_vma.c +++ b/sys/dev/pci/drm/i915/i915_vma.c @@ -1418,7 +1418,7 @@ int __init i915_global_vma_init(void) return -ENOMEM; #else pool_init(&global.slab_vmas, sizeof(struct i915_vma), - 0, IPL_NONE, 0, "drmvma", NULL); + CACHELINESIZE, IPL_NONE, 0, "drmvma", NULL); #endif i915_global_register(&global.base); diff --git a/sys/dev/pci/drm/include/linux/processor.h b/sys/dev/pci/drm/include/linux/processor.h index 9ddf8c3a753..9386a526e3c 100644 --- a/sys/dev/pci/drm/include/linux/processor.h +++ b/sys/dev/pci/drm/include/linux/processor.h @@ -19,4 +19,8 @@ cpu_relax(void) } } +#ifndef CACHELINESIZE +#define CACHELINESIZE 64 +#endif + #endif diff --git a/sys/dev/pci/drm/include/linux/slab.h b/sys/dev/pci/drm/include/linux/slab.h index 0d5463ecc1b..c1d5ec8fa24 100644 --- a/sys/dev/pci/drm/include/linux/slab.h +++ b/sys/dev/pci/drm/include/linux/slab.h @@ -10,6 +10,8 @@ #include <linux/workqueue.h> #include <linux/gfp.h> +#include <linux/processor.h> /* for CACHELINESIZE */ + static inline void * kmalloc(size_t size, int flags) { diff --git a/sys/dev/pci/drm/scheduler/sched_fence.c b/sys/dev/pci/drm/scheduler/sched_fence.c index 29b75f99097..59ffbd1ad40 100644 --- a/sys/dev/pci/drm/scheduler/sched_fence.c +++ b/sys/dev/pci/drm/scheduler/sched_fence.c @@ -43,7 +43,7 @@ int __init drm_sched_fence_slab_init(void) return -ENOMEM; #else pool_init(&sched_fence_slab, sizeof(struct drm_sched_fence), - 0, IPL_NONE, 0, "drm_sched_fence", NULL); + CACHELINESIZE, IPL_NONE, 0, "drm_sched_fence", NULL); #endif return 0; |