intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first
@ 2021-07-23 19:29 Daniel Vetter
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 02/10] drm/i915: move i915_active slab to direct module init/exit Daniel Vetter
                   ` (13 more replies)
  0 siblings, 14 replies; 46+ messages in thread
From: Daniel Vetter @ 2021-07-23 19:29 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

When modesetting (aka the full pci driver, which has nothing to do
with disable_display option, which just gives you the full pci driver
without the display driver) is disabled, we load nothing and do
nothing.

So move that check first, for a bit of orderliness. With Jason's
module init/exit table this now becomes trivial.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 48ea23dd3b5b..0deaeeba2347 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -1292,9 +1292,9 @@ static const struct {
    int (*init)(void);
    void (*exit)(void);
 } init_funcs[] = {
+	{ i915_check_nomodeset, NULL },
 	{ i915_globals_init, i915_globals_exit },
 	{ i915_mock_selftests, NULL },
-	{ i915_check_nomodeset, NULL },
 	{ i915_pmu_init, i915_pmu_exit },
 	{ i915_register_pci_driver, i915_unregister_pci_driver },
 	{ i915_perf_sysctl_register, i915_perf_sysctl_unregister },
-- 
2.32.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [PATCH 02/10] drm/i915: move i915_active slab to direct module init/exit
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
@ 2021-07-23 19:29 ` Daniel Vetter
  2021-07-26 15:24   ` Jason Ekstrand
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy " Daniel Vetter
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 46+ messages in thread
From: Daniel Vetter @ 2021-07-23 19:29 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

With the global kmem_cache shrink infrastructure gone there's nothing
special and we can convert them over.

I'm doing this split up into each patch because there's quite a bit of
noise with removing the static global.slab_cache to just a slab_cache.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_active.c  | 31 ++++++++++-------------------
 drivers/gpu/drm/i915/i915_active.h  |  3 +++
 drivers/gpu/drm/i915/i915_globals.c |  2 --
 drivers/gpu/drm/i915/i915_globals.h |  1 -
 drivers/gpu/drm/i915/i915_pci.c     |  2 ++
 5 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c
index 91723123ae9f..9ffeb77eb5bb 100644
--- a/drivers/gpu/drm/i915/i915_active.c
+++ b/drivers/gpu/drm/i915/i915_active.c
@@ -13,7 +13,6 @@
 
 #include "i915_drv.h"
 #include "i915_active.h"
-#include "i915_globals.h"
 
 /*
  * Active refs memory management
@@ -22,10 +21,7 @@
  * they idle (when we know the active requests are inactive) and allocate the
  * nodes from a local slab cache to hopefully reduce the fragmentation.
  */
-static struct i915_global_active {
-	struct i915_global base;
-	struct kmem_cache *slab_cache;
-} global;
+struct kmem_cache *slab_cache;
 
 struct active_node {
 	struct rb_node node;
@@ -174,7 +170,7 @@ __active_retire(struct i915_active *ref)
 	/* Finally free the discarded timeline tree  */
 	rbtree_postorder_for_each_entry_safe(it, n, &root, node) {
 		GEM_BUG_ON(i915_active_fence_isset(&it->base));
-		kmem_cache_free(global.slab_cache, it);
+		kmem_cache_free(slab_cache, it);
 	}
 }
 
@@ -322,7 +318,7 @@ active_instance(struct i915_active *ref, u64 idx)
 	 * XXX: We should preallocate this before i915_active_ref() is ever
 	 *  called, but we cannot call into fs_reclaim() anyway, so use GFP_ATOMIC.
 	 */
-	node = kmem_cache_alloc(global.slab_cache, GFP_ATOMIC);
+	node = kmem_cache_alloc(slab_cache, GFP_ATOMIC);
 	if (!node)
 		goto out;
 
@@ -788,7 +784,7 @@ void i915_active_fini(struct i915_active *ref)
 	mutex_destroy(&ref->mutex);
 
 	if (ref->cache)
-		kmem_cache_free(global.slab_cache, ref->cache);
+		kmem_cache_free(slab_cache, ref->cache);
 }
 
 static inline bool is_idle_barrier(struct active_node *node, u64 idx)
@@ -908,7 +904,7 @@ int i915_active_acquire_preallocate_barrier(struct i915_active *ref,
 		node = reuse_idle_barrier(ref, idx);
 		rcu_read_unlock();
 		if (!node) {
-			node = kmem_cache_alloc(global.slab_cache, GFP_KERNEL);
+			node = kmem_cache_alloc(slab_cache, GFP_KERNEL);
 			if (!node)
 				goto unwind;
 
@@ -956,7 +952,7 @@ int i915_active_acquire_preallocate_barrier(struct i915_active *ref,
 		atomic_dec(&ref->count);
 		intel_engine_pm_put(barrier_to_engine(node));
 
-		kmem_cache_free(global.slab_cache, node);
+		kmem_cache_free(slab_cache, node);
 	}
 	return -ENOMEM;
 }
@@ -1176,21 +1172,16 @@ struct i915_active *i915_active_create(void)
 #include "selftests/i915_active.c"
 #endif
 
-static void i915_global_active_exit(void)
+void i915_active_module_exit(void)
 {
-	kmem_cache_destroy(global.slab_cache);
+	kmem_cache_destroy(slab_cache);
 }
 
-static struct i915_global_active global = { {
-	.exit = i915_global_active_exit,
-} };
-
-int __init i915_global_active_init(void)
+int __init i915_active_module_init(void)
 {
-	global.slab_cache = KMEM_CACHE(active_node, SLAB_HWCACHE_ALIGN);
-	if (!global.slab_cache)
+	slab_cache = KMEM_CACHE(active_node, SLAB_HWCACHE_ALIGN);
+	if (!slab_cache)
 		return -ENOMEM;
 
-	i915_global_register(&global.base);
 	return 0;
 }
diff --git a/drivers/gpu/drm/i915/i915_active.h b/drivers/gpu/drm/i915/i915_active.h
index d0feda68b874..5fcdb0e2bc9e 100644
--- a/drivers/gpu/drm/i915/i915_active.h
+++ b/drivers/gpu/drm/i915/i915_active.h
@@ -247,4 +247,7 @@ static inline int __i915_request_await_exclusive(struct i915_request *rq,
 	return err;
 }
 
+void i915_active_module_exit(void);
+int i915_active_module_init(void);
+
 #endif /* _I915_ACTIVE_H_ */
diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
index 91198f5b0a06..a53135ee831d 100644
--- a/drivers/gpu/drm/i915/i915_globals.c
+++ b/drivers/gpu/drm/i915/i915_globals.c
@@ -7,7 +7,6 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 
-#include "i915_active.h"
 #include "i915_buddy.h"
 #include "gem/i915_gem_context.h"
 #include "gem/i915_gem_object.h"
@@ -34,7 +33,6 @@ static void __i915_globals_cleanup(void)
 }
 
 static __initconst int (* const initfn[])(void) = {
-	i915_global_active_init,
 	i915_global_buddy_init,
 	i915_global_context_init,
 	i915_global_gem_context_init,
diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
index 9e6b4fd07528..d80901ba75e3 100644
--- a/drivers/gpu/drm/i915/i915_globals.h
+++ b/drivers/gpu/drm/i915/i915_globals.h
@@ -23,7 +23,6 @@ int i915_globals_init(void);
 void i915_globals_exit(void);
 
 /* constructors */
-int i915_global_active_init(void);
 int i915_global_context_init(void);
 int i915_global_gem_context_init(void);
 int i915_global_objects_init(void);
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 0deaeeba2347..6ee77a8f43d6 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -30,6 +30,7 @@
 
 #include "display/intel_fbdev.h"
 
+#include "i915_active.h"
 #include "i915_drv.h"
 #include "i915_perf.h"
 #include "i915_globals.h"
@@ -1293,6 +1294,7 @@ static const struct {
    void (*exit)(void);
 } init_funcs[] = {
 	{ i915_check_nomodeset, NULL },
+	{ i915_active_module_init, i915_active_module_exit },
 	{ i915_globals_init, i915_globals_exit },
 	{ i915_mock_selftests, NULL },
 	{ i915_pmu_init, i915_pmu_exit },
-- 
2.32.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy slab to direct module init/exit
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 02/10] drm/i915: move i915_active slab to direct module init/exit Daniel Vetter
@ 2021-07-23 19:29 ` Daniel Vetter
  2021-07-24  7:38   ` kernel test robot
                     ` (2 more replies)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context " Daniel Vetter
                   ` (11 subsequent siblings)
  13 siblings, 3 replies; 46+ messages in thread
From: Daniel Vetter @ 2021-07-23 19:29 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

With the global kmem_cache shrink infrastructure gone there's nothing
special and we can convert them over.

I'm doing this split up into each patch because there's quite a bit of
noise with removing the static global.slab_blocks to just a
slab_blocks.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_buddy.c   | 25 ++++++++-----------------
 drivers/gpu/drm/i915/i915_buddy.h   |  3 ++-
 drivers/gpu/drm/i915/i915_globals.c |  2 --
 drivers/gpu/drm/i915/i915_pci.c     |  2 ++
 4 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_buddy.c b/drivers/gpu/drm/i915/i915_buddy.c
index caabcaea3be7..045d00c43b4c 100644
--- a/drivers/gpu/drm/i915/i915_buddy.c
+++ b/drivers/gpu/drm/i915/i915_buddy.c
@@ -8,13 +8,9 @@
 #include "i915_buddy.h"
 
 #include "i915_gem.h"
-#include "i915_globals.h"
 #include "i915_utils.h"
 
-static struct i915_global_buddy {
-	struct i915_global base;
-	struct kmem_cache *slab_blocks;
-} global;
+struct kmem_cache *slab_blocks;
 
 static struct i915_buddy_block *i915_block_alloc(struct i915_buddy_mm *mm,
 						 struct i915_buddy_block *parent,
@@ -25,7 +21,7 @@ static struct i915_buddy_block *i915_block_alloc(struct i915_buddy_mm *mm,
 
 	GEM_BUG_ON(order > I915_BUDDY_MAX_ORDER);
 
-	block = kmem_cache_zalloc(global.slab_blocks, GFP_KERNEL);
+	block = kmem_cache_zalloc(slab_blocks, GFP_KERNEL);
 	if (!block)
 		return NULL;
 
@@ -40,7 +36,7 @@ static struct i915_buddy_block *i915_block_alloc(struct i915_buddy_mm *mm,
 static void i915_block_free(struct i915_buddy_mm *mm,
 			    struct i915_buddy_block *block)
 {
-	kmem_cache_free(global.slab_blocks, block);
+	kmem_cache_free(slab_blocks, block);
 }
 
 static void mark_allocated(struct i915_buddy_block *block)
@@ -410,21 +406,16 @@ int i915_buddy_alloc_range(struct i915_buddy_mm *mm,
 #include "selftests/i915_buddy.c"
 #endif
 
-static void i915_global_buddy_exit(void)
+void i915_buddy_module_exit(void)
 {
-	kmem_cache_destroy(global.slab_blocks);
+	kmem_cache_destroy(slab_blocks);
 }
 
-static struct i915_global_buddy global = { {
-	.exit = i915_global_buddy_exit,
-} };
-
-int __init i915_global_buddy_init(void)
+int __init i915_buddy_module_init(void)
 {
-	global.slab_blocks = KMEM_CACHE(i915_buddy_block, 0);
-	if (!global.slab_blocks)
+	slab_blocks = KMEM_CACHE(i915_buddy_block, 0);
+	if (!slab_blocks)
 		return -ENOMEM;
 
-	i915_global_register(&global.base);
 	return 0;
 }
diff --git a/drivers/gpu/drm/i915/i915_buddy.h b/drivers/gpu/drm/i915/i915_buddy.h
index d8f26706de52..3940d632f208 100644
--- a/drivers/gpu/drm/i915/i915_buddy.h
+++ b/drivers/gpu/drm/i915/i915_buddy.h
@@ -129,6 +129,7 @@ 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);
+void i915_buddy_module_exit(void);
+int i915_buddy_module_init(void);
 
 #endif
diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
index a53135ee831d..3de7cf22ec76 100644
--- a/drivers/gpu/drm/i915/i915_globals.c
+++ b/drivers/gpu/drm/i915/i915_globals.c
@@ -7,7 +7,6 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 
-#include "i915_buddy.h"
 #include "gem/i915_gem_context.h"
 #include "gem/i915_gem_object.h"
 #include "i915_globals.h"
@@ -33,7 +32,6 @@ static void __i915_globals_cleanup(void)
 }
 
 static __initconst int (* const initfn[])(void) = {
-	i915_global_buddy_init,
 	i915_global_context_init,
 	i915_global_gem_context_init,
 	i915_global_objects_init,
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 6ee77a8f43d6..f9527269e30a 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -31,6 +31,7 @@
 #include "display/intel_fbdev.h"
 
 #include "i915_active.h"
+#include "i915_buddy.h"
 #include "i915_drv.h"
 #include "i915_perf.h"
 #include "i915_globals.h"
@@ -1295,6 +1296,7 @@ static const struct {
 } init_funcs[] = {
 	{ i915_check_nomodeset, NULL },
 	{ i915_active_module_init, i915_active_module_exit },
+	{ i915_buddy_module_init, i915_buddy_module_exit },
 	{ i915_globals_init, i915_globals_exit },
 	{ i915_mock_selftests, NULL },
 	{ i915_pmu_init, i915_pmu_exit },
-- 
2.32.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 02/10] drm/i915: move i915_active slab to direct module init/exit Daniel Vetter
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy " Daniel Vetter
@ 2021-07-23 19:29 ` Daniel Vetter
  2021-07-24 11:45   ` kernel test robot
                     ` (2 more replies)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context " Daniel Vetter
                   ` (10 subsequent siblings)
  13 siblings, 3 replies; 46+ messages in thread
From: Daniel Vetter @ 2021-07-23 19:29 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

With the global kmem_cache shrink infrastructure gone there's nothing
special and we can convert them over.

I'm doing this split up into each patch because there's quite a bit of
noise with removing the static global.slab_ce to just a
slab_ce.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_context.c | 25 ++++++++-----------------
 drivers/gpu/drm/i915/gt/intel_context.h |  3 +++
 drivers/gpu/drm/i915/i915_globals.c     |  2 --
 drivers/gpu/drm/i915/i915_globals.h     |  1 -
 drivers/gpu/drm/i915/i915_pci.c         |  2 ++
 5 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
index baa05fddd690..283382549a6f 100644
--- a/drivers/gpu/drm/i915/gt/intel_context.c
+++ b/drivers/gpu/drm/i915/gt/intel_context.c
@@ -7,7 +7,6 @@
 #include "gem/i915_gem_pm.h"
 
 #include "i915_drv.h"
-#include "i915_globals.h"
 #include "i915_trace.h"
 
 #include "intel_context.h"
@@ -15,14 +14,11 @@
 #include "intel_engine_pm.h"
 #include "intel_ring.h"
 
-static struct i915_global_context {
-	struct i915_global base;
-	struct kmem_cache *slab_ce;
-} global;
+struct kmem_cache *slab_ce;
 
 static struct intel_context *intel_context_alloc(void)
 {
-	return kmem_cache_zalloc(global.slab_ce, GFP_KERNEL);
+	return kmem_cache_zalloc(slab_ce, GFP_KERNEL);
 }
 
 static void rcu_context_free(struct rcu_head *rcu)
@@ -30,7 +26,7 @@ static void rcu_context_free(struct rcu_head *rcu)
 	struct intel_context *ce = container_of(rcu, typeof(*ce), rcu);
 
 	trace_intel_context_free(ce);
-	kmem_cache_free(global.slab_ce, ce);
+	kmem_cache_free(slab_ce, ce);
 }
 
 void intel_context_free(struct intel_context *ce)
@@ -410,22 +406,17 @@ void intel_context_fini(struct intel_context *ce)
 	i915_active_fini(&ce->active);
 }
 
-static void i915_global_context_exit(void)
+void i915_context_module_exit(void)
 {
-	kmem_cache_destroy(global.slab_ce);
+	kmem_cache_destroy(slab_ce);
 }
 
-static struct i915_global_context global = { {
-	.exit = i915_global_context_exit,
-} };
-
-int __init i915_global_context_init(void)
+int __init i915_context_module_init(void)
 {
-	global.slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
-	if (!global.slab_ce)
+	slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
+	if (!slab_ce)
 		return -ENOMEM;
 
-	i915_global_register(&global.base);
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/i915/gt/intel_context.h b/drivers/gpu/drm/i915/gt/intel_context.h
index 974ef85320c2..a0ca82e3c40d 100644
--- a/drivers/gpu/drm/i915/gt/intel_context.h
+++ b/drivers/gpu/drm/i915/gt/intel_context.h
@@ -30,6 +30,9 @@ void intel_context_init(struct intel_context *ce,
 			struct intel_engine_cs *engine);
 void intel_context_fini(struct intel_context *ce);
 
+void i915_context_module_exit(void);
+int i915_context_module_init(void);
+
 struct intel_context *
 intel_context_create(struct intel_engine_cs *engine);
 
diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
index 3de7cf22ec76..d36eb7dc40aa 100644
--- a/drivers/gpu/drm/i915/i915_globals.c
+++ b/drivers/gpu/drm/i915/i915_globals.c
@@ -7,7 +7,6 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 
-#include "gem/i915_gem_context.h"
 #include "gem/i915_gem_object.h"
 #include "i915_globals.h"
 #include "i915_request.h"
@@ -32,7 +31,6 @@ static void __i915_globals_cleanup(void)
 }
 
 static __initconst int (* const initfn[])(void) = {
-	i915_global_context_init,
 	i915_global_gem_context_init,
 	i915_global_objects_init,
 	i915_global_request_init,
diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
index d80901ba75e3..60daa738a188 100644
--- a/drivers/gpu/drm/i915/i915_globals.h
+++ b/drivers/gpu/drm/i915/i915_globals.h
@@ -23,7 +23,6 @@ int i915_globals_init(void);
 void i915_globals_exit(void);
 
 /* constructors */
-int i915_global_context_init(void);
 int i915_global_gem_context_init(void);
 int i915_global_objects_init(void);
 int i915_global_request_init(void);
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index f9527269e30a..266618157775 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -33,6 +33,7 @@
 #include "i915_active.h"
 #include "i915_buddy.h"
 #include "i915_drv.h"
+#include "gem/i915_gem_context.h"
 #include "i915_perf.h"
 #include "i915_globals.h"
 #include "i915_selftest.h"
@@ -1297,6 +1298,7 @@ static const struct {
 	{ i915_check_nomodeset, NULL },
 	{ i915_active_module_init, i915_active_module_exit },
 	{ i915_buddy_module_init, i915_buddy_module_exit },
+	{ i915_context_module_init, i915_context_module_exit },
 	{ i915_globals_init, i915_globals_exit },
 	{ i915_mock_selftests, NULL },
 	{ i915_pmu_init, i915_pmu_exit },
-- 
2.32.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context slab to direct module init/exit
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (2 preceding siblings ...)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context " Daniel Vetter
@ 2021-07-23 19:29 ` Daniel Vetter
  2021-07-24 14:50   ` kernel test robot
                     ` (2 more replies)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects " Daniel Vetter
                   ` (9 subsequent siblings)
  13 siblings, 3 replies; 46+ messages in thread
From: Daniel Vetter @ 2021-07-23 19:29 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

With the global kmem_cache shrink infrastructure gone there's nothing
special and we can convert them over.

I'm doing this split up into each patch because there's quite a bit of
noise with removing the static global.slab_luts to just a
slab_luts.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 25 +++++++--------------
 drivers/gpu/drm/i915/gem/i915_gem_context.h |  3 +++
 drivers/gpu/drm/i915/i915_globals.c         |  2 --
 drivers/gpu/drm/i915/i915_globals.h         |  1 -
 drivers/gpu/drm/i915/i915_pci.c             |  2 ++
 5 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index 89ca401bf9ae..c17c28af1e57 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -79,25 +79,21 @@
 #include "gt/intel_ring.h"
 
 #include "i915_gem_context.h"
-#include "i915_globals.h"
 #include "i915_trace.h"
 #include "i915_user_extensions.h"
 
 #define ALL_L3_SLICES(dev) (1 << NUM_L3_SLICES(dev)) - 1
 
-static struct i915_global_gem_context {
-	struct i915_global base;
-	struct kmem_cache *slab_luts;
-} global;
+struct kmem_cache *slab_luts;
 
 struct i915_lut_handle *i915_lut_handle_alloc(void)
 {
-	return kmem_cache_alloc(global.slab_luts, GFP_KERNEL);
+	return kmem_cache_alloc(slab_luts, GFP_KERNEL);
 }
 
 void i915_lut_handle_free(struct i915_lut_handle *lut)
 {
-	return kmem_cache_free(global.slab_luts, lut);
+	return kmem_cache_free(slab_luts, lut);
 }
 
 static void lut_close(struct i915_gem_context *ctx)
@@ -2282,21 +2278,16 @@ i915_gem_engines_iter_next(struct i915_gem_engines_iter *it)
 #include "selftests/i915_gem_context.c"
 #endif
 
-static void i915_global_gem_context_exit(void)
+void i915_gem_context_module_exit(void)
 {
-	kmem_cache_destroy(global.slab_luts);
+	kmem_cache_destroy(slab_luts);
 }
 
-static struct i915_global_gem_context global = { {
-	.exit = i915_global_gem_context_exit,
-} };
-
-int __init i915_global_gem_context_init(void)
+int __init i915_gem_context_module_init(void)
 {
-	global.slab_luts = KMEM_CACHE(i915_lut_handle, 0);
-	if (!global.slab_luts)
+	slab_luts = KMEM_CACHE(i915_lut_handle, 0);
+	if (!slab_luts)
 		return -ENOMEM;
 
-	i915_global_register(&global.base);
 	return 0;
 }
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.h b/drivers/gpu/drm/i915/gem/i915_gem_context.h
index 20411db84914..18060536b0c2 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.h
@@ -224,6 +224,9 @@ i915_gem_engines_iter_next(struct i915_gem_engines_iter *it);
 	for (i915_gem_engines_iter_init(&(it), (engines)); \
 	     ((ce) = i915_gem_engines_iter_next(&(it)));)
 
+void i915_gem_context_module_exit(void);
+int i915_gem_context_module_init(void);
+
 struct i915_lut_handle *i915_lut_handle_alloc(void);
 void i915_lut_handle_free(struct i915_lut_handle *lut);
 
diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
index d36eb7dc40aa..dbb3d81eeea7 100644
--- a/drivers/gpu/drm/i915/i915_globals.c
+++ b/drivers/gpu/drm/i915/i915_globals.c
@@ -7,7 +7,6 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 
-#include "gem/i915_gem_object.h"
 #include "i915_globals.h"
 #include "i915_request.h"
 #include "i915_scheduler.h"
@@ -31,7 +30,6 @@ static void __i915_globals_cleanup(void)
 }
 
 static __initconst int (* const initfn[])(void) = {
-	i915_global_gem_context_init,
 	i915_global_objects_init,
 	i915_global_request_init,
 	i915_global_scheduler_init,
diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
index 60daa738a188..f16752dbbdbf 100644
--- a/drivers/gpu/drm/i915/i915_globals.h
+++ b/drivers/gpu/drm/i915/i915_globals.h
@@ -23,7 +23,6 @@ int i915_globals_init(void);
 void i915_globals_exit(void);
 
 /* constructors */
-int i915_global_gem_context_init(void);
 int i915_global_objects_init(void);
 int i915_global_request_init(void);
 int i915_global_scheduler_init(void);
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 266618157775..2b56e664d043 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -34,6 +34,7 @@
 #include "i915_buddy.h"
 #include "i915_drv.h"
 #include "gem/i915_gem_context.h"
+#include "gem/i915_gem_object.h"
 #include "i915_perf.h"
 #include "i915_globals.h"
 #include "i915_selftest.h"
@@ -1299,6 +1300,7 @@ static const struct {
 	{ i915_active_module_init, i915_active_module_exit },
 	{ i915_buddy_module_init, i915_buddy_module_exit },
 	{ i915_context_module_init, i915_context_module_exit },
+	{ i915_gem_context_module_init, i915_gem_context_module_exit },
 	{ i915_globals_init, i915_globals_exit },
 	{ i915_mock_selftests, NULL },
 	{ i915_pmu_init, i915_pmu_exit },
-- 
2.32.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects slab to direct module init/exit
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (3 preceding siblings ...)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context " Daniel Vetter
@ 2021-07-23 19:29 ` Daniel Vetter
  2021-07-24 18:23   ` kernel test robot
                     ` (2 more replies)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs " Daniel Vetter
                   ` (8 subsequent siblings)
  13 siblings, 3 replies; 46+ messages in thread
From: Daniel Vetter @ 2021-07-23 19:29 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

With the global kmem_cache shrink infrastructure gone there's nothing
special and we can convert them over.

I'm doing this split up into each patch because there's quite a bit of
noise with removing the static global.slab_objects to just a
slab_objects.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 26 +++++++---------------
 drivers/gpu/drm/i915/gem/i915_gem_object.h |  3 +++
 drivers/gpu/drm/i915/i915_globals.c        |  1 -
 drivers/gpu/drm/i915/i915_globals.h        |  1 -
 drivers/gpu/drm/i915/i915_pci.c            |  1 +
 5 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
index 5c21cff33199..53156250d283 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -30,14 +30,10 @@
 #include "i915_gem_context.h"
 #include "i915_gem_mman.h"
 #include "i915_gem_object.h"
-#include "i915_globals.h"
 #include "i915_memcpy.h"
 #include "i915_trace.h"
 
-static struct i915_global_object {
-	struct i915_global base;
-	struct kmem_cache *slab_objects;
-} global;
+struct kmem_cache *slab_objects;
 
 static const struct drm_gem_object_funcs i915_gem_object_funcs;
 
@@ -45,7 +41,7 @@ struct drm_i915_gem_object *i915_gem_object_alloc(void)
 {
 	struct drm_i915_gem_object *obj;
 
-	obj = kmem_cache_zalloc(global.slab_objects, GFP_KERNEL);
+	obj = kmem_cache_zalloc(slab_objects, GFP_KERNEL);
 	if (!obj)
 		return NULL;
 	obj->base.funcs = &i915_gem_object_funcs;
@@ -55,7 +51,7 @@ struct drm_i915_gem_object *i915_gem_object_alloc(void)
 
 void i915_gem_object_free(struct drm_i915_gem_object *obj)
 {
-	return kmem_cache_free(global.slab_objects, obj);
+	return kmem_cache_free(slab_objects, obj);
 }
 
 void i915_gem_object_init(struct drm_i915_gem_object *obj,
@@ -664,23 +660,17 @@ void i915_gem_init__objects(struct drm_i915_private *i915)
 	INIT_WORK(&i915->mm.free_work, __i915_gem_free_work);
 }
 
-static void i915_global_objects_exit(void)
+void i915_objects_module_exit(void)
 {
-	kmem_cache_destroy(global.slab_objects);
+	kmem_cache_destroy(slab_objects);
 }
 
-static struct i915_global_object global = { {
-	.exit = i915_global_objects_exit,
-} };
-
-int __init i915_global_objects_init(void)
+int __init i915_objects_module_init(void)
 {
-	global.slab_objects =
-		KMEM_CACHE(drm_i915_gem_object, SLAB_HWCACHE_ALIGN);
-	if (!global.slab_objects)
+	slab_objects = KMEM_CACHE(drm_i915_gem_object, SLAB_HWCACHE_ALIGN);
+	if (!slab_objects)
 		return -ENOMEM;
 
-	i915_global_register(&global.base);
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h
index f3ede43282dc..6d8ea62a372f 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h
@@ -48,6 +48,9 @@ static inline bool i915_gem_object_size_2big(u64 size)
 
 void i915_gem_init__objects(struct drm_i915_private *i915);
 
+void i915_objects_module_exit(void);
+int i915_objects_module_init(void);
+
 struct drm_i915_gem_object *i915_gem_object_alloc(void);
 void i915_gem_object_free(struct drm_i915_gem_object *obj);
 
diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
index dbb3d81eeea7..40a592fbc3e0 100644
--- a/drivers/gpu/drm/i915/i915_globals.c
+++ b/drivers/gpu/drm/i915/i915_globals.c
@@ -30,7 +30,6 @@ static void __i915_globals_cleanup(void)
 }
 
 static __initconst int (* const initfn[])(void) = {
-	i915_global_objects_init,
 	i915_global_request_init,
 	i915_global_scheduler_init,
 	i915_global_vma_init,
diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
index f16752dbbdbf..9734740708f4 100644
--- a/drivers/gpu/drm/i915/i915_globals.h
+++ b/drivers/gpu/drm/i915/i915_globals.h
@@ -23,7 +23,6 @@ int i915_globals_init(void);
 void i915_globals_exit(void);
 
 /* constructors */
-int i915_global_objects_init(void);
 int i915_global_request_init(void);
 int i915_global_scheduler_init(void);
 int i915_global_vma_init(void);
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 2b56e664d043..2334eb3e9abb 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -1301,6 +1301,7 @@ static const struct {
 	{ i915_buddy_module_init, i915_buddy_module_exit },
 	{ i915_context_module_init, i915_context_module_exit },
 	{ i915_gem_context_module_init, i915_gem_context_module_exit },
+	{ i915_objects_module_init, i915_objects_module_exit },
 	{ i915_globals_init, i915_globals_exit },
 	{ i915_mock_selftests, NULL },
 	{ i915_pmu_init, i915_pmu_exit },
-- 
2.32.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs to direct module init/exit
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (4 preceding siblings ...)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects " Daniel Vetter
@ 2021-07-23 19:29 ` Daniel Vetter
  2021-07-24 21:58   ` kernel test robot
                     ` (2 more replies)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler " Daniel Vetter
                   ` (7 subsequent siblings)
  13 siblings, 3 replies; 46+ messages in thread
From: Daniel Vetter @ 2021-07-23 19:29 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

With the global kmem_cache shrink infrastructure gone there's nothing
special and we can convert them over.

I'm doing this split up into each patch because there's quite a bit of
noise with removing the static global.slab_requests|execute_cbs to just a
slab_requests|execute_cbs.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_globals.c |  2 --
 drivers/gpu/drm/i915/i915_pci.c     |  2 ++
 drivers/gpu/drm/i915/i915_request.c | 47 ++++++++++++-----------------
 drivers/gpu/drm/i915/i915_request.h |  3 ++
 4 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
index 40a592fbc3e0..8fffa8d93bc5 100644
--- a/drivers/gpu/drm/i915/i915_globals.c
+++ b/drivers/gpu/drm/i915/i915_globals.c
@@ -8,7 +8,6 @@
 #include <linux/workqueue.h>
 
 #include "i915_globals.h"
-#include "i915_request.h"
 #include "i915_scheduler.h"
 #include "i915_vma.h"
 
@@ -30,7 +29,6 @@ static void __i915_globals_cleanup(void)
 }
 
 static __initconst int (* const initfn[])(void) = {
-	i915_global_request_init,
 	i915_global_scheduler_init,
 	i915_global_vma_init,
 };
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 2334eb3e9abb..bb2bd12fb8c2 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -35,6 +35,7 @@
 #include "i915_drv.h"
 #include "gem/i915_gem_context.h"
 #include "gem/i915_gem_object.h"
+#include "i915_request.h"
 #include "i915_perf.h"
 #include "i915_globals.h"
 #include "i915_selftest.h"
@@ -1302,6 +1303,7 @@ static const struct {
 	{ i915_context_module_init, i915_context_module_exit },
 	{ i915_gem_context_module_init, i915_gem_context_module_exit },
 	{ i915_objects_module_init, i915_objects_module_exit },
+	{ i915_request_module_init, i915_request_module_exit },
 	{ i915_globals_init, i915_globals_exit },
 	{ i915_mock_selftests, NULL },
 	{ i915_pmu_init, i915_pmu_exit },
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 6594cb2f8ebd..69152369ea00 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -42,7 +42,6 @@
 
 #include "i915_active.h"
 #include "i915_drv.h"
-#include "i915_globals.h"
 #include "i915_trace.h"
 #include "intel_pm.h"
 
@@ -52,11 +51,8 @@ struct execute_cb {
 	struct i915_request *signal;
 };
 
-static struct i915_global_request {
-	struct i915_global base;
-	struct kmem_cache *slab_requests;
-	struct kmem_cache *slab_execute_cbs;
-} global;
+struct kmem_cache *slab_requests;
+struct kmem_cache *slab_execute_cbs;
 
 static const char *i915_fence_get_driver_name(struct dma_fence *fence)
 {
@@ -107,7 +103,7 @@ static signed long i915_fence_wait(struct dma_fence *fence,
 
 struct kmem_cache *i915_request_slab_cache(void)
 {
-	return global.slab_requests;
+	return slab_requests;
 }
 
 static void i915_fence_release(struct dma_fence *fence)
@@ -159,7 +155,7 @@ static void i915_fence_release(struct dma_fence *fence)
 	    !cmpxchg(&rq->engine->request_pool, NULL, rq))
 		return;
 
-	kmem_cache_free(global.slab_requests, rq);
+	kmem_cache_free(slab_requests, rq);
 }
 
 const struct dma_fence_ops i915_fence_ops = {
@@ -176,7 +172,7 @@ static void irq_execute_cb(struct irq_work *wrk)
 	struct execute_cb *cb = container_of(wrk, typeof(*cb), work);
 
 	i915_sw_fence_complete(cb->fence);
-	kmem_cache_free(global.slab_execute_cbs, cb);
+	kmem_cache_free(slab_execute_cbs, cb);
 }
 
 static __always_inline void
@@ -514,7 +510,7 @@ __await_execution(struct i915_request *rq,
 	if (i915_request_is_active(signal))
 		return 0;
 
-	cb = kmem_cache_alloc(global.slab_execute_cbs, gfp);
+	cb = kmem_cache_alloc(slab_execute_cbs, gfp);
 	if (!cb)
 		return -ENOMEM;
 
@@ -868,7 +864,7 @@ request_alloc_slow(struct intel_timeline *tl,
 	rq = list_first_entry(&tl->requests, typeof(*rq), link);
 	i915_request_retire(rq);
 
-	rq = kmem_cache_alloc(global.slab_requests,
+	rq = kmem_cache_alloc(slab_requests,
 			      gfp | __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
 	if (rq)
 		return rq;
@@ -881,7 +877,7 @@ request_alloc_slow(struct intel_timeline *tl,
 	retire_requests(tl);
 
 out:
-	return kmem_cache_alloc(global.slab_requests, gfp);
+	return kmem_cache_alloc(slab_requests, gfp);
 }
 
 static void __i915_request_ctor(void *arg)
@@ -942,7 +938,7 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp)
 	 *
 	 * Do not use kmem_cache_zalloc() here!
 	 */
-	rq = kmem_cache_alloc(global.slab_requests,
+	rq = kmem_cache_alloc(slab_requests,
 			      gfp | __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
 	if (unlikely(!rq)) {
 		rq = request_alloc_slow(tl, &ce->engine->request_pool, gfp);
@@ -1029,7 +1025,7 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp)
 	GEM_BUG_ON(!list_empty(&rq->sched.waiters_list));
 
 err_free:
-	kmem_cache_free(global.slab_requests, rq);
+	kmem_cache_free(slab_requests, rq);
 err_unreserve:
 	intel_context_unpin(ce);
 	return ERR_PTR(ret);
@@ -2084,19 +2080,15 @@ void i915_request_show(struct drm_printer *m,
 #include "selftests/i915_request.c"
 #endif
 
-static void i915_global_request_exit(void)
+void i915_request_module_exit(void)
 {
-	kmem_cache_destroy(global.slab_execute_cbs);
-	kmem_cache_destroy(global.slab_requests);
+	kmem_cache_destroy(slab_execute_cbs);
+	kmem_cache_destroy(slab_requests);
 }
 
-static struct i915_global_request global = { {
-	.exit = i915_global_request_exit,
-} };
-
-int __init i915_global_request_init(void)
+int __init i915_request_module_init(void)
 {
-	global.slab_requests =
+	slab_requests =
 		kmem_cache_create("i915_request",
 				  sizeof(struct i915_request),
 				  __alignof__(struct i915_request),
@@ -2104,20 +2096,19 @@ int __init i915_global_request_init(void)
 				  SLAB_RECLAIM_ACCOUNT |
 				  SLAB_TYPESAFE_BY_RCU,
 				  __i915_request_ctor);
-	if (!global.slab_requests)
+	if (!slab_requests)
 		return -ENOMEM;
 
-	global.slab_execute_cbs = KMEM_CACHE(execute_cb,
+	slab_execute_cbs = KMEM_CACHE(execute_cb,
 					     SLAB_HWCACHE_ALIGN |
 					     SLAB_RECLAIM_ACCOUNT |
 					     SLAB_TYPESAFE_BY_RCU);
-	if (!global.slab_execute_cbs)
+	if (!slab_execute_cbs)
 		goto err_requests;
 
-	i915_global_register(&global.base);
 	return 0;
 
 err_requests:
-	kmem_cache_destroy(global.slab_requests);
+	kmem_cache_destroy(slab_requests);
 	return -ENOMEM;
 }
diff --git a/drivers/gpu/drm/i915/i915_request.h b/drivers/gpu/drm/i915/i915_request.h
index 717e5b292046..a79480f07f04 100644
--- a/drivers/gpu/drm/i915/i915_request.h
+++ b/drivers/gpu/drm/i915/i915_request.h
@@ -647,4 +647,7 @@ bool
 i915_request_active_engine(struct i915_request *rq,
 			   struct intel_engine_cs **active);
 
+void i915_request_module_exit(void);
+int i915_request_module_init(void);
+
 #endif /* I915_REQUEST_H */
-- 
2.32.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler slabs to direct module init/exit
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (5 preceding siblings ...)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs " Daniel Vetter
@ 2021-07-23 19:29 ` Daniel Vetter
  2021-07-25  1:23   ` kernel test robot
                     ` (2 more replies)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab " Daniel Vetter
                   ` (6 subsequent siblings)
  13 siblings, 3 replies; 46+ messages in thread
From: Daniel Vetter @ 2021-07-23 19:29 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

With the global kmem_cache shrink infrastructure gone there's nothing
special and we can convert them over.

I'm doing this split up into each patch because there's quite a bit of
noise with removing the static global.slab_dependencies|priorities to just a
slab_dependencies|priorities.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_globals.c   |  2 --
 drivers/gpu/drm/i915/i915_globals.h   |  2 --
 drivers/gpu/drm/i915/i915_pci.c       |  2 ++
 drivers/gpu/drm/i915/i915_scheduler.c | 39 +++++++++++----------------
 drivers/gpu/drm/i915/i915_scheduler.h |  3 +++
 5 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
index 8fffa8d93bc5..8923589057ab 100644
--- a/drivers/gpu/drm/i915/i915_globals.c
+++ b/drivers/gpu/drm/i915/i915_globals.c
@@ -8,7 +8,6 @@
 #include <linux/workqueue.h>
 
 #include "i915_globals.h"
-#include "i915_scheduler.h"
 #include "i915_vma.h"
 
 static LIST_HEAD(globals);
@@ -29,7 +28,6 @@ static void __i915_globals_cleanup(void)
 }
 
 static __initconst int (* const initfn[])(void) = {
-	i915_global_scheduler_init,
 	i915_global_vma_init,
 };
 
diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
index 9734740708f4..7a57bce1da05 100644
--- a/drivers/gpu/drm/i915/i915_globals.h
+++ b/drivers/gpu/drm/i915/i915_globals.h
@@ -23,8 +23,6 @@ int i915_globals_init(void);
 void i915_globals_exit(void);
 
 /* constructors */
-int i915_global_request_init(void);
-int i915_global_scheduler_init(void);
 int i915_global_vma_init(void);
 
 #endif /* _I915_GLOBALS_H_ */
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index bb2bd12fb8c2..a44318519977 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -39,6 +39,7 @@
 #include "i915_perf.h"
 #include "i915_globals.h"
 #include "i915_selftest.h"
+#include "i915_scheduler.h"
 
 #define PLATFORM(x) .platform = (x)
 #define GEN(x) \
@@ -1304,6 +1305,7 @@ static const struct {
 	{ i915_gem_context_module_init, i915_gem_context_module_exit },
 	{ i915_objects_module_init, i915_objects_module_exit },
 	{ i915_request_module_init, i915_request_module_exit },
+	{ i915_scheduler_module_init, i915_scheduler_module_exit },
 	{ i915_globals_init, i915_globals_exit },
 	{ i915_mock_selftests, NULL },
 	{ i915_pmu_init, i915_pmu_exit },
diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c
index 561c649e59f7..02d90d239ff5 100644
--- a/drivers/gpu/drm/i915/i915_scheduler.c
+++ b/drivers/gpu/drm/i915/i915_scheduler.c
@@ -7,15 +7,11 @@
 #include <linux/mutex.h>
 
 #include "i915_drv.h"
-#include "i915_globals.h"
 #include "i915_request.h"
 #include "i915_scheduler.h"
 
-static struct i915_global_scheduler {
-	struct i915_global base;
-	struct kmem_cache *slab_dependencies;
-	struct kmem_cache *slab_priorities;
-} global;
+struct kmem_cache *slab_dependencies;
+struct kmem_cache *slab_priorities;
 
 static DEFINE_SPINLOCK(schedule_lock);
 
@@ -93,7 +89,7 @@ i915_sched_lookup_priolist(struct i915_sched_engine *sched_engine, int prio)
 	if (prio == I915_PRIORITY_NORMAL) {
 		p = &sched_engine->default_priolist;
 	} else {
-		p = kmem_cache_alloc(global.slab_priorities, GFP_ATOMIC);
+		p = kmem_cache_alloc(slab_priorities, GFP_ATOMIC);
 		/* Convert an allocation failure to a priority bump */
 		if (unlikely(!p)) {
 			prio = I915_PRIORITY_NORMAL; /* recurses just once */
@@ -122,7 +118,7 @@ i915_sched_lookup_priolist(struct i915_sched_engine *sched_engine, int prio)
 
 void __i915_priolist_free(struct i915_priolist *p)
 {
-	kmem_cache_free(global.slab_priorities, p);
+	kmem_cache_free(slab_priorities, p);
 }
 
 struct sched_cache {
@@ -313,13 +309,13 @@ void i915_sched_node_reinit(struct i915_sched_node *node)
 static struct i915_dependency *
 i915_dependency_alloc(void)
 {
-	return kmem_cache_alloc(global.slab_dependencies, GFP_KERNEL);
+	return kmem_cache_alloc(slab_dependencies, GFP_KERNEL);
 }
 
 static void
 i915_dependency_free(struct i915_dependency *dep)
 {
-	kmem_cache_free(global.slab_dependencies, dep);
+	kmem_cache_free(slab_dependencies, dep);
 }
 
 bool __i915_sched_node_add_dependency(struct i915_sched_node *node,
@@ -475,32 +471,27 @@ i915_sched_engine_create(unsigned int subclass)
 	return sched_engine;
 }
 
-static void i915_global_scheduler_exit(void)
+void i915_scheduler_module_exit(void)
 {
-	kmem_cache_destroy(global.slab_dependencies);
-	kmem_cache_destroy(global.slab_priorities);
+	kmem_cache_destroy(slab_dependencies);
+	kmem_cache_destroy(slab_priorities);
 }
 
-static struct i915_global_scheduler global = { {
-	.exit = i915_global_scheduler_exit,
-} };
-
-int __init i915_global_scheduler_init(void)
+int __init i915_scheduler_module_init(void)
 {
-	global.slab_dependencies = KMEM_CACHE(i915_dependency,
+	slab_dependencies = KMEM_CACHE(i915_dependency,
 					      SLAB_HWCACHE_ALIGN |
 					      SLAB_TYPESAFE_BY_RCU);
-	if (!global.slab_dependencies)
+	if (!slab_dependencies)
 		return -ENOMEM;
 
-	global.slab_priorities = KMEM_CACHE(i915_priolist, 0);
-	if (!global.slab_priorities)
+	slab_priorities = KMEM_CACHE(i915_priolist, 0);
+	if (!slab_priorities)
 		goto err_priorities;
 
-	i915_global_register(&global.base);
 	return 0;
 
 err_priorities:
-	kmem_cache_destroy(global.slab_priorities);
+	kmem_cache_destroy(slab_priorities);
 	return -ENOMEM;
 }
diff --git a/drivers/gpu/drm/i915/i915_scheduler.h b/drivers/gpu/drm/i915/i915_scheduler.h
index 650ab8e0db9f..0a4f61fd0be0 100644
--- a/drivers/gpu/drm/i915/i915_scheduler.h
+++ b/drivers/gpu/drm/i915/i915_scheduler.h
@@ -98,4 +98,7 @@ void i915_request_show_with_schedule(struct drm_printer *m,
 				     const char *prefix,
 				     int indent);
 
+void i915_scheduler_module_exit(void);
+int i915_scheduler_module_init(void);
+
 #endif /* _I915_SCHEDULER_H_ */
-- 
2.32.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab to direct module init/exit
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (6 preceding siblings ...)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler " Daniel Vetter
@ 2021-07-23 19:29 ` Daniel Vetter
  2021-07-25  4:04   ` kernel test robot
                     ` (2 more replies)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 10/10] drm/i915: Remove i915_globals Daniel Vetter
                   ` (5 subsequent siblings)
  13 siblings, 3 replies; 46+ messages in thread
From: Daniel Vetter @ 2021-07-23 19:29 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

With the global kmem_cache shrink infrastructure gone there's nothing
special and we can convert them over.

I'm doing this split up into each patch because there's quite a bit of
noise with removing the static global.slab_vmas to just a
slab_vmas.

We have to keep i915_drv.h include in i915_globals otherwise there's
nothing anymore that pulls in GEM_BUG_ON.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_globals.c |  3 +--
 drivers/gpu/drm/i915/i915_globals.h |  3 ---
 drivers/gpu/drm/i915/i915_pci.c     |  2 ++
 drivers/gpu/drm/i915/i915_vma.c     | 25 ++++++++-----------------
 drivers/gpu/drm/i915/i915_vma.h     |  3 +++
 5 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
index 8923589057ab..04979789e7be 100644
--- a/drivers/gpu/drm/i915/i915_globals.c
+++ b/drivers/gpu/drm/i915/i915_globals.c
@@ -8,7 +8,7 @@
 #include <linux/workqueue.h>
 
 #include "i915_globals.h"
-#include "i915_vma.h"
+#include "i915_drv.h"
 
 static LIST_HEAD(globals);
 
@@ -28,7 +28,6 @@ static void __i915_globals_cleanup(void)
 }
 
 static __initconst int (* const initfn[])(void) = {
-	i915_global_vma_init,
 };
 
 int __init i915_globals_init(void)
diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
index 7a57bce1da05..57d2998bba45 100644
--- a/drivers/gpu/drm/i915/i915_globals.h
+++ b/drivers/gpu/drm/i915/i915_globals.h
@@ -22,7 +22,4 @@ void i915_global_register(struct i915_global *global);
 int i915_globals_init(void);
 void i915_globals_exit(void);
 
-/* constructors */
-int i915_global_vma_init(void);
-
 #endif /* _I915_GLOBALS_H_ */
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index a44318519977..0affcf33a211 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -40,6 +40,7 @@
 #include "i915_globals.h"
 #include "i915_selftest.h"
 #include "i915_scheduler.h"
+#include "i915_vma.h"
 
 #define PLATFORM(x) .platform = (x)
 #define GEN(x) \
@@ -1306,6 +1307,7 @@ static const struct {
 	{ i915_objects_module_init, i915_objects_module_exit },
 	{ i915_request_module_init, i915_request_module_exit },
 	{ i915_scheduler_module_init, i915_scheduler_module_exit },
+	{ i915_vma_module_init, i915_vma_module_exit },
 	{ i915_globals_init, i915_globals_exit },
 	{ i915_mock_selftests, NULL },
 	{ i915_pmu_init, i915_pmu_exit },
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 09a7c47926f7..d094e2016b93 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -34,24 +34,20 @@
 #include "gt/intel_gt_requests.h"
 
 #include "i915_drv.h"
-#include "i915_globals.h"
 #include "i915_sw_fence_work.h"
 #include "i915_trace.h"
 #include "i915_vma.h"
 
-static struct i915_global_vma {
-	struct i915_global base;
-	struct kmem_cache *slab_vmas;
-} global;
+struct kmem_cache *slab_vmas;
 
 struct i915_vma *i915_vma_alloc(void)
 {
-	return kmem_cache_zalloc(global.slab_vmas, GFP_KERNEL);
+	return kmem_cache_zalloc(slab_vmas, GFP_KERNEL);
 }
 
 void i915_vma_free(struct i915_vma *vma)
 {
-	return kmem_cache_free(global.slab_vmas, vma);
+	return kmem_cache_free(slab_vmas, vma);
 }
 
 #if IS_ENABLED(CONFIG_DRM_I915_ERRLOG_GEM) && IS_ENABLED(CONFIG_DRM_DEBUG_MM)
@@ -1414,21 +1410,16 @@ void i915_vma_make_purgeable(struct i915_vma *vma)
 #include "selftests/i915_vma.c"
 #endif
 
-static void i915_global_vma_exit(void)
+void i915_vma_module_exit(void)
 {
-	kmem_cache_destroy(global.slab_vmas);
+	kmem_cache_destroy(slab_vmas);
 }
 
-static struct i915_global_vma global = { {
-	.exit = i915_global_vma_exit,
-} };
-
-int __init i915_global_vma_init(void)
+int __init i915_vma_module_init(void)
 {
-	global.slab_vmas = KMEM_CACHE(i915_vma, SLAB_HWCACHE_ALIGN);
-	if (!global.slab_vmas)
+	slab_vmas = KMEM_CACHE(i915_vma, SLAB_HWCACHE_ALIGN);
+	if (!slab_vmas)
 		return -ENOMEM;
 
-	i915_global_register(&global.base);
 	return 0;
 }
diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
index eca452a9851f..ed69f66c7ab0 100644
--- a/drivers/gpu/drm/i915/i915_vma.h
+++ b/drivers/gpu/drm/i915/i915_vma.h
@@ -426,4 +426,7 @@ static inline int i915_vma_sync(struct i915_vma *vma)
 	return i915_active_wait(&vma->active);
 }
 
+void i915_vma_module_exit(void);
+int i915_vma_module_init(void);
+
 #endif
-- 
2.32.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [PATCH 10/10] drm/i915: Remove i915_globals
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (7 preceding siblings ...)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab " Daniel Vetter
@ 2021-07-23 19:29 ` Daniel Vetter
  2021-07-26 15:51   ` Jason Ekstrand
  2021-07-23 21:55 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first Patchwork
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 46+ messages in thread
From: Daniel Vetter @ 2021-07-23 19:29 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

No longer used.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/Makefile         |  1 -
 drivers/gpu/drm/i915/gt/intel_gt_pm.c |  1 -
 drivers/gpu/drm/i915/i915_globals.c   | 53 ---------------------------
 drivers/gpu/drm/i915/i915_globals.h   | 25 -------------
 drivers/gpu/drm/i915/i915_pci.c       |  2 -
 5 files changed, 82 deletions(-)
 delete mode 100644 drivers/gpu/drm/i915/i915_globals.c
 delete mode 100644 drivers/gpu/drm/i915/i915_globals.h

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 10b3bb6207ba..9022dc638ed6 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -166,7 +166,6 @@ i915-y += \
 	  i915_gem_gtt.o \
 	  i915_gem_ww.o \
 	  i915_gem.o \
-	  i915_globals.o \
 	  i915_query.o \
 	  i915_request.o \
 	  i915_scheduler.o \
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index d86825437516..943c1d416ec0 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -6,7 +6,6 @@
 #include <linux/suspend.h>
 
 #include "i915_drv.h"
-#include "i915_globals.h"
 #include "i915_params.h"
 #include "intel_context.h"
 #include "intel_engine_pm.h"
diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
deleted file mode 100644
index 04979789e7be..000000000000
--- a/drivers/gpu/drm/i915/i915_globals.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright © 2019 Intel Corporation
- */
-
-#include <linux/slab.h>
-#include <linux/workqueue.h>
-
-#include "i915_globals.h"
-#include "i915_drv.h"
-
-static LIST_HEAD(globals);
-
-void __init i915_global_register(struct i915_global *global)
-{
-	GEM_BUG_ON(!global->exit);
-
-	list_add_tail(&global->link, &globals);
-}
-
-static void __i915_globals_cleanup(void)
-{
-	struct i915_global *global, *next;
-
-	list_for_each_entry_safe_reverse(global, next, &globals, link)
-		global->exit();
-}
-
-static __initconst int (* const initfn[])(void) = {
-};
-
-int __init i915_globals_init(void)
-{
-	int i;
-
-	for (i = 0; i < ARRAY_SIZE(initfn); i++) {
-		int err;
-
-		err = initfn[i]();
-		if (err) {
-			__i915_globals_cleanup();
-			return err;
-		}
-	}
-
-	return 0;
-}
-
-void i915_globals_exit(void)
-{
-	__i915_globals_cleanup();
-}
diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
deleted file mode 100644
index 57d2998bba45..000000000000
--- a/drivers/gpu/drm/i915/i915_globals.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright © 2019 Intel Corporation
- */
-
-#ifndef _I915_GLOBALS_H_
-#define _I915_GLOBALS_H_
-
-#include <linux/types.h>
-
-typedef void (*i915_global_func_t)(void);
-
-struct i915_global {
-	struct list_head link;
-
-	i915_global_func_t exit;
-};
-
-void i915_global_register(struct i915_global *global);
-
-int i915_globals_init(void);
-void i915_globals_exit(void);
-
-#endif /* _I915_GLOBALS_H_ */
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 0affcf33a211..ed72bcb58331 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -37,7 +37,6 @@
 #include "gem/i915_gem_object.h"
 #include "i915_request.h"
 #include "i915_perf.h"
-#include "i915_globals.h"
 #include "i915_selftest.h"
 #include "i915_scheduler.h"
 #include "i915_vma.h"
@@ -1308,7 +1307,6 @@ static const struct {
 	{ i915_request_module_init, i915_request_module_exit },
 	{ i915_scheduler_module_init, i915_scheduler_module_exit },
 	{ i915_vma_module_init, i915_vma_module_exit },
-	{ i915_globals_init, i915_globals_exit },
 	{ i915_mock_selftests, NULL },
 	{ i915_pmu_init, i915_pmu_exit },
 	{ i915_register_pci_driver, i915_unregister_pci_driver },
-- 
2.32.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (8 preceding siblings ...)
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 10/10] drm/i915: Remove i915_globals Daniel Vetter
@ 2021-07-23 21:55 ` Patchwork
  2021-07-23 21:56 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 46+ messages in thread
From: Patchwork @ 2021-07-23 21:55 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first
URL   : https://patchwork.freedesktop.org/series/92963/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
51abed9a1d96 drm/i915: Check for nomodeset in i915_init() first
-:31: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <daniel.vetter@ffwll.ch>' != 'Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>'

total: 0 errors, 1 warnings, 0 checks, 10 lines checked
c95745397a80 drm/i915: move i915_active slab to direct module init/exit
-:174: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <daniel.vetter@ffwll.ch>' != 'Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>'

total: 0 errors, 1 warnings, 0 checks, 126 lines checked
837cb156bbe5 drm/i915: move i915_buddy slab to direct module init/exit
-:132: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <daniel.vetter@ffwll.ch>' != 'Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>'

total: 0 errors, 1 warnings, 0 checks, 92 lines checked
4e8510c6d2e3 drm/i915: move intel_context slab to direct module init/exit
-:147: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <daniel.vetter@ffwll.ch>' != 'Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>'

total: 0 errors, 1 warnings, 0 checks, 102 lines checked
dff81a2d27c3 drm/i915: move gem_context slab to direct module init/exit
-:81: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 0)
#81: FILE: drivers/gpu/drm/i915/gem/i915_gem_context.h:224:
 	for (i915_gem_engines_iter_init(&(it), (engines)); \
[...]
+void i915_gem_context_module_exit(void);

-:141: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <daniel.vetter@ffwll.ch>' != 'Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>'

total: 0 errors, 2 warnings, 0 checks, 98 lines checked
e4cdb6d07d58 drm/i915: move gem_objects slab to direct module init/exit
-:132: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <daniel.vetter@ffwll.ch>' != 'Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>'

total: 0 errors, 1 warnings, 0 checks, 89 lines checked
ca5731fa0004 drm/i915: move request slabs to direct module init/exit
-:189: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#189: FILE: drivers/gpu/drm/i915/i915_request.c:2103:
+	slab_execute_cbs = KMEM_CACHE(execute_cb,
 					     SLAB_HWCACHE_ALIGN |

-:215: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <daniel.vetter@ffwll.ch>' != 'Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>'

total: 0 errors, 1 warnings, 1 checks, 167 lines checked
802d94da6e2f drm/i915: move scheduler slabs to direct module init/exit
-:10: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#10: 
noise with removing the static global.slab_dependencies|priorities to just a

-:147: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#147: FILE: drivers/gpu/drm/i915/i915_scheduler.c:483:
+	slab_dependencies = KMEM_CACHE(i915_dependency,
 					      SLAB_HWCACHE_ALIGN |

-:178: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <daniel.vetter@ffwll.ch>' != 'Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>'

total: 0 errors, 2 warnings, 1 checks, 132 lines checked
1a305f249f67 drm/i915: move vma slab to direct module init/exit
-:142: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <daniel.vetter@ffwll.ch>' != 'Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>'

total: 0 errors, 1 warnings, 0 checks, 96 lines checked
b9f5c891a63d drm/i915: Remove i915_globals
-:36: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#36: 
deleted file mode 100644

-:144: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Daniel Vetter <daniel.vetter@ffwll.ch>' != 'Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>'

total: 0 errors, 2 warnings, 0 checks, 28 lines checked


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (9 preceding siblings ...)
  2021-07-23 21:55 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first Patchwork
@ 2021-07-23 21:56 ` Patchwork
  2021-07-23 22:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 46+ messages in thread
From: Patchwork @ 2021-07-23 21:56 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first
URL   : https://patchwork.freedesktop.org/series/92963/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
+drivers/gpu/drm/i915/display/intel_display.c:1896:21:    expected struct i915_vma *[assigned] vma
+drivers/gpu/drm/i915/display/intel_display.c:1896:21:    got void [noderef] __iomem *[assigned] iomem
+drivers/gpu/drm/i915/display/intel_display.c:1896:21: warning: incorrect type in assignment (different address spaces)
+drivers/gpu/drm/i915/gem/i915_gem_context.c:87:19: warning: symbol 'slab_luts' was not declared. Should it be static?
+drivers/gpu/drm/i915/gem/i915_gem_object.c:36:19: warning: symbol 'slab_objects' was not declared. Should it be static?
+drivers/gpu/drm/i915/gt/intel_context.c:17:19: warning: symbol 'slab_ce' was not declared. Should it be static?
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:27:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:27:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:27:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:32:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:32:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:49:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:49:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:49:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:56:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_engine_stats.h:56:9: warning: trying to copy expression type 31
+drivers/gpu/drm/i915/gt/intel_reset.c:1396:5: warning: context imbalance in 'intel_gt_reset_trylock' - different lock contexts for basic block
+drivers/gpu/drm/i915/gt/intel_ring_submission.c:1210:24: warning: Using plain integer as NULL pointer
+drivers/gpu/drm/i915/i915_active.c:24:19: warning: symbol 'slab_cache' was not declared. Should it be static?
+drivers/gpu/drm/i915/i915_buddy.c:13:19: warning: symbol 'slab_blocks' was not declared. Should it be static?
+drivers/gpu/drm/i915/i915_perf.c:1443:15: warning: memset with byte count of 16777216
+drivers/gpu/drm/i915/i915_perf.c:1497:15: warning: memset with byte count of 16777216
+drivers/gpu/drm/i915/i915_request.c:54:19: warning: symbol 'slab_requests' was not declared. Should it be static?
+drivers/gpu/drm/i915/i915_request.c:55:19: warning: symbol 'slab_execute_cbs' was not declared. Should it be static?
+drivers/gpu/drm/i915/i915_scheduler.c:13:19: warning: symbol 'slab_dependencies' was not declared. Should it be static?
+drivers/gpu/drm/i915/i915_scheduler.c:14:19: warning: symbol 'slab_priorities' was not declared. Should it be static?
+drivers/gpu/drm/i915/i915_vma.c:41:19: warning: symbol 'slab_vmas' was not declared. Should it be static?
+./include/asm-generic/bitops/find.h:112:45: warning: shift count is negative (-262080)
+./include/asm-generic/bitops/find.h:32:31: warning: shift count is negative (-262080)
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read64' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_read8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'fwtable_write8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read64' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_read8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen11_fwtable_write8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read64' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_read8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen12_fwtable_write8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read64' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_read8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen6_write8' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write16' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write32' - different lock contexts for basic block
+./include/linux/spinlock.h:409:9: warning: context imbalance in 'gen8_write8' - different lock contexts for basic block
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+./include/linux/stddef.h:17:9: this was the original definition
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined
+/usr/lib/gcc/x86_64-linux-gnu/8/include/stddef.h:417:9: warning: preprocessor token offsetof redefined


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (10 preceding siblings ...)
  2021-07-23 21:56 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
@ 2021-07-23 22:29 ` Patchwork
  2021-07-24  9:00 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
  2021-07-26 15:23 ` [Intel-gfx] [PATCH 01/10] " Jason Ekstrand
  13 siblings, 0 replies; 46+ messages in thread
From: Patchwork @ 2021-07-23 22:29 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 3686 bytes --]

== Series Details ==

Series: series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first
URL   : https://patchwork.freedesktop.org/series/92963/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10382 -> Patchwork_20699
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/index.html

Known issues
------------

  Here are the changes found in Patchwork_20699 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s3:
    - fi-tgl-1115g4:      [PASS][1] -> [FAIL][2] ([i915#1888])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s3.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s3.html

  * igt@i915_selftest@live@hangcheck:
    - fi-tgl-u2:          [PASS][3] -> [INCOMPLETE][4] ([i915#750])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/fi-tgl-u2/igt@i915_selftest@live@hangcheck.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/fi-tgl-u2/igt@i915_selftest@live@hangcheck.html

  * igt@runner@aborted:
    - fi-tgl-u2:          NOTRUN -> [FAIL][5] ([i915#1436] / [i915#2966])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/fi-tgl-u2/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@i915_selftest@live@hangcheck:
    - {fi-hsw-gt1}:       [DMESG-WARN][6] ([i915#3303]) -> [PASS][7]
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/fi-hsw-gt1/igt@i915_selftest@live@hangcheck.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/fi-hsw-gt1/igt@i915_selftest@live@hangcheck.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#2966]: https://gitlab.freedesktop.org/drm/intel/issues/2966
  [i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
  [i915#750]: https://gitlab.freedesktop.org/drm/intel/issues/750


Participating hosts (43 -> 36)
------------------------------

  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan bat-adls-4 fi-ctg-p8600 bat-adls-3 fi-bdw-samus 


Build changes
-------------

  * Linux: CI_DRM_10382 -> Patchwork_20699

  CI-20190529: 20190529
  CI_DRM_10382: 03db07ede8eeeae5fa12cb07684084e531db377b @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_6149: 34ff2cf2bc352dce691593db803389fe0eb2be03 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_20699: b9f5c891a63d767f6b0848ab7b81a9d37beac6d1 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

b9f5c891a63d drm/i915: Remove i915_globals
1a305f249f67 drm/i915: move vma slab to direct module init/exit
802d94da6e2f drm/i915: move scheduler slabs to direct module init/exit
ca5731fa0004 drm/i915: move request slabs to direct module init/exit
e4cdb6d07d58 drm/i915: move gem_objects slab to direct module init/exit
dff81a2d27c3 drm/i915: move gem_context slab to direct module init/exit
4e8510c6d2e3 drm/i915: move intel_context slab to direct module init/exit
837cb156bbe5 drm/i915: move i915_buddy slab to direct module init/exit
c95745397a80 drm/i915: move i915_active slab to direct module init/exit
51abed9a1d96 drm/i915: Check for nomodeset in i915_init() first

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/index.html

[-- Attachment #1.2: Type: text/html, Size: 4432 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy " Daniel Vetter
@ 2021-07-24  7:38   ` kernel test robot
  2021-07-24  7:38   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_blocks can be static kernel test robot
  2021-07-26 15:26   ` [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy slab to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-24  7:38 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1790 bytes --]

Hi Daniel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm/drm-next v5.14-rc2 next-20210723]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/8f4fee59edb0b93bec857359db320e589133e593
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
        git checkout 8f4fee59edb0b93bec857359db320e589133e593
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/i915_buddy.c:13:19: sparse: sparse: symbol 'slab_blocks' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42204 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [RFC PATCH] drm/i915: slab_blocks can be static
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy " Daniel Vetter
  2021-07-24  7:38   ` kernel test robot
@ 2021-07-24  7:38   ` kernel test robot
  2021-07-26 15:26   ` [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy slab to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-24  7:38 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

drivers/gpu/drm/i915/i915_buddy.c:13:19: warning: symbol 'slab_blocks' was not declared. Should it be static?

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 i915_buddy.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_buddy.c b/drivers/gpu/drm/i915/i915_buddy.c
index 045d00c43b4ca..7b274c51cac05 100644
--- a/drivers/gpu/drm/i915/i915_buddy.c
+++ b/drivers/gpu/drm/i915/i915_buddy.c
@@ -10,7 +10,7 @@
 #include "i915_gem.h"
 #include "i915_utils.h"
 
-struct kmem_cache *slab_blocks;
+static struct kmem_cache *slab_blocks;
 
 static struct i915_buddy_block *i915_block_alloc(struct i915_buddy_mm *mm,
 						 struct i915_buddy_block *parent,
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (11 preceding siblings ...)
  2021-07-23 22:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
@ 2021-07-24  9:00 ` Patchwork
  2021-07-26 15:23 ` [Intel-gfx] [PATCH 01/10] " Jason Ekstrand
  13 siblings, 0 replies; 46+ messages in thread
From: Patchwork @ 2021-07-24  9:00 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 30302 bytes --]

== Series Details ==

Series: series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first
URL   : https://patchwork.freedesktop.org/series/92963/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10382_full -> Patchwork_20699_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_20699_full:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@gem_exec_fair@basic-pace@vcs0:
    - {shard-rkl}:        [FAIL][1] ([i915#2842]) -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-2/igt@gem_exec_fair@basic-pace@vcs0.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-5/igt@gem_exec_fair@basic-pace@vcs0.html

  * igt@kms_psr@suspend:
    - {shard-rkl}:        [SKIP][3] ([i915#1072]) -> [DMESG-WARN][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-2/igt@kms_psr@suspend.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_psr@suspend.html

  
Known issues
------------

  Here are the changes found in Patchwork_20699_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_create@create-massive:
    - shard-apl:          NOTRUN -> [DMESG-WARN][5] ([i915#3002])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl3/igt@gem_create@create-massive.html

  * igt@gem_ctx_isolation@preservation-s3@bcs0:
    - shard-skl:          [PASS][6] -> [INCOMPLETE][7] ([i915#198] / [i915#2910])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl4/igt@gem_ctx_isolation@preservation-s3@bcs0.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl7/igt@gem_ctx_isolation@preservation-s3@bcs0.html

  * igt@gem_ctx_persistence@process:
    - shard-snb:          NOTRUN -> [SKIP][8] ([fdo#109271] / [i915#1099]) +2 similar issues
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-snb5/igt@gem_ctx_persistence@process.html

  * igt@gem_eio@in-flight-contexts-10ms:
    - shard-tglb:         [PASS][9] -> [TIMEOUT][10] ([i915#3063])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-tglb2/igt@gem_eio@in-flight-contexts-10ms.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-tglb7/igt@gem_eio@in-flight-contexts-10ms.html

  * igt@gem_exec_fair@basic-deadline:
    - shard-glk:          [PASS][11] -> [FAIL][12] ([i915#2846])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-glk6/igt@gem_exec_fair@basic-deadline.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-glk3/igt@gem_exec_fair@basic-deadline.html
    - shard-apl:          NOTRUN -> [FAIL][13] ([i915#2846])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl1/igt@gem_exec_fair@basic-deadline.html

  * igt@gem_exec_fair@basic-none@vcs0:
    - shard-kbl:          [PASS][14] -> [FAIL][15] ([i915#2842])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl6/igt@gem_exec_fair@basic-none@vcs0.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl2/igt@gem_exec_fair@basic-none@vcs0.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-glk:          [PASS][16] -> [FAIL][17] ([i915#2842])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-glk4/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-glk8/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_exec_fair@basic-pace@rcs0:
    - shard-kbl:          NOTRUN -> [FAIL][18] ([i915#2842]) +2 similar issues
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl3/igt@gem_exec_fair@basic-pace@rcs0.html

  * igt@gem_exec_fair@basic-pace@vcs0:
    - shard-iclb:         [PASS][19] -> [FAIL][20] ([i915#2842])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-iclb6/igt@gem_exec_fair@basic-pace@vcs0.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb5/igt@gem_exec_fair@basic-pace@vcs0.html

  * igt@gem_exec_flush@basic-batch-kernel-default-cmd:
    - shard-snb:          NOTRUN -> [SKIP][21] ([fdo#109271]) +224 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-snb6/igt@gem_exec_flush@basic-batch-kernel-default-cmd.html

  * igt@gem_exec_suspend@basic-s3:
    - shard-skl:          [PASS][22] -> [INCOMPLETE][23] ([i915#198])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl4/igt@gem_exec_suspend@basic-s3.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl3/igt@gem_exec_suspend@basic-s3.html

  * igt@gem_huc_copy@huc-copy:
    - shard-tglb:         [PASS][24] -> [SKIP][25] ([i915#2190])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-tglb2/igt@gem_huc_copy@huc-copy.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-tglb6/igt@gem_huc_copy@huc-copy.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-glk:          [PASS][26] -> [FAIL][27] ([i915#644])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-glk6/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-glk5/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-glk:          [PASS][28] -> [DMESG-WARN][29] ([i915#1436] / [i915#716])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-glk9/igt@gen9_exec_parse@allowed-all.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-glk2/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_dc@dc9-dpms:
    - shard-apl:          NOTRUN -> [FAIL][30] ([i915#3343])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl1/igt@i915_pm_dc@dc9-dpms.html

  * igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-hflip:
    - shard-apl:          NOTRUN -> [SKIP][31] ([fdo#109271] / [i915#3777])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl3/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-hflip.html
    - shard-skl:          NOTRUN -> [SKIP][32] ([fdo#109271] / [i915#3777])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl4/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-hflip.html

  * igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-0:
    - shard-apl:          NOTRUN -> [SKIP][33] ([fdo#109271]) +153 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl3/igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-0.html

  * igt@kms_ccs@pipe-c-bad-pixel-format-y_tiled_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][34] ([i915#3689])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-tglb5/igt@kms_ccs@pipe-c-bad-pixel-format-y_tiled_ccs.html

  * igt@kms_chamelium@hdmi-edid-change-during-suspend:
    - shard-apl:          NOTRUN -> [SKIP][35] ([fdo#109271] / [fdo#111827]) +14 similar issues
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl3/igt@kms_chamelium@hdmi-edid-change-during-suspend.html

  * igt@kms_color_chamelium@pipe-a-ctm-0-75:
    - shard-kbl:          NOTRUN -> [SKIP][36] ([fdo#109271] / [fdo#111827]) +2 similar issues
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl3/igt@kms_color_chamelium@pipe-a-ctm-0-75.html

  * igt@kms_color_chamelium@pipe-c-ctm-green-to-red:
    - shard-snb:          NOTRUN -> [SKIP][37] ([fdo#109271] / [fdo#111827]) +9 similar issues
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-snb5/igt@kms_color_chamelium@pipe-c-ctm-green-to-red.html

  * igt@kms_color_chamelium@pipe-invalid-degamma-lut-sizes:
    - shard-skl:          NOTRUN -> [SKIP][38] ([fdo#109271] / [fdo#111827]) +3 similar issues
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl4/igt@kms_color_chamelium@pipe-invalid-degamma-lut-sizes.html

  * igt@kms_flip@flip-vs-suspend-interruptible@a-edp1:
    - shard-skl:          [PASS][39] -> [INCOMPLETE][40] ([i915#146] / [i915#198])
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl7/igt@kms_flip@flip-vs-suspend-interruptible@a-edp1.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl5/igt@kms_flip@flip-vs-suspend-interruptible@a-edp1.html

  * igt@kms_flip@flip-vs-suspend@c-dp1:
    - shard-apl:          [PASS][41] -> [DMESG-WARN][42] ([i915#180]) +1 similar issue
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-apl8/igt@kms_flip@flip-vs-suspend@c-dp1.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl8/igt@kms_flip@flip-vs-suspend@c-dp1.html

  * igt@kms_flip@plain-flip-ts-check@b-edp1:
    - shard-skl:          [PASS][43] -> [FAIL][44] ([i915#2122])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl6/igt@kms_flip@plain-flip-ts-check@b-edp1.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl7/igt@kms_flip@plain-flip-ts-check@b-edp1.html

  * igt@kms_frontbuffer_tracking@fbc-1p-shrfb-fliptrack-mmap-gtt:
    - shard-skl:          NOTRUN -> [SKIP][45] ([fdo#109271]) +46 similar issues
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl4/igt@kms_frontbuffer_tracking@fbc-1p-shrfb-fliptrack-mmap-gtt.html

  * igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-blt:
    - shard-skl:          [PASS][46] -> [DMESG-WARN][47] ([i915#1982]) +1 similar issue
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl3/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-blt.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl2/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-blt.html

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-shrfb-draw-mmap-cpu:
    - shard-kbl:          NOTRUN -> [SKIP][48] ([fdo#109271]) +30 similar issues
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl3/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-shrfb-draw-mmap-cpu.html

  * igt@kms_hdr@bpc-switch-dpms:
    - shard-skl:          [PASS][49] -> [FAIL][50] ([i915#1188])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl1/igt@kms_hdr@bpc-switch-dpms.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl8/igt@kms_hdr@bpc-switch-dpms.html

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-d:
    - shard-apl:          NOTRUN -> [SKIP][51] ([fdo#109271] / [i915#533])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl3/igt@kms_pipe_crc_basic@hang-read-crc-pipe-d.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
    - shard-kbl:          [PASS][52] -> [DMESG-WARN][53] ([i915#180])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl2/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl6/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-basic:
    - shard-apl:          NOTRUN -> [FAIL][54] ([fdo#108145] / [i915#265]) +1 similar issue
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl1/igt@kms_plane_alpha_blend@pipe-a-alpha-basic.html

  * igt@kms_plane_alpha_blend@pipe-b-alpha-transparent-fb:
    - shard-apl:          NOTRUN -> [FAIL][55] ([i915#265])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl3/igt@kms_plane_alpha_blend@pipe-b-alpha-transparent-fb.html

  * igt@kms_plane_alpha_blend@pipe-c-coverage-vs-premult-vs-constant:
    - shard-iclb:         [PASS][56] -> [SKIP][57] ([fdo#109278])
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-iclb1/igt@kms_plane_alpha_blend@pipe-c-coverage-vs-premult-vs-constant.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb2/igt@kms_plane_alpha_blend@pipe-c-coverage-vs-premult-vs-constant.html

  * igt@kms_plane_lowres@pipe-b-tiling-yf:
    - shard-iclb:         NOTRUN -> [SKIP][58] ([i915#3536])
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb4/igt@kms_plane_lowres@pipe-b-tiling-yf.html

  * igt@kms_psr2_sf@plane-move-sf-dmg-area-2:
    - shard-apl:          NOTRUN -> [SKIP][59] ([fdo#109271] / [i915#658]) +2 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl3/igt@kms_psr2_sf@plane-move-sf-dmg-area-2.html

  * igt@kms_psr@psr2_primary_page_flip:
    - shard-iclb:         [PASS][60] -> [SKIP][61] ([fdo#109441]) +3 similar issues
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb6/igt@kms_psr@psr2_primary_page_flip.html

  * igt@kms_writeback@writeback-pixel-formats:
    - shard-apl:          NOTRUN -> [SKIP][62] ([fdo#109271] / [i915#2437])
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl3/igt@kms_writeback@writeback-pixel-formats.html

  
#### Possible fixes ####

  * igt@gem_eio@unwedge-stress:
    - shard-tglb:         [TIMEOUT][63] ([i915#2369] / [i915#3063] / [i915#3648]) -> [PASS][64]
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-tglb7/igt@gem_eio@unwedge-stress.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-tglb7/igt@gem_eio@unwedge-stress.html
    - {shard-rkl}:        [TIMEOUT][65] ([i915#3063]) -> [PASS][66]
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-5/igt@gem_eio@unwedge-stress.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-1/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_fair@basic-none@vecs0:
    - shard-kbl:          [FAIL][67] ([i915#2842]) -> [PASS][68]
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl6/igt@gem_exec_fair@basic-none@vecs0.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl2/igt@gem_exec_fair@basic-none@vecs0.html

  * igt@gem_exec_fair@basic-pace-solo@rcs0:
    - shard-glk:          [FAIL][69] ([i915#2842]) -> [PASS][70] +1 similar issue
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-glk2/igt@gem_exec_fair@basic-pace-solo@rcs0.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-glk4/igt@gem_exec_fair@basic-pace-solo@rcs0.html

  * igt@gem_exec_fair@basic-pace@rcs0:
    - {shard-rkl}:        [FAIL][71] ([i915#2842]) -> [PASS][72]
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-2/igt@gem_exec_fair@basic-pace@rcs0.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-5/igt@gem_exec_fair@basic-pace@rcs0.html

  * igt@gem_exec_fair@basic-pace@vecs0:
    - shard-tglb:         [FAIL][73] ([i915#2842]) -> [PASS][74]
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-tglb2/igt@gem_exec_fair@basic-pace@vecs0.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-tglb6/igt@gem_exec_fair@basic-pace@vecs0.html

  * igt@gem_exec_schedule@u-independent@vecs0:
    - shard-tglb:         [FAIL][75] ([i915#3795]) -> [PASS][76]
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-tglb3/igt@gem_exec_schedule@u-independent@vecs0.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-tglb1/igt@gem_exec_schedule@u-independent@vecs0.html

  * igt@gem_mmap_gtt@cpuset-big-copy-odd:
    - shard-iclb:         [FAIL][77] ([i915#307]) -> [PASS][78]
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-iclb4/igt@gem_mmap_gtt@cpuset-big-copy-odd.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb8/igt@gem_mmap_gtt@cpuset-big-copy-odd.html

  * igt@i915_pm_backlight@bad-brightness:
    - {shard-rkl}:        [SKIP][79] ([i915#3012]) -> [PASS][80]
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-1/igt@i915_pm_backlight@bad-brightness.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@i915_pm_backlight@bad-brightness.html

  * igt@kms_big_fb@x-tiled-8bpp-rotate-0:
    - {shard-rkl}:        [SKIP][81] ([i915#3638]) -> [PASS][82] +5 similar issues
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-1/igt@kms_big_fb@x-tiled-8bpp-rotate-0.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_big_fb@x-tiled-8bpp-rotate-0.html

  * igt@kms_big_fb@y-tiled-16bpp-rotate-90:
    - {shard-rkl}:        [SKIP][83] ([fdo#111614]) -> [PASS][84]
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-1/igt@kms_big_fb@y-tiled-16bpp-rotate-90.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_big_fb@y-tiled-16bpp-rotate-90.html

  * igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-0-async-flip:
    - {shard-rkl}:        [SKIP][85] ([i915#3721]) -> [PASS][86] +4 similar issues
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-2/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-0-async-flip.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-0-async-flip.html

  * igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc:
    - {shard-rkl}:        [FAIL][87] ([i915#3678]) -> [PASS][88] +7 similar issues
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-5/igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_color@pipe-b-ctm-0-75:
    - {shard-rkl}:        [SKIP][89] ([i915#1149] / [i915#1849]) -> [PASS][90] +4 similar issues
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-1/igt@kms_color@pipe-b-ctm-0-75.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_color@pipe-b-ctm-0-75.html

  * igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen:
    - {shard-rkl}:        [SKIP][91] ([fdo#112022]) -> [PASS][92] +16 similar issues
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-5/igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen.html

  * igt@kms_cursor_crc@pipe-b-cursor-suspend:
    - shard-apl:          [DMESG-WARN][93] ([i915#180]) -> [PASS][94]
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-apl1/igt@kms_cursor_crc@pipe-b-cursor-suspend.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-apl3/igt@kms_cursor_crc@pipe-b-cursor-suspend.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - {shard-rkl}:        [SKIP][95] ([fdo#111825]) -> [PASS][96] +2 similar issues
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
    - shard-skl:          [FAIL][97] ([i915#2346] / [i915#533]) -> [PASS][98]
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl1/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

  * igt@kms_draw_crc@draw-method-xrgb8888-mmap-cpu-untiled:
    - {shard-rkl}:        [SKIP][99] ([fdo#111314]) -> [PASS][100] +10 similar issues
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-2/igt@kms_draw_crc@draw-method-xrgb8888-mmap-cpu-untiled.html
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_draw_crc@draw-method-xrgb8888-mmap-cpu-untiled.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a1:
    - shard-glk:          [FAIL][101] ([i915#79]) -> [PASS][102]
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-glk6/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a1.html
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-glk8/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a1.html

  * igt@kms_flip@flip-vs-expired-vblank@a-edp1:
    - shard-skl:          [FAIL][103] ([i915#2122]) -> [PASS][104] +2 similar issues
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl7/igt@kms_flip@flip-vs-expired-vblank@a-edp1.html
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl5/igt@kms_flip@flip-vs-expired-vblank@a-edp1.html

  * igt@kms_flip@flip-vs-suspend-interruptible@a-dp1:
    - shard-kbl:          [DMESG-WARN][105] ([i915#180]) -> [PASS][106] +4 similar issues
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl6/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl2/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html

  * igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-pwrite:
    - {shard-rkl}:        [SKIP][107] ([i915#1849] / [i915#3180]) -> [PASS][108]
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-2/igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-pwrite.html
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-pwrite.html

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-mmap-wc:
    - {shard-rkl}:        [SKIP][109] ([i915#1849]) -> [PASS][110] +44 similar issues
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-1/igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-mmap-wc.html
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-mmap-wc.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
    - shard-skl:          [DMESG-WARN][111] ([i915#1982]) -> [PASS][112]
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl5/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl6/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          [FAIL][113] ([fdo#108145] / [i915#265]) -> [PASS][114] +1 similar issue
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl3/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl4/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-none:
    - {shard-rkl}:        [SKIP][115] ([i915#1849] / [i915#3558]) -> [PASS][116] +1 similar issue
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-5/igt@kms_plane_multiple@atomic-pipe-a-tiling-none.html
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_plane_multiple@atomic-pipe-a-tiling-none.html

  * igt@kms_plane_multiple@atomic-pipe-c-tiling-y:
    - {shard-rkl}:        [SKIP][117] ([i915#3558]) -> [PASS][118] +1 similar issue
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-1/igt@kms_plane_multiple@atomic-pipe-c-tiling-y.html
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_plane_multiple@atomic-pipe-c-tiling-y.html

  * igt@kms_psr@psr2_basic:
    - shard-iclb:         [SKIP][119] ([fdo#109441]) -> [PASS][120] +1 similar issue
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-iclb1/igt@kms_psr@psr2_basic.html
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb2/igt@kms_psr@psr2_basic.html

  * igt@kms_psr@sprite_mmap_cpu:
    - {shard-rkl}:        [SKIP][121] ([i915#1072]) -> [PASS][122] +1 similar issue
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-1/igt@kms_psr@sprite_mmap_cpu.html
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_psr@sprite_mmap_cpu.html

  * igt@kms_vblank@pipe-c-wait-busy:
    - {shard-rkl}:        [SKIP][123] ([i915#1845]) -> [PASS][124] +19 similar issues
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-5/igt@kms_vblank@pipe-c-wait-busy.html
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-6/igt@kms_vblank@pipe-c-wait-busy.html

  * igt@perf@polling:
    - shard-skl:          [FAIL][125] ([i915#1542]) -> [PASS][126]
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-skl1/igt@perf@polling.html
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-skl8/igt@perf@polling.html

  * igt@perf@polling-parameterized:
    - shard-glk:          [FAIL][127] ([i915#1542]) -> [PASS][128]
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-glk6/igt@perf@polling-parameterized.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-glk8/igt@perf@polling-parameterized.html
    - shard-tglb:         [FAIL][129] ([i915#1542]) -> [PASS][130]
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-tglb1/igt@perf@polling-parameterized.html
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-tglb7/igt@perf@polling-parameterized.html

  * igt@sysfs_timeslice_duration@timeout@vcs0:
    - {shard-rkl}:        [FAIL][131] ([i915#1755]) -> [PASS][132]
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-rkl-2/igt@sysfs_timeslice_duration@timeout@vcs0.html
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-rkl-5/igt@sysfs_timeslice_duration@timeout@vcs0.html

  
#### Warnings ####

  * igt@gem_exec_fair@basic-none-rrul@rcs0:
    - shard-iclb:         [FAIL][133] ([i915#2852]) -> [FAIL][134] ([i915#2842])
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-iclb7/igt@gem_exec_fair@basic-none-rrul@rcs0.html
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb5/igt@gem_exec_fair@basic-none-rrul@rcs0.html

  * igt@gem_exec_fair@basic-throttle@rcs0:
    - shard-iclb:         [FAIL][135] ([i915#2842]) -> [FAIL][136] ([i915#2849])
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-iclb1/igt@gem_exec_fair@basic-throttle@rcs0.html
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb2/igt@gem_exec_fair@basic-throttle@rcs0.html

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-iclb:         [WARN][137] ([i915#2684]) -> [WARN][138] ([i915#1804] / [i915#2684])
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-iclb1/igt@i915_pm_rc6_residency@rc6-idle.html
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb7/igt@i915_pm_rc6_residency@rc6-idle.html

  * igt@kms_flip@flip-vs-suspend@a-dp1:
    - shard-kbl:          [DMESG-WARN][139] ([i915#180]) -> [INCOMPLETE][140] ([i915#155])
   [139]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl7/igt@kms_flip@flip-vs-suspend@a-dp1.html
   [140]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl4/igt@kms_flip@flip-vs-suspend@a-dp1.html

  * igt@kms_psr2_sf@plane-move-sf-dmg-area-0:
    - shard-iclb:         [SKIP][141] ([i915#658]) -> [SKIP][142] ([i915#2920])
   [141]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-iclb8/igt@kms_psr2_sf@plane-move-sf-dmg-area-0.html
   [142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb2/igt@kms_psr2_sf@plane-move-sf-dmg-area-0.html

  * igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-4:
    - shard-iclb:         [SKIP][143] ([i915#2920]) -> [SKIP][144] ([i915#658]) +2 similar issues
   [143]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-iclb2/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-4.html
   [144]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-iclb4/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-4.html

  * igt@runner@aborted:
    - shard-kbl:          ([FAIL][145], [FAIL][146], [FAIL][147], [FAIL][148], [FAIL][149], [FAIL][150]) ([fdo#109271] / [i915#180] / [i915#1814] / [i915#2505] / [i915#3002] / [i915#3363]) -> ([FAIL][151], [FAIL][152], [FAIL][153]) ([i915#1814] / [i915#2505] / [i915#3002] / [i915#3363])
   [145]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl4/igt@runner@aborted.html
   [146]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl7/igt@runner@aborted.html
   [147]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl4/igt@runner@aborted.html
   [148]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl7/igt@runner@aborted.html
   [149]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl6/igt@runner@aborted.html
   [150]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10382/shard-kbl7/igt@runner@aborted.html
   [151]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl6/igt@runner@aborted.html
   [152]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl4/igt@runner@aborted.html
   [153]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/shard-kbl4/igt@runner@aborted.html
    - shard-apl:          ([FAIL][154], [FAIL][155], [FAIL][156], [FAIL][157]) ([i915#180] / [i915#1814] / [i915#3

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_20699/index.html

[-- Attachment #1.2: Type: text/html, Size: 33693 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context " Daniel Vetter
@ 2021-07-24 11:45   ` kernel test robot
  2021-07-24 11:45   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_ce can be static kernel test robot
  2021-07-26  8:35   ` [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit Tvrtko Ursulin
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-24 11:45 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1792 bytes --]

Hi Daniel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm/drm-next v5.14-rc2 next-20210723]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/acd1c2f5060c5b06036bf6d0950141ee55906a24
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
        git checkout acd1c2f5060c5b06036bf6d0950141ee55906a24
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/gt/intel_context.c:17:19: sparse: sparse: symbol 'slab_ce' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42204 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [RFC PATCH] drm/i915: slab_ce can be static
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context " Daniel Vetter
  2021-07-24 11:45   ` kernel test robot
@ 2021-07-24 11:45   ` kernel test robot
  2021-07-26  8:35   ` [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit Tvrtko Ursulin
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-24 11:45 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

drivers/gpu/drm/i915/gt/intel_context.c:17:19: warning: symbol 'slab_ce' was not declared. Should it be static?

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 intel_context.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
index 283382549a6fb..0ba49d74f94d6 100644
--- a/drivers/gpu/drm/i915/gt/intel_context.c
+++ b/drivers/gpu/drm/i915/gt/intel_context.c
@@ -14,7 +14,7 @@
 #include "intel_engine_pm.h"
 #include "intel_ring.h"
 
-struct kmem_cache *slab_ce;
+static struct kmem_cache *slab_ce;
 
 static struct intel_context *intel_context_alloc(void)
 {
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context " Daniel Vetter
@ 2021-07-24 14:50   ` kernel test robot
  2021-07-24 14:50   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_luts can be static kernel test robot
  2021-07-26 15:35   ` [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context slab to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-24 14:50 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2257 bytes --]

Hi Daniel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm/drm-next v5.14-rc2 next-20210723]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/908260e3a7bb4c66c931ccff79cb8bbb8ab37991
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
        git checkout 908260e3a7bb4c66c931ccff79cb8bbb8ab37991
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/gem/i915_gem_context.c:87:19: sparse: sparse: symbol 'slab_luts' was not declared. Should it be static?
   drivers/gpu/drm/i915/gem/i915_gem_context.c:1409:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct i915_address_space *vm @@     got struct i915_address_space [noderef] __rcu *vm @@
   drivers/gpu/drm/i915/gem/i915_gem_context.c:1409:34: sparse:     expected struct i915_address_space *vm
   drivers/gpu/drm/i915/gem/i915_gem_context.c:1409:34: sparse:     got struct i915_address_space [noderef] __rcu *vm

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42204 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [RFC PATCH] drm/i915: slab_luts can be static
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context " Daniel Vetter
  2021-07-24 14:50   ` kernel test robot
@ 2021-07-24 14:50   ` kernel test robot
  2021-07-26 15:35   ` [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context slab to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-24 14:50 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

drivers/gpu/drm/i915/gem/i915_gem_context.c:87:19: warning: symbol 'slab_luts' was not declared. Should it be static?

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 i915_gem_context.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index c17c28af1e574..087e1ede6c43f 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -84,7 +84,7 @@
 
 #define ALL_L3_SLICES(dev) (1 << NUM_L3_SLICES(dev)) - 1
 
-struct kmem_cache *slab_luts;
+static struct kmem_cache *slab_luts;
 
 struct i915_lut_handle *i915_lut_handle_alloc(void)
 {
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects " Daniel Vetter
@ 2021-07-24 18:23   ` kernel test robot
  2021-07-24 18:23   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_objects can be static kernel test robot
  2021-07-26 15:39   ` [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects slab to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-24 18:23 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1800 bytes --]

Hi Daniel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm/drm-next v5.14-rc2 next-20210723]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/a14cc3293cf74596589c91fad72eea444eeab358
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
        git checkout a14cc3293cf74596589c91fad72eea444eeab358
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/gem/i915_gem_object.c:36:19: sparse: sparse: symbol 'slab_objects' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42204 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [RFC PATCH] drm/i915: slab_objects can be static
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects " Daniel Vetter
  2021-07-24 18:23   ` kernel test robot
@ 2021-07-24 18:23   ` kernel test robot
  2021-07-26 15:39   ` [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects slab to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-24 18:23 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

drivers/gpu/drm/i915/gem/i915_gem_object.c:36:19: warning: symbol 'slab_objects' was not declared. Should it be static?

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 i915_gem_object.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
index 53156250d2833..48f136230396e 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -33,7 +33,7 @@
 #include "i915_memcpy.h"
 #include "i915_trace.h"
 
-struct kmem_cache *slab_objects;
+static struct kmem_cache *slab_objects;
 
 static const struct drm_gem_object_funcs i915_gem_object_funcs;
 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs " Daniel Vetter
@ 2021-07-24 21:58   ` kernel test robot
  2021-07-24 21:58   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_requests can be static kernel test robot
  2021-07-26 15:46   ` [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-24 21:58 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]

Hi Daniel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm/drm-next v5.14-rc2 next-20210723]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/a69d195b61c2b3627be8f97cc89f2d53a7e76781
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
        git checkout a69d195b61c2b3627be8f97cc89f2d53a7e76781
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/i915_request.c:54:19: sparse: sparse: symbol 'slab_requests' was not declared. Should it be static?
>> drivers/gpu/drm/i915/i915_request.c:55:19: sparse: sparse: symbol 'slab_execute_cbs' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42204 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [RFC PATCH] drm/i915: slab_requests can be static
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs " Daniel Vetter
  2021-07-24 21:58   ` kernel test robot
@ 2021-07-24 21:58   ` kernel test robot
  2021-07-26 15:46   ` [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-24 21:58 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

drivers/gpu/drm/i915/i915_request.c:54:19: warning: symbol 'slab_requests' was not declared. Should it be static?
drivers/gpu/drm/i915/i915_request.c:55:19: warning: symbol 'slab_execute_cbs' was not declared. Should it be static?

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 i915_request.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 69152369ea000..3dd759be3c289 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -51,8 +51,8 @@ struct execute_cb {
 	struct i915_request *signal;
 };
 
-struct kmem_cache *slab_requests;
-struct kmem_cache *slab_execute_cbs;
+static struct kmem_cache *slab_requests;
+static struct kmem_cache *slab_execute_cbs;
 
 static const char *i915_fence_get_driver_name(struct dma_fence *fence)
 {
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler slabs to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler " Daniel Vetter
@ 2021-07-25  1:23   ` kernel test robot
  2021-07-25  1:23   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_dependencies can be static kernel test robot
  2021-07-26 15:47   ` [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler slabs to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-25  1:23 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1928 bytes --]

Hi Daniel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm/drm-next v5.14-rc2 next-20210723]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/9b454028bf04e00926ff73a5ceaa3330cbda131f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
        git checkout 9b454028bf04e00926ff73a5ceaa3330cbda131f
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/i915/i915_scheduler.c:13:19: sparse: sparse: symbol 'slab_dependencies' was not declared. Should it be static?
>> drivers/gpu/drm/i915/i915_scheduler.c:14:19: sparse: sparse: symbol 'slab_priorities' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42204 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [RFC PATCH] drm/i915: slab_dependencies can be static
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler " Daniel Vetter
  2021-07-25  1:23   ` kernel test robot
@ 2021-07-25  1:23   ` kernel test robot
  2021-07-26 15:47   ` [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler slabs to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-25  1:23 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

drivers/gpu/drm/i915/i915_scheduler.c:13:19: warning: symbol 'slab_dependencies' was not declared. Should it be static?
drivers/gpu/drm/i915/i915_scheduler.c:14:19: warning: symbol 'slab_priorities' was not declared. Should it be static?

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 i915_scheduler.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c
index 02d90d239ff5c..c7ea5a1f3b940 100644
--- a/drivers/gpu/drm/i915/i915_scheduler.c
+++ b/drivers/gpu/drm/i915/i915_scheduler.c
@@ -10,8 +10,8 @@
 #include "i915_request.h"
 #include "i915_scheduler.h"
 
-struct kmem_cache *slab_dependencies;
-struct kmem_cache *slab_priorities;
+static struct kmem_cache *slab_dependencies;
+static struct kmem_cache *slab_priorities;
 
 static DEFINE_SPINLOCK(schedule_lock);
 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab " Daniel Vetter
@ 2021-07-25  4:04   ` kernel test robot
  2021-07-25  4:04   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_vmas can be static kernel test robot
  2021-07-26 15:50   ` [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-25  4:04 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2246 bytes --]

Hi Daniel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm/drm-next v5.14-rc2 next-20210723]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/6bd67050323c50bb6ed64538ed5d57aa4948b9f0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Vetter/drm-i915-Check-for-nomodeset-in-i915_init-first/20210724-033145
        git checkout 6bd67050323c50bb6ed64538ed5d57aa4948b9f0
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   drivers/gpu/drm/i915/i915_vma.c: note: in included file (through drivers/gpu/drm/i915/gt/intel_gt_requests.h):
   /usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:406:9: sparse: sparse: preprocessor token offsetof redefined
   drivers/gpu/drm/i915/i915_vma.c: note: in included file (through include/uapi/linux/posix_types.h, include/uapi/linux/types.h, include/linux/types.h, ...):
   include/linux/stddef.h:17:9: sparse: this was the original definition
>> drivers/gpu/drm/i915/i915_vma.c:41:19: sparse: sparse: symbol 'slab_vmas' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42204 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* [Intel-gfx] [RFC PATCH] drm/i915: slab_vmas can be static
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab " Daniel Vetter
  2021-07-25  4:04   ` kernel test robot
@ 2021-07-25  4:04   ` kernel test robot
  2021-07-26 15:50   ` [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab to direct module init/exit Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: kernel test robot @ 2021-07-25  4:04 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, kbuild-all

drivers/gpu/drm/i915/i915_vma.c:41:19: warning: symbol 'slab_vmas' was not declared. Should it be static?

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 i915_vma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index d094e2016b938..4b7fc4647e460 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -38,7 +38,7 @@
 #include "i915_trace.h"
 #include "i915_vma.h"
 
-struct kmem_cache *slab_vmas;
+static struct kmem_cache *slab_vmas;
 
 struct i915_vma *i915_vma_alloc(void)
 {
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context " Daniel Vetter
  2021-07-24 11:45   ` kernel test robot
  2021-07-24 11:45   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_ce can be static kernel test robot
@ 2021-07-26  8:35   ` Tvrtko Ursulin
  2021-07-26 15:30     ` Jason Ekstrand
  2 siblings, 1 reply; 46+ messages in thread
From: Tvrtko Ursulin @ 2021-07-26  8:35 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development; +Cc: Daniel Vetter, Intel Graphics Development


On 23/07/2021 20:29, Daniel Vetter wrote:
> With the global kmem_cache shrink infrastructure gone there's nothing
> special and we can convert them over.
> 
> I'm doing this split up into each patch because there's quite a bit of
> noise with removing the static global.slab_ce to just a
> slab_ce.
> 
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>   drivers/gpu/drm/i915/gt/intel_context.c | 25 ++++++++-----------------
>   drivers/gpu/drm/i915/gt/intel_context.h |  3 +++
>   drivers/gpu/drm/i915/i915_globals.c     |  2 --
>   drivers/gpu/drm/i915/i915_globals.h     |  1 -
>   drivers/gpu/drm/i915/i915_pci.c         |  2 ++
>   5 files changed, 13 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
> index baa05fddd690..283382549a6f 100644
> --- a/drivers/gpu/drm/i915/gt/intel_context.c
> +++ b/drivers/gpu/drm/i915/gt/intel_context.c
> @@ -7,7 +7,6 @@
>   #include "gem/i915_gem_pm.h"
>   
>   #include "i915_drv.h"
> -#include "i915_globals.h"
>   #include "i915_trace.h"
>   
>   #include "intel_context.h"
> @@ -15,14 +14,11 @@
>   #include "intel_engine_pm.h"
>   #include "intel_ring.h"
>   
> -static struct i915_global_context {
> -	struct i915_global base;
> -	struct kmem_cache *slab_ce;
> -} global;
> +struct kmem_cache *slab_ce;
>   
>   static struct intel_context *intel_context_alloc(void)
>   {
> -	return kmem_cache_zalloc(global.slab_ce, GFP_KERNEL);
> +	return kmem_cache_zalloc(slab_ce, GFP_KERNEL);
>   }
>   
>   static void rcu_context_free(struct rcu_head *rcu)
> @@ -30,7 +26,7 @@ static void rcu_context_free(struct rcu_head *rcu)
>   	struct intel_context *ce = container_of(rcu, typeof(*ce), rcu);
>   
>   	trace_intel_context_free(ce);
> -	kmem_cache_free(global.slab_ce, ce);
> +	kmem_cache_free(slab_ce, ce);
>   }
>   
>   void intel_context_free(struct intel_context *ce)
> @@ -410,22 +406,17 @@ void intel_context_fini(struct intel_context *ce)
>   	i915_active_fini(&ce->active);
>   }
>   
> -static void i915_global_context_exit(void)
> +void i915_context_module_exit(void)
>   {
> -	kmem_cache_destroy(global.slab_ce);
> +	kmem_cache_destroy(slab_ce);
>   }
>   
> -static struct i915_global_context global = { {
> -	.exit = i915_global_context_exit,
> -} };
> -
> -int __init i915_global_context_init(void)
> +int __init i915_context_module_init(void)
>   {
> -	global.slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
> -	if (!global.slab_ce)
> +	slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
> +	if (!slab_ce)
>   		return -ENOMEM;
>   
> -	i915_global_register(&global.base);
>   	return 0;
>   }
>   
> diff --git a/drivers/gpu/drm/i915/gt/intel_context.h b/drivers/gpu/drm/i915/gt/intel_context.h
> index 974ef85320c2..a0ca82e3c40d 100644
> --- a/drivers/gpu/drm/i915/gt/intel_context.h
> +++ b/drivers/gpu/drm/i915/gt/intel_context.h
> @@ -30,6 +30,9 @@ void intel_context_init(struct intel_context *ce,
>   			struct intel_engine_cs *engine);
>   void intel_context_fini(struct intel_context *ce);
>   
> +void i915_context_module_exit(void);
> +int i915_context_module_init(void);
> +
>   struct intel_context *
>   intel_context_create(struct intel_engine_cs *engine);
>   
> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> index 3de7cf22ec76..d36eb7dc40aa 100644
> --- a/drivers/gpu/drm/i915/i915_globals.c
> +++ b/drivers/gpu/drm/i915/i915_globals.c
> @@ -7,7 +7,6 @@
>   #include <linux/slab.h>
>   #include <linux/workqueue.h>
>   
> -#include "gem/i915_gem_context.h"
>   #include "gem/i915_gem_object.h"
>   #include "i915_globals.h"
>   #include "i915_request.h"
> @@ -32,7 +31,6 @@ static void __i915_globals_cleanup(void)
>   }
>   
>   static __initconst int (* const initfn[])(void) = {
> -	i915_global_context_init,
>   	i915_global_gem_context_init,
>   	i915_global_objects_init,
>   	i915_global_request_init,
> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> index d80901ba75e3..60daa738a188 100644
> --- a/drivers/gpu/drm/i915/i915_globals.h
> +++ b/drivers/gpu/drm/i915/i915_globals.h
> @@ -23,7 +23,6 @@ int i915_globals_init(void);
>   void i915_globals_exit(void);
>   
>   /* constructors */
> -int i915_global_context_init(void);
>   int i915_global_gem_context_init(void);
>   int i915_global_objects_init(void);
>   int i915_global_request_init(void);
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index f9527269e30a..266618157775 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -33,6 +33,7 @@
>   #include "i915_active.h"
>   #include "i915_buddy.h"
>   #include "i915_drv.h"
> +#include "gem/i915_gem_context.h"

It's a bit ugly to go to a design where i915_pci.c has to include so 
many random parts of i915. IMO for a complex driver like i915, 
compartmentalizing so much knowledge about the internals was better 
inside the globals layer.

Maybe add a cover letter to explain the perceived pros and cons and 
thinking in general?

Regards,

Tvrtko

>   #include "i915_perf.h"
>   #include "i915_globals.h"
>   #include "i915_selftest.h"
> @@ -1297,6 +1298,7 @@ static const struct {
>   	{ i915_check_nomodeset, NULL },
>   	{ i915_active_module_init, i915_active_module_exit },
>   	{ i915_buddy_module_init, i915_buddy_module_exit },
> +	{ i915_context_module_init, i915_context_module_exit },
>   	{ i915_globals_init, i915_globals_exit },
>   	{ i915_mock_selftests, NULL },
>   	{ i915_pmu_init, i915_pmu_exit },
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first
  2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
                   ` (12 preceding siblings ...)
  2021-07-24  9:00 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
@ 2021-07-26 15:23 ` Jason Ekstrand
  13 siblings, 0 replies; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:23 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Fri, Jul 23, 2021 at 2:29 PM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> When modesetting (aka the full pci driver, which has nothing to do
> with disable_display option, which just gives you the full pci driver
> without the display driver) is disabled, we load nothing and do
> nothing.
>
> So move that check first, for a bit of orderliness. With Jason's
> module init/exit table this now becomes trivial.
>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

> ---
>  drivers/gpu/drm/i915/i915_pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 48ea23dd3b5b..0deaeeba2347 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -1292,9 +1292,9 @@ static const struct {
>     int (*init)(void);
>     void (*exit)(void);
>  } init_funcs[] = {
> +       { i915_check_nomodeset, NULL },
>         { i915_globals_init, i915_globals_exit },
>         { i915_mock_selftests, NULL },
> -       { i915_check_nomodeset, NULL },
>         { i915_pmu_init, i915_pmu_exit },
>         { i915_register_pci_driver, i915_unregister_pci_driver },
>         { i915_perf_sysctl_register, i915_perf_sysctl_unregister },
> --
> 2.32.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 02/10] drm/i915: move i915_active slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 02/10] drm/i915: move i915_active slab to direct module init/exit Daniel Vetter
@ 2021-07-26 15:24   ` Jason Ekstrand
  0 siblings, 0 replies; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:24 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Fri, Jul 23, 2021 at 2:29 PM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> With the global kmem_cache shrink infrastructure gone there's nothing
> special and we can convert them over.
>
> I'm doing this split up into each patch because there's quite a bit of
> noise with removing the static global.slab_cache to just a slab_cache.
>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_active.c  | 31 ++++++++++-------------------
>  drivers/gpu/drm/i915/i915_active.h  |  3 +++
>  drivers/gpu/drm/i915/i915_globals.c |  2 --
>  drivers/gpu/drm/i915/i915_globals.h |  1 -
>  drivers/gpu/drm/i915/i915_pci.c     |  2 ++
>  5 files changed, 16 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c
> index 91723123ae9f..9ffeb77eb5bb 100644
> --- a/drivers/gpu/drm/i915/i915_active.c
> +++ b/drivers/gpu/drm/i915/i915_active.c
> @@ -13,7 +13,6 @@
>
>  #include "i915_drv.h"
>  #include "i915_active.h"
> -#include "i915_globals.h"
>
>  /*
>   * Active refs memory management
> @@ -22,10 +21,7 @@
>   * they idle (when we know the active requests are inactive) and allocate the
>   * nodes from a local slab cache to hopefully reduce the fragmentation.
>   */
> -static struct i915_global_active {
> -       struct i915_global base;
> -       struct kmem_cache *slab_cache;
> -} global;
> +struct kmem_cache *slab_cache;

static?  Or were you planning to expose it somehow?  With that fixed,

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

>
>  struct active_node {
>         struct rb_node node;
> @@ -174,7 +170,7 @@ __active_retire(struct i915_active *ref)
>         /* Finally free the discarded timeline tree  */
>         rbtree_postorder_for_each_entry_safe(it, n, &root, node) {
>                 GEM_BUG_ON(i915_active_fence_isset(&it->base));
> -               kmem_cache_free(global.slab_cache, it);
> +               kmem_cache_free(slab_cache, it);
>         }
>  }
>
> @@ -322,7 +318,7 @@ active_instance(struct i915_active *ref, u64 idx)
>          * XXX: We should preallocate this before i915_active_ref() is ever
>          *  called, but we cannot call into fs_reclaim() anyway, so use GFP_ATOMIC.
>          */
> -       node = kmem_cache_alloc(global.slab_cache, GFP_ATOMIC);
> +       node = kmem_cache_alloc(slab_cache, GFP_ATOMIC);
>         if (!node)
>                 goto out;
>
> @@ -788,7 +784,7 @@ void i915_active_fini(struct i915_active *ref)
>         mutex_destroy(&ref->mutex);
>
>         if (ref->cache)
> -               kmem_cache_free(global.slab_cache, ref->cache);
> +               kmem_cache_free(slab_cache, ref->cache);
>  }
>
>  static inline bool is_idle_barrier(struct active_node *node, u64 idx)
> @@ -908,7 +904,7 @@ int i915_active_acquire_preallocate_barrier(struct i915_active *ref,
>                 node = reuse_idle_barrier(ref, idx);
>                 rcu_read_unlock();
>                 if (!node) {
> -                       node = kmem_cache_alloc(global.slab_cache, GFP_KERNEL);
> +                       node = kmem_cache_alloc(slab_cache, GFP_KERNEL);
>                         if (!node)
>                                 goto unwind;
>
> @@ -956,7 +952,7 @@ int i915_active_acquire_preallocate_barrier(struct i915_active *ref,
>                 atomic_dec(&ref->count);
>                 intel_engine_pm_put(barrier_to_engine(node));
>
> -               kmem_cache_free(global.slab_cache, node);
> +               kmem_cache_free(slab_cache, node);
>         }
>         return -ENOMEM;
>  }
> @@ -1176,21 +1172,16 @@ struct i915_active *i915_active_create(void)
>  #include "selftests/i915_active.c"
>  #endif
>
> -static void i915_global_active_exit(void)
> +void i915_active_module_exit(void)
>  {
> -       kmem_cache_destroy(global.slab_cache);
> +       kmem_cache_destroy(slab_cache);
>  }
>
> -static struct i915_global_active global = { {
> -       .exit = i915_global_active_exit,
> -} };
> -
> -int __init i915_global_active_init(void)
> +int __init i915_active_module_init(void)
>  {
> -       global.slab_cache = KMEM_CACHE(active_node, SLAB_HWCACHE_ALIGN);
> -       if (!global.slab_cache)
> +       slab_cache = KMEM_CACHE(active_node, SLAB_HWCACHE_ALIGN);
> +       if (!slab_cache)
>                 return -ENOMEM;
>
> -       i915_global_register(&global.base);
>         return 0;
>  }
> diff --git a/drivers/gpu/drm/i915/i915_active.h b/drivers/gpu/drm/i915/i915_active.h
> index d0feda68b874..5fcdb0e2bc9e 100644
> --- a/drivers/gpu/drm/i915/i915_active.h
> +++ b/drivers/gpu/drm/i915/i915_active.h
> @@ -247,4 +247,7 @@ static inline int __i915_request_await_exclusive(struct i915_request *rq,
>         return err;
>  }
>
> +void i915_active_module_exit(void);
> +int i915_active_module_init(void);
> +
>  #endif /* _I915_ACTIVE_H_ */
> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> index 91198f5b0a06..a53135ee831d 100644
> --- a/drivers/gpu/drm/i915/i915_globals.c
> +++ b/drivers/gpu/drm/i915/i915_globals.c
> @@ -7,7 +7,6 @@
>  #include <linux/slab.h>
>  #include <linux/workqueue.h>
>
> -#include "i915_active.h"
>  #include "i915_buddy.h"
>  #include "gem/i915_gem_context.h"
>  #include "gem/i915_gem_object.h"
> @@ -34,7 +33,6 @@ static void __i915_globals_cleanup(void)
>  }
>
>  static __initconst int (* const initfn[])(void) = {
> -       i915_global_active_init,
>         i915_global_buddy_init,
>         i915_global_context_init,
>         i915_global_gem_context_init,
> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> index 9e6b4fd07528..d80901ba75e3 100644
> --- a/drivers/gpu/drm/i915/i915_globals.h
> +++ b/drivers/gpu/drm/i915/i915_globals.h
> @@ -23,7 +23,6 @@ int i915_globals_init(void);
>  void i915_globals_exit(void);
>
>  /* constructors */
> -int i915_global_active_init(void);
>  int i915_global_context_init(void);
>  int i915_global_gem_context_init(void);
>  int i915_global_objects_init(void);
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 0deaeeba2347..6ee77a8f43d6 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -30,6 +30,7 @@
>
>  #include "display/intel_fbdev.h"
>
> +#include "i915_active.h"
>  #include "i915_drv.h"
>  #include "i915_perf.h"
>  #include "i915_globals.h"
> @@ -1293,6 +1294,7 @@ static const struct {
>     void (*exit)(void);
>  } init_funcs[] = {
>         { i915_check_nomodeset, NULL },
> +       { i915_active_module_init, i915_active_module_exit },
>         { i915_globals_init, i915_globals_exit },
>         { i915_mock_selftests, NULL },
>         { i915_pmu_init, i915_pmu_exit },
> --
> 2.32.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy " Daniel Vetter
  2021-07-24  7:38   ` kernel test robot
  2021-07-24  7:38   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_blocks can be static kernel test robot
@ 2021-07-26 15:26   ` Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:26 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Fri, Jul 23, 2021 at 2:29 PM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> With the global kmem_cache shrink infrastructure gone there's nothing
> special and we can convert them over.
>
> I'm doing this split up into each patch because there's quite a bit of
> noise with removing the static global.slab_blocks to just a
> slab_blocks.
>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_buddy.c   | 25 ++++++++-----------------
>  drivers/gpu/drm/i915/i915_buddy.h   |  3 ++-
>  drivers/gpu/drm/i915/i915_globals.c |  2 --
>  drivers/gpu/drm/i915/i915_pci.c     |  2 ++
>  4 files changed, 12 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_buddy.c b/drivers/gpu/drm/i915/i915_buddy.c
> index caabcaea3be7..045d00c43b4c 100644
> --- a/drivers/gpu/drm/i915/i915_buddy.c
> +++ b/drivers/gpu/drm/i915/i915_buddy.c
> @@ -8,13 +8,9 @@
>  #include "i915_buddy.h"
>
>  #include "i915_gem.h"
> -#include "i915_globals.h"
>  #include "i915_utils.h"
>
> -static struct i915_global_buddy {
> -       struct i915_global base;
> -       struct kmem_cache *slab_blocks;
> -} global;
> +struct kmem_cache *slab_blocks;

static?  With that fixed,

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

>
>  static struct i915_buddy_block *i915_block_alloc(struct i915_buddy_mm *mm,
>                                                  struct i915_buddy_block *parent,
> @@ -25,7 +21,7 @@ static struct i915_buddy_block *i915_block_alloc(struct i915_buddy_mm *mm,
>
>         GEM_BUG_ON(order > I915_BUDDY_MAX_ORDER);
>
> -       block = kmem_cache_zalloc(global.slab_blocks, GFP_KERNEL);
> +       block = kmem_cache_zalloc(slab_blocks, GFP_KERNEL);
>         if (!block)
>                 return NULL;
>
> @@ -40,7 +36,7 @@ static struct i915_buddy_block *i915_block_alloc(struct i915_buddy_mm *mm,
>  static void i915_block_free(struct i915_buddy_mm *mm,
>                             struct i915_buddy_block *block)
>  {
> -       kmem_cache_free(global.slab_blocks, block);
> +       kmem_cache_free(slab_blocks, block);
>  }
>
>  static void mark_allocated(struct i915_buddy_block *block)
> @@ -410,21 +406,16 @@ int i915_buddy_alloc_range(struct i915_buddy_mm *mm,
>  #include "selftests/i915_buddy.c"
>  #endif
>
> -static void i915_global_buddy_exit(void)
> +void i915_buddy_module_exit(void)
>  {
> -       kmem_cache_destroy(global.slab_blocks);
> +       kmem_cache_destroy(slab_blocks);
>  }
>
> -static struct i915_global_buddy global = { {
> -       .exit = i915_global_buddy_exit,
> -} };
> -
> -int __init i915_global_buddy_init(void)
> +int __init i915_buddy_module_init(void)
>  {
> -       global.slab_blocks = KMEM_CACHE(i915_buddy_block, 0);
> -       if (!global.slab_blocks)
> +       slab_blocks = KMEM_CACHE(i915_buddy_block, 0);
> +       if (!slab_blocks)
>                 return -ENOMEM;
>
> -       i915_global_register(&global.base);
>         return 0;
>  }
> diff --git a/drivers/gpu/drm/i915/i915_buddy.h b/drivers/gpu/drm/i915/i915_buddy.h
> index d8f26706de52..3940d632f208 100644
> --- a/drivers/gpu/drm/i915/i915_buddy.h
> +++ b/drivers/gpu/drm/i915/i915_buddy.h
> @@ -129,6 +129,7 @@ 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);
> +void i915_buddy_module_exit(void);
> +int i915_buddy_module_init(void);
>
>  #endif
> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> index a53135ee831d..3de7cf22ec76 100644
> --- a/drivers/gpu/drm/i915/i915_globals.c
> +++ b/drivers/gpu/drm/i915/i915_globals.c
> @@ -7,7 +7,6 @@
>  #include <linux/slab.h>
>  #include <linux/workqueue.h>
>
> -#include "i915_buddy.h"
>  #include "gem/i915_gem_context.h"
>  #include "gem/i915_gem_object.h"
>  #include "i915_globals.h"
> @@ -33,7 +32,6 @@ static void __i915_globals_cleanup(void)
>  }
>
>  static __initconst int (* const initfn[])(void) = {
> -       i915_global_buddy_init,
>         i915_global_context_init,
>         i915_global_gem_context_init,
>         i915_global_objects_init,
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 6ee77a8f43d6..f9527269e30a 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -31,6 +31,7 @@
>  #include "display/intel_fbdev.h"
>
>  #include "i915_active.h"
> +#include "i915_buddy.h"
>  #include "i915_drv.h"
>  #include "i915_perf.h"
>  #include "i915_globals.h"
> @@ -1295,6 +1296,7 @@ static const struct {
>  } init_funcs[] = {
>         { i915_check_nomodeset, NULL },
>         { i915_active_module_init, i915_active_module_exit },
> +       { i915_buddy_module_init, i915_buddy_module_exit },
>         { i915_globals_init, i915_globals_exit },
>         { i915_mock_selftests, NULL },
>         { i915_pmu_init, i915_pmu_exit },
> --
> 2.32.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit
  2021-07-26  8:35   ` [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit Tvrtko Ursulin
@ 2021-07-26 15:30     ` Jason Ekstrand
  2021-07-26 15:42       ` Jason Ekstrand
  0 siblings, 1 reply; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:30 UTC (permalink / raw)
  To: Tvrtko Ursulin
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Daniel Vetter

On Mon, Jul 26, 2021 at 3:35 AM Tvrtko Ursulin
<tvrtko.ursulin@linux.intel.com> wrote:
>
>
> On 23/07/2021 20:29, Daniel Vetter wrote:
> > With the global kmem_cache shrink infrastructure gone there's nothing
> > special and we can convert them over.
> >
> > I'm doing this split up into each patch because there's quite a bit of
> > noise with removing the static global.slab_ce to just a
> > slab_ce.
> >
> > Cc: Jason Ekstrand <jason@jlekstrand.net>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >   drivers/gpu/drm/i915/gt/intel_context.c | 25 ++++++++-----------------
> >   drivers/gpu/drm/i915/gt/intel_context.h |  3 +++
> >   drivers/gpu/drm/i915/i915_globals.c     |  2 --
> >   drivers/gpu/drm/i915/i915_globals.h     |  1 -
> >   drivers/gpu/drm/i915/i915_pci.c         |  2 ++
> >   5 files changed, 13 insertions(+), 20 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
> > index baa05fddd690..283382549a6f 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_context.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_context.c
> > @@ -7,7 +7,6 @@
> >   #include "gem/i915_gem_pm.h"
> >
> >   #include "i915_drv.h"
> > -#include "i915_globals.h"
> >   #include "i915_trace.h"
> >
> >   #include "intel_context.h"
> > @@ -15,14 +14,11 @@
> >   #include "intel_engine_pm.h"
> >   #include "intel_ring.h"
> >
> > -static struct i915_global_context {
> > -     struct i915_global base;
> > -     struct kmem_cache *slab_ce;
> > -} global;
> > +struct kmem_cache *slab_ce;

Static?  With that,

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

> >
> >   static struct intel_context *intel_context_alloc(void)
> >   {
> > -     return kmem_cache_zalloc(global.slab_ce, GFP_KERNEL);
> > +     return kmem_cache_zalloc(slab_ce, GFP_KERNEL);
> >   }
> >
> >   static void rcu_context_free(struct rcu_head *rcu)
> > @@ -30,7 +26,7 @@ static void rcu_context_free(struct rcu_head *rcu)
> >       struct intel_context *ce = container_of(rcu, typeof(*ce), rcu);
> >
> >       trace_intel_context_free(ce);
> > -     kmem_cache_free(global.slab_ce, ce);
> > +     kmem_cache_free(slab_ce, ce);
> >   }
> >
> >   void intel_context_free(struct intel_context *ce)
> > @@ -410,22 +406,17 @@ void intel_context_fini(struct intel_context *ce)
> >       i915_active_fini(&ce->active);
> >   }
> >
> > -static void i915_global_context_exit(void)
> > +void i915_context_module_exit(void)
> >   {
> > -     kmem_cache_destroy(global.slab_ce);
> > +     kmem_cache_destroy(slab_ce);
> >   }
> >
> > -static struct i915_global_context global = { {
> > -     .exit = i915_global_context_exit,
> > -} };
> > -
> > -int __init i915_global_context_init(void)
> > +int __init i915_context_module_init(void)
> >   {
> > -     global.slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
> > -     if (!global.slab_ce)
> > +     slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
> > +     if (!slab_ce)
> >               return -ENOMEM;
> >
> > -     i915_global_register(&global.base);
> >       return 0;
> >   }
> >
> > diff --git a/drivers/gpu/drm/i915/gt/intel_context.h b/drivers/gpu/drm/i915/gt/intel_context.h
> > index 974ef85320c2..a0ca82e3c40d 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_context.h
> > +++ b/drivers/gpu/drm/i915/gt/intel_context.h
> > @@ -30,6 +30,9 @@ void intel_context_init(struct intel_context *ce,
> >                       struct intel_engine_cs *engine);
> >   void intel_context_fini(struct intel_context *ce);
> >
> > +void i915_context_module_exit(void);
> > +int i915_context_module_init(void);
> > +
> >   struct intel_context *
> >   intel_context_create(struct intel_engine_cs *engine);
> >
> > diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> > index 3de7cf22ec76..d36eb7dc40aa 100644
> > --- a/drivers/gpu/drm/i915/i915_globals.c
> > +++ b/drivers/gpu/drm/i915/i915_globals.c
> > @@ -7,7 +7,6 @@
> >   #include <linux/slab.h>
> >   #include <linux/workqueue.h>
> >
> > -#include "gem/i915_gem_context.h"
> >   #include "gem/i915_gem_object.h"
> >   #include "i915_globals.h"
> >   #include "i915_request.h"
> > @@ -32,7 +31,6 @@ static void __i915_globals_cleanup(void)
> >   }
> >
> >   static __initconst int (* const initfn[])(void) = {
> > -     i915_global_context_init,
> >       i915_global_gem_context_init,
> >       i915_global_objects_init,
> >       i915_global_request_init,
> > diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> > index d80901ba75e3..60daa738a188 100644
> > --- a/drivers/gpu/drm/i915/i915_globals.h
> > +++ b/drivers/gpu/drm/i915/i915_globals.h
> > @@ -23,7 +23,6 @@ int i915_globals_init(void);
> >   void i915_globals_exit(void);
> >
> >   /* constructors */
> > -int i915_global_context_init(void);
> >   int i915_global_gem_context_init(void);
> >   int i915_global_objects_init(void);
> >   int i915_global_request_init(void);
> > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > index f9527269e30a..266618157775 100644
> > --- a/drivers/gpu/drm/i915/i915_pci.c
> > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > @@ -33,6 +33,7 @@
> >   #include "i915_active.h"
> >   #include "i915_buddy.h"
> >   #include "i915_drv.h"
> > +#include "gem/i915_gem_context.h"
>
> It's a bit ugly to go to a design where i915_pci.c has to include so
> many random parts of i915. IMO for a complex driver like i915,
> compartmentalizing so much knowledge about the internals was better
> inside the globals layer.

I agree that i915_pci feels like the wrong place to put this but I
don't think that's so much because globals don't belong in i915_pci
but because i915_init/exit don't belong there.  Maybe, once this is
all said and done (or at the start of the series), we should move
i915_init/exit to i915_drv.c?  Of course, there's a bunch of PCI
probing stuff in i915_drv.c so..... yeah.... our organization is
pretty busted.

--Jason

> Maybe add a cover letter to explain the perceived pros and cons and
> thinking in general?
>
> Regards,
>
> Tvrtko
>
> >   #include "i915_perf.h"
> >   #include "i915_globals.h"
> >   #include "i915_selftest.h"
> > @@ -1297,6 +1298,7 @@ static const struct {
> >       { i915_check_nomodeset, NULL },
> >       { i915_active_module_init, i915_active_module_exit },
> >       { i915_buddy_module_init, i915_buddy_module_exit },
> > +     { i915_context_module_init, i915_context_module_exit },
> >       { i915_globals_init, i915_globals_exit },
> >       { i915_mock_selftests, NULL },
> >       { i915_pmu_init, i915_pmu_exit },
> >
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context " Daniel Vetter
  2021-07-24 14:50   ` kernel test robot
  2021-07-24 14:50   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_luts can be static kernel test robot
@ 2021-07-26 15:35   ` Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:35 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Fri, Jul 23, 2021 at 2:29 PM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> With the global kmem_cache shrink infrastructure gone there's nothing
> special and we can convert them over.
>
> I'm doing this split up into each patch because there's quite a bit of
> noise with removing the static global.slab_luts to just a
> slab_luts.
>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_context.c | 25 +++++++--------------
>  drivers/gpu/drm/i915/gem/i915_gem_context.h |  3 +++
>  drivers/gpu/drm/i915/i915_globals.c         |  2 --
>  drivers/gpu/drm/i915/i915_globals.h         |  1 -
>  drivers/gpu/drm/i915/i915_pci.c             |  2 ++
>  5 files changed, 13 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index 89ca401bf9ae..c17c28af1e57 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -79,25 +79,21 @@
>  #include "gt/intel_ring.h"
>
>  #include "i915_gem_context.h"
> -#include "i915_globals.h"
>  #include "i915_trace.h"
>  #include "i915_user_extensions.h"
>
>  #define ALL_L3_SLICES(dev) (1 << NUM_L3_SLICES(dev)) - 1
>
> -static struct i915_global_gem_context {
> -       struct i915_global base;
> -       struct kmem_cache *slab_luts;
> -} global;
> +struct kmem_cache *slab_luts;

static.

With that,

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

>  struct i915_lut_handle *i915_lut_handle_alloc(void)
>  {
> -       return kmem_cache_alloc(global.slab_luts, GFP_KERNEL);
> +       return kmem_cache_alloc(slab_luts, GFP_KERNEL);
>  }
>
>  void i915_lut_handle_free(struct i915_lut_handle *lut)
>  {
> -       return kmem_cache_free(global.slab_luts, lut);
> +       return kmem_cache_free(slab_luts, lut);
>  }
>
>  static void lut_close(struct i915_gem_context *ctx)
> @@ -2282,21 +2278,16 @@ i915_gem_engines_iter_next(struct i915_gem_engines_iter *it)
>  #include "selftests/i915_gem_context.c"
>  #endif
>
> -static void i915_global_gem_context_exit(void)
> +void i915_gem_context_module_exit(void)
>  {
> -       kmem_cache_destroy(global.slab_luts);
> +       kmem_cache_destroy(slab_luts);
>  }
>
> -static struct i915_global_gem_context global = { {
> -       .exit = i915_global_gem_context_exit,
> -} };
> -
> -int __init i915_global_gem_context_init(void)
> +int __init i915_gem_context_module_init(void)
>  {
> -       global.slab_luts = KMEM_CACHE(i915_lut_handle, 0);
> -       if (!global.slab_luts)
> +       slab_luts = KMEM_CACHE(i915_lut_handle, 0);
> +       if (!slab_luts)
>                 return -ENOMEM;
>
> -       i915_global_register(&global.base);
>         return 0;
>  }
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.h b/drivers/gpu/drm/i915/gem/i915_gem_context.h
> index 20411db84914..18060536b0c2 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.h
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.h
> @@ -224,6 +224,9 @@ i915_gem_engines_iter_next(struct i915_gem_engines_iter *it);
>         for (i915_gem_engines_iter_init(&(it), (engines)); \
>              ((ce) = i915_gem_engines_iter_next(&(it)));)
>
> +void i915_gem_context_module_exit(void);
> +int i915_gem_context_module_init(void);
> +
>  struct i915_lut_handle *i915_lut_handle_alloc(void);
>  void i915_lut_handle_free(struct i915_lut_handle *lut);
>
> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> index d36eb7dc40aa..dbb3d81eeea7 100644
> --- a/drivers/gpu/drm/i915/i915_globals.c
> +++ b/drivers/gpu/drm/i915/i915_globals.c
> @@ -7,7 +7,6 @@
>  #include <linux/slab.h>
>  #include <linux/workqueue.h>
>
> -#include "gem/i915_gem_object.h"
>  #include "i915_globals.h"
>  #include "i915_request.h"
>  #include "i915_scheduler.h"
> @@ -31,7 +30,6 @@ static void __i915_globals_cleanup(void)
>  }
>
>  static __initconst int (* const initfn[])(void) = {
> -       i915_global_gem_context_init,
>         i915_global_objects_init,
>         i915_global_request_init,
>         i915_global_scheduler_init,
> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> index 60daa738a188..f16752dbbdbf 100644
> --- a/drivers/gpu/drm/i915/i915_globals.h
> +++ b/drivers/gpu/drm/i915/i915_globals.h
> @@ -23,7 +23,6 @@ int i915_globals_init(void);
>  void i915_globals_exit(void);
>
>  /* constructors */
> -int i915_global_gem_context_init(void);
>  int i915_global_objects_init(void);
>  int i915_global_request_init(void);
>  int i915_global_scheduler_init(void);
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 266618157775..2b56e664d043 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -34,6 +34,7 @@
>  #include "i915_buddy.h"
>  #include "i915_drv.h"
>  #include "gem/i915_gem_context.h"
> +#include "gem/i915_gem_object.h"
>  #include "i915_perf.h"
>  #include "i915_globals.h"
>  #include "i915_selftest.h"
> @@ -1299,6 +1300,7 @@ static const struct {
>         { i915_active_module_init, i915_active_module_exit },
>         { i915_buddy_module_init, i915_buddy_module_exit },
>         { i915_context_module_init, i915_context_module_exit },
> +       { i915_gem_context_module_init, i915_gem_context_module_exit },
>         { i915_globals_init, i915_globals_exit },
>         { i915_mock_selftests, NULL },
>         { i915_pmu_init, i915_pmu_exit },
> --
> 2.32.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects " Daniel Vetter
  2021-07-24 18:23   ` kernel test robot
  2021-07-24 18:23   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_objects can be static kernel test robot
@ 2021-07-26 15:39   ` Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:39 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Fri, Jul 23, 2021 at 2:29 PM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> With the global kmem_cache shrink infrastructure gone there's nothing
> special and we can convert them over.
>
> I'm doing this split up into each patch because there's quite a bit of
> noise with removing the static global.slab_objects to just a
> slab_objects.
>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_object.c | 26 +++++++---------------
>  drivers/gpu/drm/i915/gem/i915_gem_object.h |  3 +++
>  drivers/gpu/drm/i915/i915_globals.c        |  1 -
>  drivers/gpu/drm/i915/i915_globals.h        |  1 -
>  drivers/gpu/drm/i915/i915_pci.c            |  1 +
>  5 files changed, 12 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
> index 5c21cff33199..53156250d283 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
> @@ -30,14 +30,10 @@
>  #include "i915_gem_context.h"
>  #include "i915_gem_mman.h"
>  #include "i915_gem_object.h"
> -#include "i915_globals.h"
>  #include "i915_memcpy.h"
>  #include "i915_trace.h"
>
> -static struct i915_global_object {
> -       struct i915_global base;
> -       struct kmem_cache *slab_objects;
> -} global;
> +struct kmem_cache *slab_objects;

static

With that,

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

>  static const struct drm_gem_object_funcs i915_gem_object_funcs;
>
> @@ -45,7 +41,7 @@ struct drm_i915_gem_object *i915_gem_object_alloc(void)
>  {
>         struct drm_i915_gem_object *obj;
>
> -       obj = kmem_cache_zalloc(global.slab_objects, GFP_KERNEL);
> +       obj = kmem_cache_zalloc(slab_objects, GFP_KERNEL);
>         if (!obj)
>                 return NULL;
>         obj->base.funcs = &i915_gem_object_funcs;
> @@ -55,7 +51,7 @@ struct drm_i915_gem_object *i915_gem_object_alloc(void)
>
>  void i915_gem_object_free(struct drm_i915_gem_object *obj)
>  {
> -       return kmem_cache_free(global.slab_objects, obj);
> +       return kmem_cache_free(slab_objects, obj);
>  }
>
>  void i915_gem_object_init(struct drm_i915_gem_object *obj,
> @@ -664,23 +660,17 @@ void i915_gem_init__objects(struct drm_i915_private *i915)
>         INIT_WORK(&i915->mm.free_work, __i915_gem_free_work);
>  }
>
> -static void i915_global_objects_exit(void)
> +void i915_objects_module_exit(void)
>  {
> -       kmem_cache_destroy(global.slab_objects);
> +       kmem_cache_destroy(slab_objects);
>  }
>
> -static struct i915_global_object global = { {
> -       .exit = i915_global_objects_exit,
> -} };
> -
> -int __init i915_global_objects_init(void)
> +int __init i915_objects_module_init(void)
>  {
> -       global.slab_objects =
> -               KMEM_CACHE(drm_i915_gem_object, SLAB_HWCACHE_ALIGN);
> -       if (!global.slab_objects)
> +       slab_objects = KMEM_CACHE(drm_i915_gem_object, SLAB_HWCACHE_ALIGN);
> +       if (!slab_objects)
>                 return -ENOMEM;
>
> -       i915_global_register(&global.base);
>         return 0;
>  }
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h
> index f3ede43282dc..6d8ea62a372f 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_object.h
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h
> @@ -48,6 +48,9 @@ static inline bool i915_gem_object_size_2big(u64 size)
>
>  void i915_gem_init__objects(struct drm_i915_private *i915);
>
> +void i915_objects_module_exit(void);
> +int i915_objects_module_init(void);
> +
>  struct drm_i915_gem_object *i915_gem_object_alloc(void);
>  void i915_gem_object_free(struct drm_i915_gem_object *obj);
>
> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> index dbb3d81eeea7..40a592fbc3e0 100644
> --- a/drivers/gpu/drm/i915/i915_globals.c
> +++ b/drivers/gpu/drm/i915/i915_globals.c
> @@ -30,7 +30,6 @@ static void __i915_globals_cleanup(void)
>  }
>
>  static __initconst int (* const initfn[])(void) = {
> -       i915_global_objects_init,
>         i915_global_request_init,
>         i915_global_scheduler_init,
>         i915_global_vma_init,
> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> index f16752dbbdbf..9734740708f4 100644
> --- a/drivers/gpu/drm/i915/i915_globals.h
> +++ b/drivers/gpu/drm/i915/i915_globals.h
> @@ -23,7 +23,6 @@ int i915_globals_init(void);
>  void i915_globals_exit(void);
>
>  /* constructors */
> -int i915_global_objects_init(void);
>  int i915_global_request_init(void);
>  int i915_global_scheduler_init(void);
>  int i915_global_vma_init(void);
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 2b56e664d043..2334eb3e9abb 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -1301,6 +1301,7 @@ static const struct {
>         { i915_buddy_module_init, i915_buddy_module_exit },
>         { i915_context_module_init, i915_context_module_exit },
>         { i915_gem_context_module_init, i915_gem_context_module_exit },
> +       { i915_objects_module_init, i915_objects_module_exit },
>         { i915_globals_init, i915_globals_exit },
>         { i915_mock_selftests, NULL },
>         { i915_pmu_init, i915_pmu_exit },
> --
> 2.32.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit
  2021-07-26 15:30     ` Jason Ekstrand
@ 2021-07-26 15:42       ` Jason Ekstrand
  2021-07-26 16:08         ` Tvrtko Ursulin
  0 siblings, 1 reply; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:42 UTC (permalink / raw)
  To: Tvrtko Ursulin
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Daniel Vetter

On Mon, Jul 26, 2021 at 10:30 AM Jason Ekstrand <jason@jlekstrand.net> wrote:
>
> On Mon, Jul 26, 2021 at 3:35 AM Tvrtko Ursulin
> <tvrtko.ursulin@linux.intel.com> wrote:
> >
> >
> > On 23/07/2021 20:29, Daniel Vetter wrote:
> > > With the global kmem_cache shrink infrastructure gone there's nothing
> > > special and we can convert them over.
> > >
> > > I'm doing this split up into each patch because there's quite a bit of
> > > noise with removing the static global.slab_ce to just a
> > > slab_ce.
> > >
> > > Cc: Jason Ekstrand <jason@jlekstrand.net>
> > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > > ---
> > >   drivers/gpu/drm/i915/gt/intel_context.c | 25 ++++++++-----------------
> > >   drivers/gpu/drm/i915/gt/intel_context.h |  3 +++
> > >   drivers/gpu/drm/i915/i915_globals.c     |  2 --
> > >   drivers/gpu/drm/i915/i915_globals.h     |  1 -
> > >   drivers/gpu/drm/i915/i915_pci.c         |  2 ++
> > >   5 files changed, 13 insertions(+), 20 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
> > > index baa05fddd690..283382549a6f 100644
> > > --- a/drivers/gpu/drm/i915/gt/intel_context.c
> > > +++ b/drivers/gpu/drm/i915/gt/intel_context.c
> > > @@ -7,7 +7,6 @@
> > >   #include "gem/i915_gem_pm.h"
> > >
> > >   #include "i915_drv.h"
> > > -#include "i915_globals.h"
> > >   #include "i915_trace.h"
> > >
> > >   #include "intel_context.h"
> > > @@ -15,14 +14,11 @@
> > >   #include "intel_engine_pm.h"
> > >   #include "intel_ring.h"
> > >
> > > -static struct i915_global_context {
> > > -     struct i915_global base;
> > > -     struct kmem_cache *slab_ce;
> > > -} global;
> > > +struct kmem_cache *slab_ce;
>
> Static?  With that,
>
> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
>
> > >
> > >   static struct intel_context *intel_context_alloc(void)
> > >   {
> > > -     return kmem_cache_zalloc(global.slab_ce, GFP_KERNEL);
> > > +     return kmem_cache_zalloc(slab_ce, GFP_KERNEL);
> > >   }
> > >
> > >   static void rcu_context_free(struct rcu_head *rcu)
> > > @@ -30,7 +26,7 @@ static void rcu_context_free(struct rcu_head *rcu)
> > >       struct intel_context *ce = container_of(rcu, typeof(*ce), rcu);
> > >
> > >       trace_intel_context_free(ce);
> > > -     kmem_cache_free(global.slab_ce, ce);
> > > +     kmem_cache_free(slab_ce, ce);
> > >   }
> > >
> > >   void intel_context_free(struct intel_context *ce)
> > > @@ -410,22 +406,17 @@ void intel_context_fini(struct intel_context *ce)
> > >       i915_active_fini(&ce->active);
> > >   }
> > >
> > > -static void i915_global_context_exit(void)
> > > +void i915_context_module_exit(void)
> > >   {
> > > -     kmem_cache_destroy(global.slab_ce);
> > > +     kmem_cache_destroy(slab_ce);
> > >   }
> > >
> > > -static struct i915_global_context global = { {
> > > -     .exit = i915_global_context_exit,
> > > -} };
> > > -
> > > -int __init i915_global_context_init(void)
> > > +int __init i915_context_module_init(void)
> > >   {
> > > -     global.slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
> > > -     if (!global.slab_ce)
> > > +     slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
> > > +     if (!slab_ce)
> > >               return -ENOMEM;
> > >
> > > -     i915_global_register(&global.base);
> > >       return 0;
> > >   }
> > >
> > > diff --git a/drivers/gpu/drm/i915/gt/intel_context.h b/drivers/gpu/drm/i915/gt/intel_context.h
> > > index 974ef85320c2..a0ca82e3c40d 100644
> > > --- a/drivers/gpu/drm/i915/gt/intel_context.h
> > > +++ b/drivers/gpu/drm/i915/gt/intel_context.h
> > > @@ -30,6 +30,9 @@ void intel_context_init(struct intel_context *ce,
> > >                       struct intel_engine_cs *engine);
> > >   void intel_context_fini(struct intel_context *ce);
> > >
> > > +void i915_context_module_exit(void);
> > > +int i915_context_module_init(void);
> > > +
> > >   struct intel_context *
> > >   intel_context_create(struct intel_engine_cs *engine);
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> > > index 3de7cf22ec76..d36eb7dc40aa 100644
> > > --- a/drivers/gpu/drm/i915/i915_globals.c
> > > +++ b/drivers/gpu/drm/i915/i915_globals.c
> > > @@ -7,7 +7,6 @@
> > >   #include <linux/slab.h>
> > >   #include <linux/workqueue.h>
> > >
> > > -#include "gem/i915_gem_context.h"
> > >   #include "gem/i915_gem_object.h"
> > >   #include "i915_globals.h"
> > >   #include "i915_request.h"
> > > @@ -32,7 +31,6 @@ static void __i915_globals_cleanup(void)
> > >   }
> > >
> > >   static __initconst int (* const initfn[])(void) = {
> > > -     i915_global_context_init,
> > >       i915_global_gem_context_init,
> > >       i915_global_objects_init,
> > >       i915_global_request_init,
> > > diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> > > index d80901ba75e3..60daa738a188 100644
> > > --- a/drivers/gpu/drm/i915/i915_globals.h
> > > +++ b/drivers/gpu/drm/i915/i915_globals.h
> > > @@ -23,7 +23,6 @@ int i915_globals_init(void);
> > >   void i915_globals_exit(void);
> > >
> > >   /* constructors */
> > > -int i915_global_context_init(void);
> > >   int i915_global_gem_context_init(void);
> > >   int i915_global_objects_init(void);
> > >   int i915_global_request_init(void);
> > > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > > index f9527269e30a..266618157775 100644
> > > --- a/drivers/gpu/drm/i915/i915_pci.c
> > > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > > @@ -33,6 +33,7 @@
> > >   #include "i915_active.h"
> > >   #include "i915_buddy.h"
> > >   #include "i915_drv.h"
> > > +#include "gem/i915_gem_context.h"
> >
> > It's a bit ugly to go to a design where i915_pci.c has to include so
> > many random parts of i915. IMO for a complex driver like i915,
> > compartmentalizing so much knowledge about the internals was better
> > inside the globals layer.
>
> I agree that i915_pci feels like the wrong place to put this but I
> don't think that's so much because globals don't belong in i915_pci
> but because i915_init/exit don't belong there.  Maybe, once this is
> all said and done (or at the start of the series), we should move
> i915_init/exit to i915_drv.c?  Of course, there's a bunch of PCI
> probing stuff in i915_drv.c so..... yeah.... our organization is
> pretty busted.

To put a finer point on this, the new "design" is really to have a
single flat list instead of two, one nested inside the other.  There's
nothing wrong with that at all.  The fact that all this stuff now
lives in i915_pci.c is ugly.  But, as I said, that's kind-of an
accident of history because that's where i915_init() and i915_exit()
currently live.  We should just move the lot to i915_drv.c.

> --Jason
>
> > Maybe add a cover letter to explain the perceived pros and cons and
> > thinking in general?
> >
> > Regards,
> >
> > Tvrtko
> >
> > >   #include "i915_perf.h"
> > >   #include "i915_globals.h"
> > >   #include "i915_selftest.h"
> > > @@ -1297,6 +1298,7 @@ static const struct {
> > >       { i915_check_nomodeset, NULL },
> > >       { i915_active_module_init, i915_active_module_exit },
> > >       { i915_buddy_module_init, i915_buddy_module_exit },
> > > +     { i915_context_module_init, i915_context_module_exit },
> > >       { i915_globals_init, i915_globals_exit },
> > >       { i915_mock_selftests, NULL },
> > >       { i915_pmu_init, i915_pmu_exit },
> > >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs " Daniel Vetter
  2021-07-24 21:58   ` kernel test robot
  2021-07-24 21:58   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_requests can be static kernel test robot
@ 2021-07-26 15:46   ` Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:46 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Fri, Jul 23, 2021 at 2:29 PM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> With the global kmem_cache shrink infrastructure gone there's nothing
> special and we can convert them over.
>
> I'm doing this split up into each patch because there's quite a bit of
> noise with removing the static global.slab_requests|execute_cbs to just a
> slab_requests|execute_cbs.
>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_globals.c |  2 --
>  drivers/gpu/drm/i915/i915_pci.c     |  2 ++
>  drivers/gpu/drm/i915/i915_request.c | 47 ++++++++++++-----------------
>  drivers/gpu/drm/i915/i915_request.h |  3 ++
>  4 files changed, 24 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> index 40a592fbc3e0..8fffa8d93bc5 100644
> --- a/drivers/gpu/drm/i915/i915_globals.c
> +++ b/drivers/gpu/drm/i915/i915_globals.c
> @@ -8,7 +8,6 @@
>  #include <linux/workqueue.h>
>
>  #include "i915_globals.h"
> -#include "i915_request.h"
>  #include "i915_scheduler.h"
>  #include "i915_vma.h"
>
> @@ -30,7 +29,6 @@ static void __i915_globals_cleanup(void)
>  }
>
>  static __initconst int (* const initfn[])(void) = {
> -       i915_global_request_init,
>         i915_global_scheduler_init,
>         i915_global_vma_init,
>  };
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 2334eb3e9abb..bb2bd12fb8c2 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -35,6 +35,7 @@
>  #include "i915_drv.h"
>  #include "gem/i915_gem_context.h"
>  #include "gem/i915_gem_object.h"
> +#include "i915_request.h"
>  #include "i915_perf.h"
>  #include "i915_globals.h"
>  #include "i915_selftest.h"
> @@ -1302,6 +1303,7 @@ static const struct {
>         { i915_context_module_init, i915_context_module_exit },
>         { i915_gem_context_module_init, i915_gem_context_module_exit },
>         { i915_objects_module_init, i915_objects_module_exit },
> +       { i915_request_module_init, i915_request_module_exit },
>         { i915_globals_init, i915_globals_exit },
>         { i915_mock_selftests, NULL },
>         { i915_pmu_init, i915_pmu_exit },
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 6594cb2f8ebd..69152369ea00 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -42,7 +42,6 @@
>
>  #include "i915_active.h"
>  #include "i915_drv.h"
> -#include "i915_globals.h"
>  #include "i915_trace.h"
>  #include "intel_pm.h"
>
> @@ -52,11 +51,8 @@ struct execute_cb {
>         struct i915_request *signal;
>  };
>
> -static struct i915_global_request {
> -       struct i915_global base;
> -       struct kmem_cache *slab_requests;
> -       struct kmem_cache *slab_execute_cbs;
> -} global;
> +struct kmem_cache *slab_requests;

static

> +struct kmem_cache *slab_execute_cbs;

static

Am I tired of typing this?  Yes, I am!  Will I keep typing it?  Probably. :-P

>
>  static const char *i915_fence_get_driver_name(struct dma_fence *fence)
>  {
> @@ -107,7 +103,7 @@ static signed long i915_fence_wait(struct dma_fence *fence,
>
>  struct kmem_cache *i915_request_slab_cache(void)
>  {
> -       return global.slab_requests;
> +       return slab_requests;
>  }
>
>  static void i915_fence_release(struct dma_fence *fence)
> @@ -159,7 +155,7 @@ static void i915_fence_release(struct dma_fence *fence)
>             !cmpxchg(&rq->engine->request_pool, NULL, rq))
>                 return;
>
> -       kmem_cache_free(global.slab_requests, rq);
> +       kmem_cache_free(slab_requests, rq);
>  }
>
>  const struct dma_fence_ops i915_fence_ops = {
> @@ -176,7 +172,7 @@ static void irq_execute_cb(struct irq_work *wrk)
>         struct execute_cb *cb = container_of(wrk, typeof(*cb), work);
>
>         i915_sw_fence_complete(cb->fence);
> -       kmem_cache_free(global.slab_execute_cbs, cb);
> +       kmem_cache_free(slab_execute_cbs, cb);
>  }
>
>  static __always_inline void
> @@ -514,7 +510,7 @@ __await_execution(struct i915_request *rq,
>         if (i915_request_is_active(signal))
>                 return 0;
>
> -       cb = kmem_cache_alloc(global.slab_execute_cbs, gfp);
> +       cb = kmem_cache_alloc(slab_execute_cbs, gfp);
>         if (!cb)
>                 return -ENOMEM;
>
> @@ -868,7 +864,7 @@ request_alloc_slow(struct intel_timeline *tl,
>         rq = list_first_entry(&tl->requests, typeof(*rq), link);
>         i915_request_retire(rq);
>
> -       rq = kmem_cache_alloc(global.slab_requests,
> +       rq = kmem_cache_alloc(slab_requests,
>                               gfp | __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
>         if (rq)
>                 return rq;
> @@ -881,7 +877,7 @@ request_alloc_slow(struct intel_timeline *tl,
>         retire_requests(tl);
>
>  out:
> -       return kmem_cache_alloc(global.slab_requests, gfp);
> +       return kmem_cache_alloc(slab_requests, gfp);
>  }
>
>  static void __i915_request_ctor(void *arg)
> @@ -942,7 +938,7 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp)
>          *
>          * Do not use kmem_cache_zalloc() here!
>          */
> -       rq = kmem_cache_alloc(global.slab_requests,
> +       rq = kmem_cache_alloc(slab_requests,
>                               gfp | __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
>         if (unlikely(!rq)) {
>                 rq = request_alloc_slow(tl, &ce->engine->request_pool, gfp);
> @@ -1029,7 +1025,7 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp)
>         GEM_BUG_ON(!list_empty(&rq->sched.waiters_list));
>
>  err_free:
> -       kmem_cache_free(global.slab_requests, rq);
> +       kmem_cache_free(slab_requests, rq);
>  err_unreserve:
>         intel_context_unpin(ce);
>         return ERR_PTR(ret);
> @@ -2084,19 +2080,15 @@ void i915_request_show(struct drm_printer *m,
>  #include "selftests/i915_request.c"
>  #endif
>
> -static void i915_global_request_exit(void)
> +void i915_request_module_exit(void)
>  {
> -       kmem_cache_destroy(global.slab_execute_cbs);
> -       kmem_cache_destroy(global.slab_requests);
> +       kmem_cache_destroy(slab_execute_cbs);
> +       kmem_cache_destroy(slab_requests);
>  }
>
> -static struct i915_global_request global = { {
> -       .exit = i915_global_request_exit,
> -} };
> -
> -int __init i915_global_request_init(void)
> +int __init i915_request_module_init(void)
>  {
> -       global.slab_requests =
> +       slab_requests =
>                 kmem_cache_create("i915_request",
>                                   sizeof(struct i915_request),
>                                   __alignof__(struct i915_request),
> @@ -2104,20 +2096,19 @@ int __init i915_global_request_init(void)
>                                   SLAB_RECLAIM_ACCOUNT |
>                                   SLAB_TYPESAFE_BY_RCU,
>                                   __i915_request_ctor);
> -       if (!global.slab_requests)
> +       if (!slab_requests)
>                 return -ENOMEM;
>
> -       global.slab_execute_cbs = KMEM_CACHE(execute_cb,
> +       slab_execute_cbs = KMEM_CACHE(execute_cb,
>                                              SLAB_HWCACHE_ALIGN |
>                                              SLAB_RECLAIM_ACCOUNT |
>                                              SLAB_TYPESAFE_BY_RCU);

Indentation is wrong here

With static and indentation fixed,

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

> -       if (!global.slab_execute_cbs)
> +       if (!slab_execute_cbs)
>                 goto err_requests;
>
> -       i915_global_register(&global.base);
>         return 0;
>
>  err_requests:
> -       kmem_cache_destroy(global.slab_requests);
> +       kmem_cache_destroy(slab_requests);
>         return -ENOMEM;
>  }
> diff --git a/drivers/gpu/drm/i915/i915_request.h b/drivers/gpu/drm/i915/i915_request.h
> index 717e5b292046..a79480f07f04 100644
> --- a/drivers/gpu/drm/i915/i915_request.h
> +++ b/drivers/gpu/drm/i915/i915_request.h
> @@ -647,4 +647,7 @@ bool
>  i915_request_active_engine(struct i915_request *rq,
>                            struct intel_engine_cs **active);
>
> +void i915_request_module_exit(void);
> +int i915_request_module_init(void);
> +
>  #endif /* I915_REQUEST_H */
> --
> 2.32.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler slabs to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler " Daniel Vetter
  2021-07-25  1:23   ` kernel test robot
  2021-07-25  1:23   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_dependencies can be static kernel test robot
@ 2021-07-26 15:47   ` Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:47 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Fri, Jul 23, 2021 at 2:29 PM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> With the global kmem_cache shrink infrastructure gone there's nothing
> special and we can convert them over.
>
> I'm doing this split up into each patch because there's quite a bit of
> noise with removing the static global.slab_dependencies|priorities to just a
> slab_dependencies|priorities.
>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_globals.c   |  2 --
>  drivers/gpu/drm/i915/i915_globals.h   |  2 --
>  drivers/gpu/drm/i915/i915_pci.c       |  2 ++
>  drivers/gpu/drm/i915/i915_scheduler.c | 39 +++++++++++----------------
>  drivers/gpu/drm/i915/i915_scheduler.h |  3 +++
>  5 files changed, 20 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> index 8fffa8d93bc5..8923589057ab 100644
> --- a/drivers/gpu/drm/i915/i915_globals.c
> +++ b/drivers/gpu/drm/i915/i915_globals.c
> @@ -8,7 +8,6 @@
>  #include <linux/workqueue.h>
>
>  #include "i915_globals.h"
> -#include "i915_scheduler.h"
>  #include "i915_vma.h"
>
>  static LIST_HEAD(globals);
> @@ -29,7 +28,6 @@ static void __i915_globals_cleanup(void)
>  }
>
>  static __initconst int (* const initfn[])(void) = {
> -       i915_global_scheduler_init,
>         i915_global_vma_init,
>  };
>
> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> index 9734740708f4..7a57bce1da05 100644
> --- a/drivers/gpu/drm/i915/i915_globals.h
> +++ b/drivers/gpu/drm/i915/i915_globals.h
> @@ -23,8 +23,6 @@ int i915_globals_init(void);
>  void i915_globals_exit(void);
>
>  /* constructors */
> -int i915_global_request_init(void);
> -int i915_global_scheduler_init(void);
>  int i915_global_vma_init(void);
>
>  #endif /* _I915_GLOBALS_H_ */
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index bb2bd12fb8c2..a44318519977 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -39,6 +39,7 @@
>  #include "i915_perf.h"
>  #include "i915_globals.h"
>  #include "i915_selftest.h"
> +#include "i915_scheduler.h"
>
>  #define PLATFORM(x) .platform = (x)
>  #define GEN(x) \
> @@ -1304,6 +1305,7 @@ static const struct {
>         { i915_gem_context_module_init, i915_gem_context_module_exit },
>         { i915_objects_module_init, i915_objects_module_exit },
>         { i915_request_module_init, i915_request_module_exit },
> +       { i915_scheduler_module_init, i915_scheduler_module_exit },
>         { i915_globals_init, i915_globals_exit },
>         { i915_mock_selftests, NULL },
>         { i915_pmu_init, i915_pmu_exit },
> diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c
> index 561c649e59f7..02d90d239ff5 100644
> --- a/drivers/gpu/drm/i915/i915_scheduler.c
> +++ b/drivers/gpu/drm/i915/i915_scheduler.c
> @@ -7,15 +7,11 @@
>  #include <linux/mutex.h>
>
>  #include "i915_drv.h"
> -#include "i915_globals.h"
>  #include "i915_request.h"
>  #include "i915_scheduler.h"
>
> -static struct i915_global_scheduler {
> -       struct i915_global base;
> -       struct kmem_cache *slab_dependencies;
> -       struct kmem_cache *slab_priorities;
> -} global;
> +struct kmem_cache *slab_dependencies;

static

> +struct kmem_cache *slab_priorities;

static

>
>  static DEFINE_SPINLOCK(schedule_lock);
>
> @@ -93,7 +89,7 @@ i915_sched_lookup_priolist(struct i915_sched_engine *sched_engine, int prio)
>         if (prio == I915_PRIORITY_NORMAL) {
>                 p = &sched_engine->default_priolist;
>         } else {
> -               p = kmem_cache_alloc(global.slab_priorities, GFP_ATOMIC);
> +               p = kmem_cache_alloc(slab_priorities, GFP_ATOMIC);
>                 /* Convert an allocation failure to a priority bump */
>                 if (unlikely(!p)) {
>                         prio = I915_PRIORITY_NORMAL; /* recurses just once */
> @@ -122,7 +118,7 @@ i915_sched_lookup_priolist(struct i915_sched_engine *sched_engine, int prio)
>
>  void __i915_priolist_free(struct i915_priolist *p)
>  {
> -       kmem_cache_free(global.slab_priorities, p);
> +       kmem_cache_free(slab_priorities, p);
>  }
>
>  struct sched_cache {
> @@ -313,13 +309,13 @@ void i915_sched_node_reinit(struct i915_sched_node *node)
>  static struct i915_dependency *
>  i915_dependency_alloc(void)
>  {
> -       return kmem_cache_alloc(global.slab_dependencies, GFP_KERNEL);
> +       return kmem_cache_alloc(slab_dependencies, GFP_KERNEL);
>  }
>
>  static void
>  i915_dependency_free(struct i915_dependency *dep)
>  {
> -       kmem_cache_free(global.slab_dependencies, dep);
> +       kmem_cache_free(slab_dependencies, dep);
>  }
>
>  bool __i915_sched_node_add_dependency(struct i915_sched_node *node,
> @@ -475,32 +471,27 @@ i915_sched_engine_create(unsigned int subclass)
>         return sched_engine;
>  }
>
> -static void i915_global_scheduler_exit(void)
> +void i915_scheduler_module_exit(void)
>  {
> -       kmem_cache_destroy(global.slab_dependencies);
> -       kmem_cache_destroy(global.slab_priorities);
> +       kmem_cache_destroy(slab_dependencies);
> +       kmem_cache_destroy(slab_priorities);
>  }
>
> -static struct i915_global_scheduler global = { {
> -       .exit = i915_global_scheduler_exit,
> -} };
> -
> -int __init i915_global_scheduler_init(void)
> +int __init i915_scheduler_module_init(void)
>  {
> -       global.slab_dependencies = KMEM_CACHE(i915_dependency,
> +       slab_dependencies = KMEM_CACHE(i915_dependency,
>                                               SLAB_HWCACHE_ALIGN |
>                                               SLAB_TYPESAFE_BY_RCU);

Indentation

With the nits fixed,

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

> -       if (!global.slab_dependencies)
> +       if (!slab_dependencies)
>                 return -ENOMEM;
>
> -       global.slab_priorities = KMEM_CACHE(i915_priolist, 0);
> -       if (!global.slab_priorities)
> +       slab_priorities = KMEM_CACHE(i915_priolist, 0);
> +       if (!slab_priorities)
>                 goto err_priorities;
>
> -       i915_global_register(&global.base);
>         return 0;
>
>  err_priorities:
> -       kmem_cache_destroy(global.slab_priorities);
> +       kmem_cache_destroy(slab_priorities);
>         return -ENOMEM;
>  }
> diff --git a/drivers/gpu/drm/i915/i915_scheduler.h b/drivers/gpu/drm/i915/i915_scheduler.h
> index 650ab8e0db9f..0a4f61fd0be0 100644
> --- a/drivers/gpu/drm/i915/i915_scheduler.h
> +++ b/drivers/gpu/drm/i915/i915_scheduler.h
> @@ -98,4 +98,7 @@ void i915_request_show_with_schedule(struct drm_printer *m,
>                                      const char *prefix,
>                                      int indent);
>
> +void i915_scheduler_module_exit(void);
> +int i915_scheduler_module_init(void);
> +
>  #endif /* _I915_SCHEDULER_H_ */
> --
> 2.32.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab to direct module init/exit
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab " Daniel Vetter
  2021-07-25  4:04   ` kernel test robot
  2021-07-25  4:04   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_vmas can be static kernel test robot
@ 2021-07-26 15:50   ` Jason Ekstrand
  2 siblings, 0 replies; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:50 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Fri, Jul 23, 2021 at 2:29 PM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> With the global kmem_cache shrink infrastructure gone there's nothing
> special and we can convert them over.
>
> I'm doing this split up into each patch because there's quite a bit of
> noise with removing the static global.slab_vmas to just a
> slab_vmas.
>
> We have to keep i915_drv.h include in i915_globals otherwise there's
> nothing anymore that pulls in GEM_BUG_ON.
>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_globals.c |  3 +--
>  drivers/gpu/drm/i915/i915_globals.h |  3 ---
>  drivers/gpu/drm/i915/i915_pci.c     |  2 ++
>  drivers/gpu/drm/i915/i915_vma.c     | 25 ++++++++-----------------
>  drivers/gpu/drm/i915/i915_vma.h     |  3 +++
>  5 files changed, 14 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> index 8923589057ab..04979789e7be 100644
> --- a/drivers/gpu/drm/i915/i915_globals.c
> +++ b/drivers/gpu/drm/i915/i915_globals.c
> @@ -8,7 +8,7 @@
>  #include <linux/workqueue.h>
>
>  #include "i915_globals.h"
> -#include "i915_vma.h"
> +#include "i915_drv.h"
>
>  static LIST_HEAD(globals);
>
> @@ -28,7 +28,6 @@ static void __i915_globals_cleanup(void)
>  }
>
>  static __initconst int (* const initfn[])(void) = {
> -       i915_global_vma_init,
>  };
>
>  int __init i915_globals_init(void)
> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> index 7a57bce1da05..57d2998bba45 100644
> --- a/drivers/gpu/drm/i915/i915_globals.h
> +++ b/drivers/gpu/drm/i915/i915_globals.h
> @@ -22,7 +22,4 @@ void i915_global_register(struct i915_global *global);
>  int i915_globals_init(void);
>  void i915_globals_exit(void);
>
> -/* constructors */
> -int i915_global_vma_init(void);
> -
>  #endif /* _I915_GLOBALS_H_ */
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index a44318519977..0affcf33a211 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -40,6 +40,7 @@
>  #include "i915_globals.h"
>  #include "i915_selftest.h"
>  #include "i915_scheduler.h"
> +#include "i915_vma.h"
>
>  #define PLATFORM(x) .platform = (x)
>  #define GEN(x) \
> @@ -1306,6 +1307,7 @@ static const struct {
>         { i915_objects_module_init, i915_objects_module_exit },
>         { i915_request_module_init, i915_request_module_exit },
>         { i915_scheduler_module_init, i915_scheduler_module_exit },
> +       { i915_vma_module_init, i915_vma_module_exit },
>         { i915_globals_init, i915_globals_exit },
>         { i915_mock_selftests, NULL },
>         { i915_pmu_init, i915_pmu_exit },
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 09a7c47926f7..d094e2016b93 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -34,24 +34,20 @@
>  #include "gt/intel_gt_requests.h"
>
>  #include "i915_drv.h"
> -#include "i915_globals.h"
>  #include "i915_sw_fence_work.h"
>  #include "i915_trace.h"
>  #include "i915_vma.h"
>
> -static struct i915_global_vma {
> -       struct i915_global base;
> -       struct kmem_cache *slab_vmas;
> -} global;
> +struct kmem_cache *slab_vmas;

static.  With that,

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

>
>  struct i915_vma *i915_vma_alloc(void)
>  {
> -       return kmem_cache_zalloc(global.slab_vmas, GFP_KERNEL);
> +       return kmem_cache_zalloc(slab_vmas, GFP_KERNEL);
>  }
>
>  void i915_vma_free(struct i915_vma *vma)
>  {
> -       return kmem_cache_free(global.slab_vmas, vma);
> +       return kmem_cache_free(slab_vmas, vma);
>  }
>
>  #if IS_ENABLED(CONFIG_DRM_I915_ERRLOG_GEM) && IS_ENABLED(CONFIG_DRM_DEBUG_MM)
> @@ -1414,21 +1410,16 @@ void i915_vma_make_purgeable(struct i915_vma *vma)
>  #include "selftests/i915_vma.c"
>  #endif
>
> -static void i915_global_vma_exit(void)
> +void i915_vma_module_exit(void)
>  {
> -       kmem_cache_destroy(global.slab_vmas);
> +       kmem_cache_destroy(slab_vmas);
>  }
>
> -static struct i915_global_vma global = { {
> -       .exit = i915_global_vma_exit,
> -} };
> -
> -int __init i915_global_vma_init(void)
> +int __init i915_vma_module_init(void)
>  {
> -       global.slab_vmas = KMEM_CACHE(i915_vma, SLAB_HWCACHE_ALIGN);
> -       if (!global.slab_vmas)
> +       slab_vmas = KMEM_CACHE(i915_vma, SLAB_HWCACHE_ALIGN);
> +       if (!slab_vmas)
>                 return -ENOMEM;
>
> -       i915_global_register(&global.base);
>         return 0;
>  }
> diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
> index eca452a9851f..ed69f66c7ab0 100644
> --- a/drivers/gpu/drm/i915/i915_vma.h
> +++ b/drivers/gpu/drm/i915/i915_vma.h
> @@ -426,4 +426,7 @@ static inline int i915_vma_sync(struct i915_vma *vma)
>         return i915_active_wait(&vma->active);
>  }
>
> +void i915_vma_module_exit(void);
> +int i915_vma_module_init(void);
> +
>  #endif
> --
> 2.32.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 10/10] drm/i915: Remove i915_globals
  2021-07-23 19:29 ` [Intel-gfx] [PATCH 10/10] drm/i915: Remove i915_globals Daniel Vetter
@ 2021-07-26 15:51   ` Jason Ekstrand
  2021-07-27 11:34     ` Daniel Vetter
  0 siblings, 1 reply; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 15:51 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Fri, Jul 23, 2021 at 2:29 PM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> No longer used.
>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

But, also, tvrtko is right that dumping all that stuff in i915_pci.c
isn't great.  Mind typing a quick follow-on that moves i915_init/exit
to i915_drv.c?

--Jason

> ---
>  drivers/gpu/drm/i915/Makefile         |  1 -
>  drivers/gpu/drm/i915/gt/intel_gt_pm.c |  1 -
>  drivers/gpu/drm/i915/i915_globals.c   | 53 ---------------------------
>  drivers/gpu/drm/i915/i915_globals.h   | 25 -------------
>  drivers/gpu/drm/i915/i915_pci.c       |  2 -
>  5 files changed, 82 deletions(-)
>  delete mode 100644 drivers/gpu/drm/i915/i915_globals.c
>  delete mode 100644 drivers/gpu/drm/i915/i915_globals.h
>
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index 10b3bb6207ba..9022dc638ed6 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -166,7 +166,6 @@ i915-y += \
>           i915_gem_gtt.o \
>           i915_gem_ww.o \
>           i915_gem.o \
> -         i915_globals.o \
>           i915_query.o \
>           i915_request.o \
>           i915_scheduler.o \
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> index d86825437516..943c1d416ec0 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> @@ -6,7 +6,6 @@
>  #include <linux/suspend.h>
>
>  #include "i915_drv.h"
> -#include "i915_globals.h"
>  #include "i915_params.h"
>  #include "intel_context.h"
>  #include "intel_engine_pm.h"
> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> deleted file mode 100644
> index 04979789e7be..000000000000
> --- a/drivers/gpu/drm/i915/i915_globals.c
> +++ /dev/null
> @@ -1,53 +0,0 @@
> -/*
> - * SPDX-License-Identifier: MIT
> - *
> - * Copyright © 2019 Intel Corporation
> - */
> -
> -#include <linux/slab.h>
> -#include <linux/workqueue.h>
> -
> -#include "i915_globals.h"
> -#include "i915_drv.h"
> -
> -static LIST_HEAD(globals);
> -
> -void __init i915_global_register(struct i915_global *global)
> -{
> -       GEM_BUG_ON(!global->exit);
> -
> -       list_add_tail(&global->link, &globals);
> -}
> -
> -static void __i915_globals_cleanup(void)
> -{
> -       struct i915_global *global, *next;
> -
> -       list_for_each_entry_safe_reverse(global, next, &globals, link)
> -               global->exit();
> -}
> -
> -static __initconst int (* const initfn[])(void) = {
> -};
> -
> -int __init i915_globals_init(void)
> -{
> -       int i;
> -
> -       for (i = 0; i < ARRAY_SIZE(initfn); i++) {
> -               int err;
> -
> -               err = initfn[i]();
> -               if (err) {
> -                       __i915_globals_cleanup();
> -                       return err;
> -               }
> -       }
> -
> -       return 0;
> -}
> -
> -void i915_globals_exit(void)
> -{
> -       __i915_globals_cleanup();
> -}
> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> deleted file mode 100644
> index 57d2998bba45..000000000000
> --- a/drivers/gpu/drm/i915/i915_globals.h
> +++ /dev/null
> @@ -1,25 +0,0 @@
> -/*
> - * SPDX-License-Identifier: MIT
> - *
> - * Copyright © 2019 Intel Corporation
> - */
> -
> -#ifndef _I915_GLOBALS_H_
> -#define _I915_GLOBALS_H_
> -
> -#include <linux/types.h>
> -
> -typedef void (*i915_global_func_t)(void);
> -
> -struct i915_global {
> -       struct list_head link;
> -
> -       i915_global_func_t exit;
> -};
> -
> -void i915_global_register(struct i915_global *global);
> -
> -int i915_globals_init(void);
> -void i915_globals_exit(void);
> -
> -#endif /* _I915_GLOBALS_H_ */
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 0affcf33a211..ed72bcb58331 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -37,7 +37,6 @@
>  #include "gem/i915_gem_object.h"
>  #include "i915_request.h"
>  #include "i915_perf.h"
> -#include "i915_globals.h"
>  #include "i915_selftest.h"
>  #include "i915_scheduler.h"
>  #include "i915_vma.h"
> @@ -1308,7 +1307,6 @@ static const struct {
>         { i915_request_module_init, i915_request_module_exit },
>         { i915_scheduler_module_init, i915_scheduler_module_exit },
>         { i915_vma_module_init, i915_vma_module_exit },
> -       { i915_globals_init, i915_globals_exit },
>         { i915_mock_selftests, NULL },
>         { i915_pmu_init, i915_pmu_exit },
>         { i915_register_pci_driver, i915_unregister_pci_driver },
> --
> 2.32.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit
  2021-07-26 15:42       ` Jason Ekstrand
@ 2021-07-26 16:08         ` Tvrtko Ursulin
  2021-07-26 16:20           ` Jason Ekstrand
  0 siblings, 1 reply; 46+ messages in thread
From: Tvrtko Ursulin @ 2021-07-26 16:08 UTC (permalink / raw)
  To: Jason Ekstrand
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Daniel Vetter


On 26/07/2021 16:42, Jason Ekstrand wrote:
> On Mon, Jul 26, 2021 at 10:30 AM Jason Ekstrand <jason@jlekstrand.net> wrote:
>>
>> On Mon, Jul 26, 2021 at 3:35 AM Tvrtko Ursulin
>> <tvrtko.ursulin@linux.intel.com> wrote:
>>>
>>>
>>> On 23/07/2021 20:29, Daniel Vetter wrote:
>>>> With the global kmem_cache shrink infrastructure gone there's nothing
>>>> special and we can convert them over.
>>>>
>>>> I'm doing this split up into each patch because there's quite a bit of
>>>> noise with removing the static global.slab_ce to just a
>>>> slab_ce.
>>>>
>>>> Cc: Jason Ekstrand <jason@jlekstrand.net>
>>>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>>>> ---
>>>>    drivers/gpu/drm/i915/gt/intel_context.c | 25 ++++++++-----------------
>>>>    drivers/gpu/drm/i915/gt/intel_context.h |  3 +++
>>>>    drivers/gpu/drm/i915/i915_globals.c     |  2 --
>>>>    drivers/gpu/drm/i915/i915_globals.h     |  1 -
>>>>    drivers/gpu/drm/i915/i915_pci.c         |  2 ++
>>>>    5 files changed, 13 insertions(+), 20 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
>>>> index baa05fddd690..283382549a6f 100644
>>>> --- a/drivers/gpu/drm/i915/gt/intel_context.c
>>>> +++ b/drivers/gpu/drm/i915/gt/intel_context.c
>>>> @@ -7,7 +7,6 @@
>>>>    #include "gem/i915_gem_pm.h"
>>>>
>>>>    #include "i915_drv.h"
>>>> -#include "i915_globals.h"
>>>>    #include "i915_trace.h"
>>>>
>>>>    #include "intel_context.h"
>>>> @@ -15,14 +14,11 @@
>>>>    #include "intel_engine_pm.h"
>>>>    #include "intel_ring.h"
>>>>
>>>> -static struct i915_global_context {
>>>> -     struct i915_global base;
>>>> -     struct kmem_cache *slab_ce;
>>>> -} global;
>>>> +struct kmem_cache *slab_ce;
>>
>> Static?  With that,
>>
>> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
>>
>>>>
>>>>    static struct intel_context *intel_context_alloc(void)
>>>>    {
>>>> -     return kmem_cache_zalloc(global.slab_ce, GFP_KERNEL);
>>>> +     return kmem_cache_zalloc(slab_ce, GFP_KERNEL);
>>>>    }
>>>>
>>>>    static void rcu_context_free(struct rcu_head *rcu)
>>>> @@ -30,7 +26,7 @@ static void rcu_context_free(struct rcu_head *rcu)
>>>>        struct intel_context *ce = container_of(rcu, typeof(*ce), rcu);
>>>>
>>>>        trace_intel_context_free(ce);
>>>> -     kmem_cache_free(global.slab_ce, ce);
>>>> +     kmem_cache_free(slab_ce, ce);
>>>>    }
>>>>
>>>>    void intel_context_free(struct intel_context *ce)
>>>> @@ -410,22 +406,17 @@ void intel_context_fini(struct intel_context *ce)
>>>>        i915_active_fini(&ce->active);
>>>>    }
>>>>
>>>> -static void i915_global_context_exit(void)
>>>> +void i915_context_module_exit(void)
>>>>    {
>>>> -     kmem_cache_destroy(global.slab_ce);
>>>> +     kmem_cache_destroy(slab_ce);
>>>>    }
>>>>
>>>> -static struct i915_global_context global = { {
>>>> -     .exit = i915_global_context_exit,
>>>> -} };
>>>> -
>>>> -int __init i915_global_context_init(void)
>>>> +int __init i915_context_module_init(void)
>>>>    {
>>>> -     global.slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
>>>> -     if (!global.slab_ce)
>>>> +     slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
>>>> +     if (!slab_ce)
>>>>                return -ENOMEM;
>>>>
>>>> -     i915_global_register(&global.base);
>>>>        return 0;
>>>>    }
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/gt/intel_context.h b/drivers/gpu/drm/i915/gt/intel_context.h
>>>> index 974ef85320c2..a0ca82e3c40d 100644
>>>> --- a/drivers/gpu/drm/i915/gt/intel_context.h
>>>> +++ b/drivers/gpu/drm/i915/gt/intel_context.h
>>>> @@ -30,6 +30,9 @@ void intel_context_init(struct intel_context *ce,
>>>>                        struct intel_engine_cs *engine);
>>>>    void intel_context_fini(struct intel_context *ce);
>>>>
>>>> +void i915_context_module_exit(void);
>>>> +int i915_context_module_init(void);
>>>> +
>>>>    struct intel_context *
>>>>    intel_context_create(struct intel_engine_cs *engine);
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
>>>> index 3de7cf22ec76..d36eb7dc40aa 100644
>>>> --- a/drivers/gpu/drm/i915/i915_globals.c
>>>> +++ b/drivers/gpu/drm/i915/i915_globals.c
>>>> @@ -7,7 +7,6 @@
>>>>    #include <linux/slab.h>
>>>>    #include <linux/workqueue.h>
>>>>
>>>> -#include "gem/i915_gem_context.h"
>>>>    #include "gem/i915_gem_object.h"
>>>>    #include "i915_globals.h"
>>>>    #include "i915_request.h"
>>>> @@ -32,7 +31,6 @@ static void __i915_globals_cleanup(void)
>>>>    }
>>>>
>>>>    static __initconst int (* const initfn[])(void) = {
>>>> -     i915_global_context_init,
>>>>        i915_global_gem_context_init,
>>>>        i915_global_objects_init,
>>>>        i915_global_request_init,
>>>> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
>>>> index d80901ba75e3..60daa738a188 100644
>>>> --- a/drivers/gpu/drm/i915/i915_globals.h
>>>> +++ b/drivers/gpu/drm/i915/i915_globals.h
>>>> @@ -23,7 +23,6 @@ int i915_globals_init(void);
>>>>    void i915_globals_exit(void);
>>>>
>>>>    /* constructors */
>>>> -int i915_global_context_init(void);
>>>>    int i915_global_gem_context_init(void);
>>>>    int i915_global_objects_init(void);
>>>>    int i915_global_request_init(void);
>>>> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
>>>> index f9527269e30a..266618157775 100644
>>>> --- a/drivers/gpu/drm/i915/i915_pci.c
>>>> +++ b/drivers/gpu/drm/i915/i915_pci.c
>>>> @@ -33,6 +33,7 @@
>>>>    #include "i915_active.h"
>>>>    #include "i915_buddy.h"
>>>>    #include "i915_drv.h"
>>>> +#include "gem/i915_gem_context.h"
>>>
>>> It's a bit ugly to go to a design where i915_pci.c has to include so
>>> many random parts of i915. IMO for a complex driver like i915,
>>> compartmentalizing so much knowledge about the internals was better
>>> inside the globals layer.
>>
>> I agree that i915_pci feels like the wrong place to put this but I
>> don't think that's so much because globals don't belong in i915_pci
>> but because i915_init/exit don't belong there.  Maybe, once this is
>> all said and done (or at the start of the series), we should move
>> i915_init/exit to i915_drv.c?  Of course, there's a bunch of PCI
>> probing stuff in i915_drv.c so..... yeah.... our organization is
>> pretty busted.
> 
> To put a finer point on this, the new "design" is really to have a
> single flat list instead of two, one nested inside the other.  There's
> nothing wrong with that at all.  The fact that all this stuff now
> lives in i915_pci.c is ugly.  But, as I said, that's kind-of an
> accident of history because that's where i915_init() and i915_exit()
> currently live.  We should just move the lot to i915_drv.c.

Hmm.. on one hand it does sounds better to move to i915_drv.c, but is it 
just because all these new include directive are so visibly out of place 
in i915_pci.c?

Perhaps we need i915_module.c and then i915_globals is a completely fine 
concept. Desired IMO even since we have to avoid globals in general 
(multi-gpu) so it sticks out nicely that all that is allowed to be 
global has a special place.

And i915_drv.c can remain being about a driver instance as bound to one GPU.

That feels like the best of both worlds to me.

Regards,

Tvrtko

> 
>> --Jason
>>
>>> Maybe add a cover letter to explain the perceived pros and cons and
>>> thinking in general?
>>>
>>> Regards,
>>>
>>> Tvrtko
>>>
>>>>    #include "i915_perf.h"
>>>>    #include "i915_globals.h"
>>>>    #include "i915_selftest.h"
>>>> @@ -1297,6 +1298,7 @@ static const struct {
>>>>        { i915_check_nomodeset, NULL },
>>>>        { i915_active_module_init, i915_active_module_exit },
>>>>        { i915_buddy_module_init, i915_buddy_module_exit },
>>>> +     { i915_context_module_init, i915_context_module_exit },
>>>>        { i915_globals_init, i915_globals_exit },
>>>>        { i915_mock_selftests, NULL },
>>>>        { i915_pmu_init, i915_pmu_exit },
>>>>
>>> _______________________________________________
>>> Intel-gfx mailing list
>>> Intel-gfx@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit
  2021-07-26 16:08         ` Tvrtko Ursulin
@ 2021-07-26 16:20           ` Jason Ekstrand
  2021-07-26 16:31             ` Tvrtko Ursulin
  0 siblings, 1 reply; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 16:20 UTC (permalink / raw)
  To: Tvrtko Ursulin
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Daniel Vetter

On Mon, Jul 26, 2021 at 11:08 AM Tvrtko Ursulin
<tvrtko.ursulin@linux.intel.com> wrote:
> On 26/07/2021 16:42, Jason Ekstrand wrote:
> > On Mon, Jul 26, 2021 at 10:30 AM Jason Ekstrand <jason@jlekstrand.net> wrote:
> >>
> >> On Mon, Jul 26, 2021 at 3:35 AM Tvrtko Ursulin
> >> <tvrtko.ursulin@linux.intel.com> wrote:
> >>>
> >>>
> >>> On 23/07/2021 20:29, Daniel Vetter wrote:
> >>>> With the global kmem_cache shrink infrastructure gone there's nothing
> >>>> special and we can convert them over.
> >>>>
> >>>> I'm doing this split up into each patch because there's quite a bit of
> >>>> noise with removing the static global.slab_ce to just a
> >>>> slab_ce.
> >>>>
> >>>> Cc: Jason Ekstrand <jason@jlekstrand.net>
> >>>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> >>>> ---
> >>>>    drivers/gpu/drm/i915/gt/intel_context.c | 25 ++++++++-----------------
> >>>>    drivers/gpu/drm/i915/gt/intel_context.h |  3 +++
> >>>>    drivers/gpu/drm/i915/i915_globals.c     |  2 --
> >>>>    drivers/gpu/drm/i915/i915_globals.h     |  1 -
> >>>>    drivers/gpu/drm/i915/i915_pci.c         |  2 ++
> >>>>    5 files changed, 13 insertions(+), 20 deletions(-)
> >>>>
> >>>> diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
> >>>> index baa05fddd690..283382549a6f 100644
> >>>> --- a/drivers/gpu/drm/i915/gt/intel_context.c
> >>>> +++ b/drivers/gpu/drm/i915/gt/intel_context.c
> >>>> @@ -7,7 +7,6 @@
> >>>>    #include "gem/i915_gem_pm.h"
> >>>>
> >>>>    #include "i915_drv.h"
> >>>> -#include "i915_globals.h"
> >>>>    #include "i915_trace.h"
> >>>>
> >>>>    #include "intel_context.h"
> >>>> @@ -15,14 +14,11 @@
> >>>>    #include "intel_engine_pm.h"
> >>>>    #include "intel_ring.h"
> >>>>
> >>>> -static struct i915_global_context {
> >>>> -     struct i915_global base;
> >>>> -     struct kmem_cache *slab_ce;
> >>>> -} global;
> >>>> +struct kmem_cache *slab_ce;
> >>
> >> Static?  With that,
> >>
> >> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
> >>
> >>>>
> >>>>    static struct intel_context *intel_context_alloc(void)
> >>>>    {
> >>>> -     return kmem_cache_zalloc(global.slab_ce, GFP_KERNEL);
> >>>> +     return kmem_cache_zalloc(slab_ce, GFP_KERNEL);
> >>>>    }
> >>>>
> >>>>    static void rcu_context_free(struct rcu_head *rcu)
> >>>> @@ -30,7 +26,7 @@ static void rcu_context_free(struct rcu_head *rcu)
> >>>>        struct intel_context *ce = container_of(rcu, typeof(*ce), rcu);
> >>>>
> >>>>        trace_intel_context_free(ce);
> >>>> -     kmem_cache_free(global.slab_ce, ce);
> >>>> +     kmem_cache_free(slab_ce, ce);
> >>>>    }
> >>>>
> >>>>    void intel_context_free(struct intel_context *ce)
> >>>> @@ -410,22 +406,17 @@ void intel_context_fini(struct intel_context *ce)
> >>>>        i915_active_fini(&ce->active);
> >>>>    }
> >>>>
> >>>> -static void i915_global_context_exit(void)
> >>>> +void i915_context_module_exit(void)
> >>>>    {
> >>>> -     kmem_cache_destroy(global.slab_ce);
> >>>> +     kmem_cache_destroy(slab_ce);
> >>>>    }
> >>>>
> >>>> -static struct i915_global_context global = { {
> >>>> -     .exit = i915_global_context_exit,
> >>>> -} };
> >>>> -
> >>>> -int __init i915_global_context_init(void)
> >>>> +int __init i915_context_module_init(void)
> >>>>    {
> >>>> -     global.slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
> >>>> -     if (!global.slab_ce)
> >>>> +     slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
> >>>> +     if (!slab_ce)
> >>>>                return -ENOMEM;
> >>>>
> >>>> -     i915_global_register(&global.base);
> >>>>        return 0;
> >>>>    }
> >>>>
> >>>> diff --git a/drivers/gpu/drm/i915/gt/intel_context.h b/drivers/gpu/drm/i915/gt/intel_context.h
> >>>> index 974ef85320c2..a0ca82e3c40d 100644
> >>>> --- a/drivers/gpu/drm/i915/gt/intel_context.h
> >>>> +++ b/drivers/gpu/drm/i915/gt/intel_context.h
> >>>> @@ -30,6 +30,9 @@ void intel_context_init(struct intel_context *ce,
> >>>>                        struct intel_engine_cs *engine);
> >>>>    void intel_context_fini(struct intel_context *ce);
> >>>>
> >>>> +void i915_context_module_exit(void);
> >>>> +int i915_context_module_init(void);
> >>>> +
> >>>>    struct intel_context *
> >>>>    intel_context_create(struct intel_engine_cs *engine);
> >>>>
> >>>> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> >>>> index 3de7cf22ec76..d36eb7dc40aa 100644
> >>>> --- a/drivers/gpu/drm/i915/i915_globals.c
> >>>> +++ b/drivers/gpu/drm/i915/i915_globals.c
> >>>> @@ -7,7 +7,6 @@
> >>>>    #include <linux/slab.h>
> >>>>    #include <linux/workqueue.h>
> >>>>
> >>>> -#include "gem/i915_gem_context.h"
> >>>>    #include "gem/i915_gem_object.h"
> >>>>    #include "i915_globals.h"
> >>>>    #include "i915_request.h"
> >>>> @@ -32,7 +31,6 @@ static void __i915_globals_cleanup(void)
> >>>>    }
> >>>>
> >>>>    static __initconst int (* const initfn[])(void) = {
> >>>> -     i915_global_context_init,
> >>>>        i915_global_gem_context_init,
> >>>>        i915_global_objects_init,
> >>>>        i915_global_request_init,
> >>>> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> >>>> index d80901ba75e3..60daa738a188 100644
> >>>> --- a/drivers/gpu/drm/i915/i915_globals.h
> >>>> +++ b/drivers/gpu/drm/i915/i915_globals.h
> >>>> @@ -23,7 +23,6 @@ int i915_globals_init(void);
> >>>>    void i915_globals_exit(void);
> >>>>
> >>>>    /* constructors */
> >>>> -int i915_global_context_init(void);
> >>>>    int i915_global_gem_context_init(void);
> >>>>    int i915_global_objects_init(void);
> >>>>    int i915_global_request_init(void);
> >>>> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> >>>> index f9527269e30a..266618157775 100644
> >>>> --- a/drivers/gpu/drm/i915/i915_pci.c
> >>>> +++ b/drivers/gpu/drm/i915/i915_pci.c
> >>>> @@ -33,6 +33,7 @@
> >>>>    #include "i915_active.h"
> >>>>    #include "i915_buddy.h"
> >>>>    #include "i915_drv.h"
> >>>> +#include "gem/i915_gem_context.h"
> >>>
> >>> It's a bit ugly to go to a design where i915_pci.c has to include so
> >>> many random parts of i915. IMO for a complex driver like i915,
> >>> compartmentalizing so much knowledge about the internals was better
> >>> inside the globals layer.
> >>
> >> I agree that i915_pci feels like the wrong place to put this but I
> >> don't think that's so much because globals don't belong in i915_pci
> >> but because i915_init/exit don't belong there.  Maybe, once this is
> >> all said and done (or at the start of the series), we should move
> >> i915_init/exit to i915_drv.c?  Of course, there's a bunch of PCI
> >> probing stuff in i915_drv.c so..... yeah.... our organization is
> >> pretty busted.
> >
> > To put a finer point on this, the new "design" is really to have a
> > single flat list instead of two, one nested inside the other.  There's
> > nothing wrong with that at all.  The fact that all this stuff now
> > lives in i915_pci.c is ugly.  But, as I said, that's kind-of an
> > accident of history because that's where i915_init() and i915_exit()
> > currently live.  We should just move the lot to i915_drv.c.
>
> Hmm.. on one hand it does sounds better to move to i915_drv.c, but is it
> just because all these new include directive are so visibly out of place
> in i915_pci.c?
>
> Perhaps we need i915_module.c and then i915_globals is a completely fine
> concept. Desired IMO even since we have to avoid globals in general
> (multi-gpu) so it sticks out nicely that all that is allowed to be
> global has a special place.
>
> And i915_drv.c can remain being about a driver instance as bound to one GPU.

Is i915_drv.c about a single instance bound to a single GPU?  If so,
then, yeah, maybe not the right place.  Maybe a i915_module.c would be
better.  It's all different shades of shed paint.

--Jason

> That feels like the best of both worlds to me.
>
> Regards,
>
> Tvrtko
>
> >
> >> --Jason
> >>
> >>> Maybe add a cover letter to explain the perceived pros and cons and
> >>> thinking in general?
> >>>
> >>> Regards,
> >>>
> >>> Tvrtko
> >>>
> >>>>    #include "i915_perf.h"
> >>>>    #include "i915_globals.h"
> >>>>    #include "i915_selftest.h"
> >>>> @@ -1297,6 +1298,7 @@ static const struct {
> >>>>        { i915_check_nomodeset, NULL },
> >>>>        { i915_active_module_init, i915_active_module_exit },
> >>>>        { i915_buddy_module_init, i915_buddy_module_exit },
> >>>> +     { i915_context_module_init, i915_context_module_exit },
> >>>>        { i915_globals_init, i915_globals_exit },
> >>>>        { i915_mock_selftests, NULL },
> >>>>        { i915_pmu_init, i915_pmu_exit },
> >>>>
> >>> _______________________________________________
> >>> Intel-gfx mailing list
> >>> Intel-gfx@lists.freedesktop.org
> >>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit
  2021-07-26 16:20           ` Jason Ekstrand
@ 2021-07-26 16:31             ` Tvrtko Ursulin
  2021-07-26 18:17               ` Jason Ekstrand
  0 siblings, 1 reply; 46+ messages in thread
From: Tvrtko Ursulin @ 2021-07-26 16:31 UTC (permalink / raw)
  To: Jason Ekstrand
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Daniel Vetter


On 26/07/2021 17:20, Jason Ekstrand wrote:
> On Mon, Jul 26, 2021 at 11:08 AM Tvrtko Ursulin
> <tvrtko.ursulin@linux.intel.com> wrote:
>> On 26/07/2021 16:42, Jason Ekstrand wrote:
>>> On Mon, Jul 26, 2021 at 10:30 AM Jason Ekstrand <jason@jlekstrand.net> wrote:
>>>>
>>>> On Mon, Jul 26, 2021 at 3:35 AM Tvrtko Ursulin
>>>> <tvrtko.ursulin@linux.intel.com> wrote:
>>>>>
>>>>>
>>>>> On 23/07/2021 20:29, Daniel Vetter wrote:
>>>>>> With the global kmem_cache shrink infrastructure gone there's nothing
>>>>>> special and we can convert them over.
>>>>>>
>>>>>> I'm doing this split up into each patch because there's quite a bit of
>>>>>> noise with removing the static global.slab_ce to just a
>>>>>> slab_ce.
>>>>>>
>>>>>> Cc: Jason Ekstrand <jason@jlekstrand.net>
>>>>>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>>>>>> ---
>>>>>>     drivers/gpu/drm/i915/gt/intel_context.c | 25 ++++++++-----------------
>>>>>>     drivers/gpu/drm/i915/gt/intel_context.h |  3 +++
>>>>>>     drivers/gpu/drm/i915/i915_globals.c     |  2 --
>>>>>>     drivers/gpu/drm/i915/i915_globals.h     |  1 -
>>>>>>     drivers/gpu/drm/i915/i915_pci.c         |  2 ++
>>>>>>     5 files changed, 13 insertions(+), 20 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
>>>>>> index baa05fddd690..283382549a6f 100644
>>>>>> --- a/drivers/gpu/drm/i915/gt/intel_context.c
>>>>>> +++ b/drivers/gpu/drm/i915/gt/intel_context.c
>>>>>> @@ -7,7 +7,6 @@
>>>>>>     #include "gem/i915_gem_pm.h"
>>>>>>
>>>>>>     #include "i915_drv.h"
>>>>>> -#include "i915_globals.h"
>>>>>>     #include "i915_trace.h"
>>>>>>
>>>>>>     #include "intel_context.h"
>>>>>> @@ -15,14 +14,11 @@
>>>>>>     #include "intel_engine_pm.h"
>>>>>>     #include "intel_ring.h"
>>>>>>
>>>>>> -static struct i915_global_context {
>>>>>> -     struct i915_global base;
>>>>>> -     struct kmem_cache *slab_ce;
>>>>>> -} global;
>>>>>> +struct kmem_cache *slab_ce;
>>>>
>>>> Static?  With that,
>>>>
>>>> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
>>>>
>>>>>>
>>>>>>     static struct intel_context *intel_context_alloc(void)
>>>>>>     {
>>>>>> -     return kmem_cache_zalloc(global.slab_ce, GFP_KERNEL);
>>>>>> +     return kmem_cache_zalloc(slab_ce, GFP_KERNEL);
>>>>>>     }
>>>>>>
>>>>>>     static void rcu_context_free(struct rcu_head *rcu)
>>>>>> @@ -30,7 +26,7 @@ static void rcu_context_free(struct rcu_head *rcu)
>>>>>>         struct intel_context *ce = container_of(rcu, typeof(*ce), rcu);
>>>>>>
>>>>>>         trace_intel_context_free(ce);
>>>>>> -     kmem_cache_free(global.slab_ce, ce);
>>>>>> +     kmem_cache_free(slab_ce, ce);
>>>>>>     }
>>>>>>
>>>>>>     void intel_context_free(struct intel_context *ce)
>>>>>> @@ -410,22 +406,17 @@ void intel_context_fini(struct intel_context *ce)
>>>>>>         i915_active_fini(&ce->active);
>>>>>>     }
>>>>>>
>>>>>> -static void i915_global_context_exit(void)
>>>>>> +void i915_context_module_exit(void)
>>>>>>     {
>>>>>> -     kmem_cache_destroy(global.slab_ce);
>>>>>> +     kmem_cache_destroy(slab_ce);
>>>>>>     }
>>>>>>
>>>>>> -static struct i915_global_context global = { {
>>>>>> -     .exit = i915_global_context_exit,
>>>>>> -} };
>>>>>> -
>>>>>> -int __init i915_global_context_init(void)
>>>>>> +int __init i915_context_module_init(void)
>>>>>>     {
>>>>>> -     global.slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
>>>>>> -     if (!global.slab_ce)
>>>>>> +     slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
>>>>>> +     if (!slab_ce)
>>>>>>                 return -ENOMEM;
>>>>>>
>>>>>> -     i915_global_register(&global.base);
>>>>>>         return 0;
>>>>>>     }
>>>>>>
>>>>>> diff --git a/drivers/gpu/drm/i915/gt/intel_context.h b/drivers/gpu/drm/i915/gt/intel_context.h
>>>>>> index 974ef85320c2..a0ca82e3c40d 100644
>>>>>> --- a/drivers/gpu/drm/i915/gt/intel_context.h
>>>>>> +++ b/drivers/gpu/drm/i915/gt/intel_context.h
>>>>>> @@ -30,6 +30,9 @@ void intel_context_init(struct intel_context *ce,
>>>>>>                         struct intel_engine_cs *engine);
>>>>>>     void intel_context_fini(struct intel_context *ce);
>>>>>>
>>>>>> +void i915_context_module_exit(void);
>>>>>> +int i915_context_module_init(void);
>>>>>> +
>>>>>>     struct intel_context *
>>>>>>     intel_context_create(struct intel_engine_cs *engine);
>>>>>>
>>>>>> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
>>>>>> index 3de7cf22ec76..d36eb7dc40aa 100644
>>>>>> --- a/drivers/gpu/drm/i915/i915_globals.c
>>>>>> +++ b/drivers/gpu/drm/i915/i915_globals.c
>>>>>> @@ -7,7 +7,6 @@
>>>>>>     #include <linux/slab.h>
>>>>>>     #include <linux/workqueue.h>
>>>>>>
>>>>>> -#include "gem/i915_gem_context.h"
>>>>>>     #include "gem/i915_gem_object.h"
>>>>>>     #include "i915_globals.h"
>>>>>>     #include "i915_request.h"
>>>>>> @@ -32,7 +31,6 @@ static void __i915_globals_cleanup(void)
>>>>>>     }
>>>>>>
>>>>>>     static __initconst int (* const initfn[])(void) = {
>>>>>> -     i915_global_context_init,
>>>>>>         i915_global_gem_context_init,
>>>>>>         i915_global_objects_init,
>>>>>>         i915_global_request_init,
>>>>>> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
>>>>>> index d80901ba75e3..60daa738a188 100644
>>>>>> --- a/drivers/gpu/drm/i915/i915_globals.h
>>>>>> +++ b/drivers/gpu/drm/i915/i915_globals.h
>>>>>> @@ -23,7 +23,6 @@ int i915_globals_init(void);
>>>>>>     void i915_globals_exit(void);
>>>>>>
>>>>>>     /* constructors */
>>>>>> -int i915_global_context_init(void);
>>>>>>     int i915_global_gem_context_init(void);
>>>>>>     int i915_global_objects_init(void);
>>>>>>     int i915_global_request_init(void);
>>>>>> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
>>>>>> index f9527269e30a..266618157775 100644
>>>>>> --- a/drivers/gpu/drm/i915/i915_pci.c
>>>>>> +++ b/drivers/gpu/drm/i915/i915_pci.c
>>>>>> @@ -33,6 +33,7 @@
>>>>>>     #include "i915_active.h"
>>>>>>     #include "i915_buddy.h"
>>>>>>     #include "i915_drv.h"
>>>>>> +#include "gem/i915_gem_context.h"
>>>>>
>>>>> It's a bit ugly to go to a design where i915_pci.c has to include so
>>>>> many random parts of i915. IMO for a complex driver like i915,
>>>>> compartmentalizing so much knowledge about the internals was better
>>>>> inside the globals layer.
>>>>
>>>> I agree that i915_pci feels like the wrong place to put this but I
>>>> don't think that's so much because globals don't belong in i915_pci
>>>> but because i915_init/exit don't belong there.  Maybe, once this is
>>>> all said and done (or at the start of the series), we should move
>>>> i915_init/exit to i915_drv.c?  Of course, there's a bunch of PCI
>>>> probing stuff in i915_drv.c so..... yeah.... our organization is
>>>> pretty busted.
>>>
>>> To put a finer point on this, the new "design" is really to have a
>>> single flat list instead of two, one nested inside the other.  There's
>>> nothing wrong with that at all.  The fact that all this stuff now
>>> lives in i915_pci.c is ugly.  But, as I said, that's kind-of an
>>> accident of history because that's where i915_init() and i915_exit()
>>> currently live.  We should just move the lot to i915_drv.c.
>>
>> Hmm.. on one hand it does sounds better to move to i915_drv.c, but is it
>> just because all these new include directive are so visibly out of place
>> in i915_pci.c?
>>
>> Perhaps we need i915_module.c and then i915_globals is a completely fine
>> concept. Desired IMO even since we have to avoid globals in general
>> (multi-gpu) so it sticks out nicely that all that is allowed to be
>> global has a special place.
>>
>> And i915_drv.c can remain being about a driver instance as bound to one GPU.
> 
> Is i915_drv.c about a single instance bound to a single GPU?  If so,

Yep, all functions there either take drm_dev, pdev or dev_priv as 
argument, or return/initialize dev_priv.

> then, yeah, maybe not the right place.  Maybe a i915_module.c would be
> better.  It's all different shades of shed paint.

Hm not really just different shades IMO. Because I argue the patch 
series as is is a retrograde step in the above discussed respect.

I think i915_globals is cleaner code organisation. Because even if we 
add i915_module.c, then that can be made initialize globals and register 
with pci in cleanly separated steps without the need to include many 
driver internals.

I see r-b are accumulating but I hope reasonable objections will be 
considered.

Regards,

Tvrtko

> 
> --Jason
> 
>> That feels like the best of both worlds to me.
>>
>> Regards,
>>
>> Tvrtko
>>
>>>
>>>> --Jason
>>>>
>>>>> Maybe add a cover letter to explain the perceived pros and cons and
>>>>> thinking in general?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Tvrtko
>>>>>
>>>>>>     #include "i915_perf.h"
>>>>>>     #include "i915_globals.h"
>>>>>>     #include "i915_selftest.h"
>>>>>> @@ -1297,6 +1298,7 @@ static const struct {
>>>>>>         { i915_check_nomodeset, NULL },
>>>>>>         { i915_active_module_init, i915_active_module_exit },
>>>>>>         { i915_buddy_module_init, i915_buddy_module_exit },
>>>>>> +     { i915_context_module_init, i915_context_module_exit },
>>>>>>         { i915_globals_init, i915_globals_exit },
>>>>>>         { i915_mock_selftests, NULL },
>>>>>>         { i915_pmu_init, i915_pmu_exit },
>>>>>>
>>>>> _______________________________________________
>>>>> Intel-gfx mailing list
>>>>> Intel-gfx@lists.freedesktop.org
>>>>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit
  2021-07-26 16:31             ` Tvrtko Ursulin
@ 2021-07-26 18:17               ` Jason Ekstrand
  2021-07-27 10:14                 ` Tvrtko Ursulin
  0 siblings, 1 reply; 46+ messages in thread
From: Jason Ekstrand @ 2021-07-26 18:17 UTC (permalink / raw)
  To: Tvrtko Ursulin
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Daniel Vetter

On Mon, Jul 26, 2021 at 11:31 AM Tvrtko Ursulin
<tvrtko.ursulin@linux.intel.com> wrote:
>
>
> On 26/07/2021 17:20, Jason Ekstrand wrote:
> > On Mon, Jul 26, 2021 at 11:08 AM Tvrtko Ursulin
> > <tvrtko.ursulin@linux.intel.com> wrote:
> >> On 26/07/2021 16:42, Jason Ekstrand wrote:
> >>> On Mon, Jul 26, 2021 at 10:30 AM Jason Ekstrand <jason@jlekstrand.net> wrote:
> >>>>
> >>>> On Mon, Jul 26, 2021 at 3:35 AM Tvrtko Ursulin
> >>>> <tvrtko.ursulin@linux.intel.com> wrote:
> >>>>>
> >>>>>
> >>>>> On 23/07/2021 20:29, Daniel Vetter wrote:
> >>>>>> With the global kmem_cache shrink infrastructure gone there's nothing
> >>>>>> special and we can convert them over.
> >>>>>>
> >>>>>> I'm doing this split up into each patch because there's quite a bit of
> >>>>>> noise with removing the static global.slab_ce to just a
> >>>>>> slab_ce.
> >>>>>>
> >>>>>> Cc: Jason Ekstrand <jason@jlekstrand.net>
> >>>>>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> >>>>>> ---
> >>>>>>     drivers/gpu/drm/i915/gt/intel_context.c | 25 ++++++++-----------------
> >>>>>>     drivers/gpu/drm/i915/gt/intel_context.h |  3 +++
> >>>>>>     drivers/gpu/drm/i915/i915_globals.c     |  2 --
> >>>>>>     drivers/gpu/drm/i915/i915_globals.h     |  1 -
> >>>>>>     drivers/gpu/drm/i915/i915_pci.c         |  2 ++
> >>>>>>     5 files changed, 13 insertions(+), 20 deletions(-)
> >>>>>>
> >>>>>> diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
> >>>>>> index baa05fddd690..283382549a6f 100644
> >>>>>> --- a/drivers/gpu/drm/i915/gt/intel_context.c
> >>>>>> +++ b/drivers/gpu/drm/i915/gt/intel_context.c
> >>>>>> @@ -7,7 +7,6 @@
> >>>>>>     #include "gem/i915_gem_pm.h"
> >>>>>>
> >>>>>>     #include "i915_drv.h"
> >>>>>> -#include "i915_globals.h"
> >>>>>>     #include "i915_trace.h"
> >>>>>>
> >>>>>>     #include "intel_context.h"
> >>>>>> @@ -15,14 +14,11 @@
> >>>>>>     #include "intel_engine_pm.h"
> >>>>>>     #include "intel_ring.h"
> >>>>>>
> >>>>>> -static struct i915_global_context {
> >>>>>> -     struct i915_global base;
> >>>>>> -     struct kmem_cache *slab_ce;
> >>>>>> -} global;
> >>>>>> +struct kmem_cache *slab_ce;
> >>>>
> >>>> Static?  With that,
> >>>>
> >>>> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
> >>>>
> >>>>>>
> >>>>>>     static struct intel_context *intel_context_alloc(void)
> >>>>>>     {
> >>>>>> -     return kmem_cache_zalloc(global.slab_ce, GFP_KERNEL);
> >>>>>> +     return kmem_cache_zalloc(slab_ce, GFP_KERNEL);
> >>>>>>     }
> >>>>>>
> >>>>>>     static void rcu_context_free(struct rcu_head *rcu)
> >>>>>> @@ -30,7 +26,7 @@ static void rcu_context_free(struct rcu_head *rcu)
> >>>>>>         struct intel_context *ce = container_of(rcu, typeof(*ce), rcu);
> >>>>>>
> >>>>>>         trace_intel_context_free(ce);
> >>>>>> -     kmem_cache_free(global.slab_ce, ce);
> >>>>>> +     kmem_cache_free(slab_ce, ce);
> >>>>>>     }
> >>>>>>
> >>>>>>     void intel_context_free(struct intel_context *ce)
> >>>>>> @@ -410,22 +406,17 @@ void intel_context_fini(struct intel_context *ce)
> >>>>>>         i915_active_fini(&ce->active);
> >>>>>>     }
> >>>>>>
> >>>>>> -static void i915_global_context_exit(void)
> >>>>>> +void i915_context_module_exit(void)
> >>>>>>     {
> >>>>>> -     kmem_cache_destroy(global.slab_ce);
> >>>>>> +     kmem_cache_destroy(slab_ce);
> >>>>>>     }
> >>>>>>
> >>>>>> -static struct i915_global_context global = { {
> >>>>>> -     .exit = i915_global_context_exit,
> >>>>>> -} };
> >>>>>> -
> >>>>>> -int __init i915_global_context_init(void)
> >>>>>> +int __init i915_context_module_init(void)
> >>>>>>     {
> >>>>>> -     global.slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
> >>>>>> -     if (!global.slab_ce)
> >>>>>> +     slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
> >>>>>> +     if (!slab_ce)
> >>>>>>                 return -ENOMEM;
> >>>>>>
> >>>>>> -     i915_global_register(&global.base);
> >>>>>>         return 0;
> >>>>>>     }
> >>>>>>
> >>>>>> diff --git a/drivers/gpu/drm/i915/gt/intel_context.h b/drivers/gpu/drm/i915/gt/intel_context.h
> >>>>>> index 974ef85320c2..a0ca82e3c40d 100644
> >>>>>> --- a/drivers/gpu/drm/i915/gt/intel_context.h
> >>>>>> +++ b/drivers/gpu/drm/i915/gt/intel_context.h
> >>>>>> @@ -30,6 +30,9 @@ void intel_context_init(struct intel_context *ce,
> >>>>>>                         struct intel_engine_cs *engine);
> >>>>>>     void intel_context_fini(struct intel_context *ce);
> >>>>>>
> >>>>>> +void i915_context_module_exit(void);
> >>>>>> +int i915_context_module_init(void);
> >>>>>> +
> >>>>>>     struct intel_context *
> >>>>>>     intel_context_create(struct intel_engine_cs *engine);
> >>>>>>
> >>>>>> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> >>>>>> index 3de7cf22ec76..d36eb7dc40aa 100644
> >>>>>> --- a/drivers/gpu/drm/i915/i915_globals.c
> >>>>>> +++ b/drivers/gpu/drm/i915/i915_globals.c
> >>>>>> @@ -7,7 +7,6 @@
> >>>>>>     #include <linux/slab.h>
> >>>>>>     #include <linux/workqueue.h>
> >>>>>>
> >>>>>> -#include "gem/i915_gem_context.h"
> >>>>>>     #include "gem/i915_gem_object.h"
> >>>>>>     #include "i915_globals.h"
> >>>>>>     #include "i915_request.h"
> >>>>>> @@ -32,7 +31,6 @@ static void __i915_globals_cleanup(void)
> >>>>>>     }
> >>>>>>
> >>>>>>     static __initconst int (* const initfn[])(void) = {
> >>>>>> -     i915_global_context_init,
> >>>>>>         i915_global_gem_context_init,
> >>>>>>         i915_global_objects_init,
> >>>>>>         i915_global_request_init,
> >>>>>> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> >>>>>> index d80901ba75e3..60daa738a188 100644
> >>>>>> --- a/drivers/gpu/drm/i915/i915_globals.h
> >>>>>> +++ b/drivers/gpu/drm/i915/i915_globals.h
> >>>>>> @@ -23,7 +23,6 @@ int i915_globals_init(void);
> >>>>>>     void i915_globals_exit(void);
> >>>>>>
> >>>>>>     /* constructors */
> >>>>>> -int i915_global_context_init(void);
> >>>>>>     int i915_global_gem_context_init(void);
> >>>>>>     int i915_global_objects_init(void);
> >>>>>>     int i915_global_request_init(void);
> >>>>>> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> >>>>>> index f9527269e30a..266618157775 100644
> >>>>>> --- a/drivers/gpu/drm/i915/i915_pci.c
> >>>>>> +++ b/drivers/gpu/drm/i915/i915_pci.c
> >>>>>> @@ -33,6 +33,7 @@
> >>>>>>     #include "i915_active.h"
> >>>>>>     #include "i915_buddy.h"
> >>>>>>     #include "i915_drv.h"
> >>>>>> +#include "gem/i915_gem_context.h"
> >>>>>
> >>>>> It's a bit ugly to go to a design where i915_pci.c has to include so
> >>>>> many random parts of i915. IMO for a complex driver like i915,
> >>>>> compartmentalizing so much knowledge about the internals was better
> >>>>> inside the globals layer.
> >>>>
> >>>> I agree that i915_pci feels like the wrong place to put this but I
> >>>> don't think that's so much because globals don't belong in i915_pci
> >>>> but because i915_init/exit don't belong there.  Maybe, once this is
> >>>> all said and done (or at the start of the series), we should move
> >>>> i915_init/exit to i915_drv.c?  Of course, there's a bunch of PCI
> >>>> probing stuff in i915_drv.c so..... yeah.... our organization is
> >>>> pretty busted.
> >>>
> >>> To put a finer point on this, the new "design" is really to have a
> >>> single flat list instead of two, one nested inside the other.  There's
> >>> nothing wrong with that at all.  The fact that all this stuff now
> >>> lives in i915_pci.c is ugly.  But, as I said, that's kind-of an
> >>> accident of history because that's where i915_init() and i915_exit()
> >>> currently live.  We should just move the lot to i915_drv.c.
> >>
> >> Hmm.. on one hand it does sounds better to move to i915_drv.c, but is it
> >> just because all these new include directive are so visibly out of place
> >> in i915_pci.c?
> >>
> >> Perhaps we need i915_module.c and then i915_globals is a completely fine
> >> concept. Desired IMO even since we have to avoid globals in general
> >> (multi-gpu) so it sticks out nicely that all that is allowed to be
> >> global has a special place.
> >>
> >> And i915_drv.c can remain being about a driver instance as bound to one GPU.
> >
> > Is i915_drv.c about a single instance bound to a single GPU?  If so,
>
> Yep, all functions there either take drm_dev, pdev or dev_priv as
> argument, or return/initialize dev_priv.
>
> > then, yeah, maybe not the right place.  Maybe a i915_module.c would be
> > better.  It's all different shades of shed paint.
>
> Hm not really just different shades IMO. Because I argue the patch
> series as is is a retrograde step in the above discussed respect.
>
> I think i915_globals is cleaner code organisation. Because even if we
> add i915_module.c, then that can be made initialize globals and register
> with pci in cleanly separated steps without the need to include many
> driver internals.

Ok, so maybe I'm missing something in what you're saying.  I was under
the impression that your primary concern was separating PCI setup from
per-device from per-module stuff.  If so, moving it all to an
i915_module.c fixes that.

Are you arguing that a flat list of module init steps is bad?  And
that having globals be its own sub-list is good?  If so, then I have
to disagree.  I don't think splitting the calling of misc "set up my
slabs" functions from the final "register with PCI" at the end gains
us anything.  What it does do is give more files to search through,
more layers to think about when understanding the code, and more
infrastructure to maintain.

If, on the other hand, we had a globals infrastructure that actually
gained us something in terms of code simplicity, I might be able to
get behind that.  For instance, I could imagine something like this:

I915_DECL_SLAB(foo);

   /* Someone allocates something */
   kmem_cache_alloc(foo.slab);

where we somehow automagically declare the slab, initialize it on
module load, and tear it down on module exit.  That would add real
value.  As is, all i915_globals.c adds is extra layers.

--Jason


> I see r-b are accumulating but I hope reasonable objections will be
> considered.
>
> Regards,
>
> Tvrtko
>
> >
> > --Jason
> >
> >> That feels like the best of both worlds to me.
> >>
> >> Regards,
> >>
> >> Tvrtko
> >>
> >>>
> >>>> --Jason
> >>>>
> >>>>> Maybe add a cover letter to explain the perceived pros and cons and
> >>>>> thinking in general?
> >>>>>
> >>>>> Regards,
> >>>>>
> >>>>> Tvrtko
> >>>>>
> >>>>>>     #include "i915_perf.h"
> >>>>>>     #include "i915_globals.h"
> >>>>>>     #include "i915_selftest.h"
> >>>>>> @@ -1297,6 +1298,7 @@ static const struct {
> >>>>>>         { i915_check_nomodeset, NULL },
> >>>>>>         { i915_active_module_init, i915_active_module_exit },
> >>>>>>         { i915_buddy_module_init, i915_buddy_module_exit },
> >>>>>> +     { i915_context_module_init, i915_context_module_exit },
> >>>>>>         { i915_globals_init, i915_globals_exit },
> >>>>>>         { i915_mock_selftests, NULL },
> >>>>>>         { i915_pmu_init, i915_pmu_exit },
> >>>>>>
> >>>>> _______________________________________________
> >>>>> Intel-gfx mailing list
> >>>>> Intel-gfx@lists.freedesktop.org
> >>>>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit
  2021-07-26 18:17               ` Jason Ekstrand
@ 2021-07-27 10:14                 ` Tvrtko Ursulin
  0 siblings, 0 replies; 46+ messages in thread
From: Tvrtko Ursulin @ 2021-07-27 10:14 UTC (permalink / raw)
  To: Jason Ekstrand
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Daniel Vetter


On 26/07/2021 19:17, Jason Ekstrand wrote:
> On Mon, Jul 26, 2021 at 11:31 AM Tvrtko Ursulin
> <tvrtko.ursulin@linux.intel.com> wrote:
>>
>>
>> On 26/07/2021 17:20, Jason Ekstrand wrote:
>>> On Mon, Jul 26, 2021 at 11:08 AM Tvrtko Ursulin
>>> <tvrtko.ursulin@linux.intel.com> wrote:
>>>> On 26/07/2021 16:42, Jason Ekstrand wrote:
>>>>> On Mon, Jul 26, 2021 at 10:30 AM Jason Ekstrand <jason@jlekstrand.net> wrote:
>>>>>>
>>>>>> On Mon, Jul 26, 2021 at 3:35 AM Tvrtko Ursulin
>>>>>> <tvrtko.ursulin@linux.intel.com> wrote:
>>>>>>>
>>>>>>>
>>>>>>> On 23/07/2021 20:29, Daniel Vetter wrote:
>>>>>>>> With the global kmem_cache shrink infrastructure gone there's nothing
>>>>>>>> special and we can convert them over.
>>>>>>>>
>>>>>>>> I'm doing this split up into each patch because there's quite a bit of
>>>>>>>> noise with removing the static global.slab_ce to just a
>>>>>>>> slab_ce.
>>>>>>>>
>>>>>>>> Cc: Jason Ekstrand <jason@jlekstrand.net>
>>>>>>>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>>>>>>>> ---
>>>>>>>>      drivers/gpu/drm/i915/gt/intel_context.c | 25 ++++++++-----------------
>>>>>>>>      drivers/gpu/drm/i915/gt/intel_context.h |  3 +++
>>>>>>>>      drivers/gpu/drm/i915/i915_globals.c     |  2 --
>>>>>>>>      drivers/gpu/drm/i915/i915_globals.h     |  1 -
>>>>>>>>      drivers/gpu/drm/i915/i915_pci.c         |  2 ++
>>>>>>>>      5 files changed, 13 insertions(+), 20 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/drivers/gpu/drm/i915/gt/intel_context.c b/drivers/gpu/drm/i915/gt/intel_context.c
>>>>>>>> index baa05fddd690..283382549a6f 100644
>>>>>>>> --- a/drivers/gpu/drm/i915/gt/intel_context.c
>>>>>>>> +++ b/drivers/gpu/drm/i915/gt/intel_context.c
>>>>>>>> @@ -7,7 +7,6 @@
>>>>>>>>      #include "gem/i915_gem_pm.h"
>>>>>>>>
>>>>>>>>      #include "i915_drv.h"
>>>>>>>> -#include "i915_globals.h"
>>>>>>>>      #include "i915_trace.h"
>>>>>>>>
>>>>>>>>      #include "intel_context.h"
>>>>>>>> @@ -15,14 +14,11 @@
>>>>>>>>      #include "intel_engine_pm.h"
>>>>>>>>      #include "intel_ring.h"
>>>>>>>>
>>>>>>>> -static struct i915_global_context {
>>>>>>>> -     struct i915_global base;
>>>>>>>> -     struct kmem_cache *slab_ce;
>>>>>>>> -} global;
>>>>>>>> +struct kmem_cache *slab_ce;
>>>>>>
>>>>>> Static?  With that,
>>>>>>
>>>>>> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
>>>>>>
>>>>>>>>
>>>>>>>>      static struct intel_context *intel_context_alloc(void)
>>>>>>>>      {
>>>>>>>> -     return kmem_cache_zalloc(global.slab_ce, GFP_KERNEL);
>>>>>>>> +     return kmem_cache_zalloc(slab_ce, GFP_KERNEL);
>>>>>>>>      }
>>>>>>>>
>>>>>>>>      static void rcu_context_free(struct rcu_head *rcu)
>>>>>>>> @@ -30,7 +26,7 @@ static void rcu_context_free(struct rcu_head *rcu)
>>>>>>>>          struct intel_context *ce = container_of(rcu, typeof(*ce), rcu);
>>>>>>>>
>>>>>>>>          trace_intel_context_free(ce);
>>>>>>>> -     kmem_cache_free(global.slab_ce, ce);
>>>>>>>> +     kmem_cache_free(slab_ce, ce);
>>>>>>>>      }
>>>>>>>>
>>>>>>>>      void intel_context_free(struct intel_context *ce)
>>>>>>>> @@ -410,22 +406,17 @@ void intel_context_fini(struct intel_context *ce)
>>>>>>>>          i915_active_fini(&ce->active);
>>>>>>>>      }
>>>>>>>>
>>>>>>>> -static void i915_global_context_exit(void)
>>>>>>>> +void i915_context_module_exit(void)
>>>>>>>>      {
>>>>>>>> -     kmem_cache_destroy(global.slab_ce);
>>>>>>>> +     kmem_cache_destroy(slab_ce);
>>>>>>>>      }
>>>>>>>>
>>>>>>>> -static struct i915_global_context global = { {
>>>>>>>> -     .exit = i915_global_context_exit,
>>>>>>>> -} };
>>>>>>>> -
>>>>>>>> -int __init i915_global_context_init(void)
>>>>>>>> +int __init i915_context_module_init(void)
>>>>>>>>      {
>>>>>>>> -     global.slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
>>>>>>>> -     if (!global.slab_ce)
>>>>>>>> +     slab_ce = KMEM_CACHE(intel_context, SLAB_HWCACHE_ALIGN);
>>>>>>>> +     if (!slab_ce)
>>>>>>>>                  return -ENOMEM;
>>>>>>>>
>>>>>>>> -     i915_global_register(&global.base);
>>>>>>>>          return 0;
>>>>>>>>      }
>>>>>>>>
>>>>>>>> diff --git a/drivers/gpu/drm/i915/gt/intel_context.h b/drivers/gpu/drm/i915/gt/intel_context.h
>>>>>>>> index 974ef85320c2..a0ca82e3c40d 100644
>>>>>>>> --- a/drivers/gpu/drm/i915/gt/intel_context.h
>>>>>>>> +++ b/drivers/gpu/drm/i915/gt/intel_context.h
>>>>>>>> @@ -30,6 +30,9 @@ void intel_context_init(struct intel_context *ce,
>>>>>>>>                          struct intel_engine_cs *engine);
>>>>>>>>      void intel_context_fini(struct intel_context *ce);
>>>>>>>>
>>>>>>>> +void i915_context_module_exit(void);
>>>>>>>> +int i915_context_module_init(void);
>>>>>>>> +
>>>>>>>>      struct intel_context *
>>>>>>>>      intel_context_create(struct intel_engine_cs *engine);
>>>>>>>>
>>>>>>>> diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
>>>>>>>> index 3de7cf22ec76..d36eb7dc40aa 100644
>>>>>>>> --- a/drivers/gpu/drm/i915/i915_globals.c
>>>>>>>> +++ b/drivers/gpu/drm/i915/i915_globals.c
>>>>>>>> @@ -7,7 +7,6 @@
>>>>>>>>      #include <linux/slab.h>
>>>>>>>>      #include <linux/workqueue.h>
>>>>>>>>
>>>>>>>> -#include "gem/i915_gem_context.h"
>>>>>>>>      #include "gem/i915_gem_object.h"
>>>>>>>>      #include "i915_globals.h"
>>>>>>>>      #include "i915_request.h"
>>>>>>>> @@ -32,7 +31,6 @@ static void __i915_globals_cleanup(void)
>>>>>>>>      }
>>>>>>>>
>>>>>>>>      static __initconst int (* const initfn[])(void) = {
>>>>>>>> -     i915_global_context_init,
>>>>>>>>          i915_global_gem_context_init,
>>>>>>>>          i915_global_objects_init,
>>>>>>>>          i915_global_request_init,
>>>>>>>> diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
>>>>>>>> index d80901ba75e3..60daa738a188 100644
>>>>>>>> --- a/drivers/gpu/drm/i915/i915_globals.h
>>>>>>>> +++ b/drivers/gpu/drm/i915/i915_globals.h
>>>>>>>> @@ -23,7 +23,6 @@ int i915_globals_init(void);
>>>>>>>>      void i915_globals_exit(void);
>>>>>>>>
>>>>>>>>      /* constructors */
>>>>>>>> -int i915_global_context_init(void);
>>>>>>>>      int i915_global_gem_context_init(void);
>>>>>>>>      int i915_global_objects_init(void);
>>>>>>>>      int i915_global_request_init(void);
>>>>>>>> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
>>>>>>>> index f9527269e30a..266618157775 100644
>>>>>>>> --- a/drivers/gpu/drm/i915/i915_pci.c
>>>>>>>> +++ b/drivers/gpu/drm/i915/i915_pci.c
>>>>>>>> @@ -33,6 +33,7 @@
>>>>>>>>      #include "i915_active.h"
>>>>>>>>      #include "i915_buddy.h"
>>>>>>>>      #include "i915_drv.h"
>>>>>>>> +#include "gem/i915_gem_context.h"
>>>>>>>
>>>>>>> It's a bit ugly to go to a design where i915_pci.c has to include so
>>>>>>> many random parts of i915. IMO for a complex driver like i915,
>>>>>>> compartmentalizing so much knowledge about the internals was better
>>>>>>> inside the globals layer.
>>>>>>
>>>>>> I agree that i915_pci feels like the wrong place to put this but I
>>>>>> don't think that's so much because globals don't belong in i915_pci
>>>>>> but because i915_init/exit don't belong there.  Maybe, once this is
>>>>>> all said and done (or at the start of the series), we should move
>>>>>> i915_init/exit to i915_drv.c?  Of course, there's a bunch of PCI
>>>>>> probing stuff in i915_drv.c so..... yeah.... our organization is
>>>>>> pretty busted.
>>>>>
>>>>> To put a finer point on this, the new "design" is really to have a
>>>>> single flat list instead of two, one nested inside the other.  There's
>>>>> nothing wrong with that at all.  The fact that all this stuff now
>>>>> lives in i915_pci.c is ugly.  But, as I said, that's kind-of an
>>>>> accident of history because that's where i915_init() and i915_exit()
>>>>> currently live.  We should just move the lot to i915_drv.c.
>>>>
>>>> Hmm.. on one hand it does sounds better to move to i915_drv.c, but is it
>>>> just because all these new include directive are so visibly out of place
>>>> in i915_pci.c?
>>>>
>>>> Perhaps we need i915_module.c and then i915_globals is a completely fine
>>>> concept. Desired IMO even since we have to avoid globals in general
>>>> (multi-gpu) so it sticks out nicely that all that is allowed to be
>>>> global has a special place.
>>>>
>>>> And i915_drv.c can remain being about a driver instance as bound to one GPU.
>>>
>>> Is i915_drv.c about a single instance bound to a single GPU?  If so,
>>
>> Yep, all functions there either take drm_dev, pdev or dev_priv as
>> argument, or return/initialize dev_priv.
>>
>>> then, yeah, maybe not the right place.  Maybe a i915_module.c would be
>>> better.  It's all different shades of shed paint.
>>
>> Hm not really just different shades IMO. Because I argue the patch
>> series as is is a retrograde step in the above discussed respect.
>>
>> I think i915_globals is cleaner code organisation. Because even if we
>> add i915_module.c, then that can be made initialize globals and register
>> with pci in cleanly separated steps without the need to include many
>> driver internals.
> 
> Ok, so maybe I'm missing something in what you're saying.  I was under
> the impression that your primary concern was separating PCI setup from
> per-device from per-module stuff.  If so, moving it all to an
> i915_module.c fixes that.

Yeah, but i915_module.c was just a side discussion which started from 
whether it is right or not to put module init into i915_drv.c. It does 
not fix the fundamental question of the below discussion.

> Are you arguing that a flat list of module init steps is bad?  And
> that having globals be its own sub-list is good?  If so, then I have
> to disagree.  I don't think splitting the calling of misc "set up my

I think having to include all the driver sub-sub component headers from 
any top level module init file is a step towards a worse design. 
Currently those steps were nicely encapsulated and I don't see a reason 
to break them out to top level.

> slabs" functions from the final "register with PCI" at the end gains
> us anything.  What it does do is give more files to search through,
> more layers to think about when understanding the code, and more
> infrastructure to maintain.
> 
> If, on the other hand, we had a globals infrastructure that actually
> gained us something in terms of code simplicity, I might be able to
> get behind that.  For instance, I could imagine something like this:
> 
> I915_DECL_SLAB(foo);
> 
>     /* Someone allocates something */
>     kmem_cache_alloc(foo.slab);
> 
> where we somehow automagically declare the slab, initialize it on
> module load, and tear it down on module exit.  That would add real
> value.  As is, all i915_globals.c adds is extra layers.

I read this as a statement that at least one part of your thinking is 
that current globals code is too verbose for simple global slab usage?

This I can buy, given how all but two usages are creating a single slab. 
Then there are two callers which use two slabs, but nothing outside the 
slab territory. So argument to simplify can be made yeah, only question 
is how.

Simple macro like you suggest sounds very attractive indeed if it could 
replace boiler plate code for single slab users (albeit with some more 
arguments). Problem is I don't know that we could make it call a 
registration helper from global scope.

Hm removing the list and going for fixed table slots might work, if 
logistics of reserving indices for it in i915_globals.h wouldn't be too 
ugly? Hm maybe not too ugly, maybe it is just an enum every global slab 
users adds for themselves and references it in a macro. With macro magic 
like DEV_INFO_FOR_EACH_FLAG and company to generate the table etc?

Regards,

Tvrtko

> --Jason
> 
> 
>> I see r-b are accumulating but I hope reasonable objections will be
>> considered.
>>
>> Regards,
>>
>> Tvrtko
>>
>>>
>>> --Jason
>>>
>>>> That feels like the best of both worlds to me.
>>>>
>>>> Regards,
>>>>
>>>> Tvrtko
>>>>
>>>>>
>>>>>> --Jason
>>>>>>
>>>>>>> Maybe add a cover letter to explain the perceived pros and cons and
>>>>>>> thinking in general?
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Tvrtko
>>>>>>>
>>>>>>>>      #include "i915_perf.h"
>>>>>>>>      #include "i915_globals.h"
>>>>>>>>      #include "i915_selftest.h"
>>>>>>>> @@ -1297,6 +1298,7 @@ static const struct {
>>>>>>>>          { i915_check_nomodeset, NULL },
>>>>>>>>          { i915_active_module_init, i915_active_module_exit },
>>>>>>>>          { i915_buddy_module_init, i915_buddy_module_exit },
>>>>>>>> +     { i915_context_module_init, i915_context_module_exit },
>>>>>>>>          { i915_globals_init, i915_globals_exit },
>>>>>>>>          { i915_mock_selftests, NULL },
>>>>>>>>          { i915_pmu_init, i915_pmu_exit },
>>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Intel-gfx mailing list
>>>>>>> Intel-gfx@lists.freedesktop.org
>>>>>>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [Intel-gfx] [PATCH 10/10] drm/i915: Remove i915_globals
  2021-07-26 15:51   ` Jason Ekstrand
@ 2021-07-27 11:34     ` Daniel Vetter
  0 siblings, 0 replies; 46+ messages in thread
From: Daniel Vetter @ 2021-07-27 11:34 UTC (permalink / raw)
  To: Jason Ekstrand
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Daniel Vetter

On Mon, Jul 26, 2021 at 10:51:26AM -0500, Jason Ekstrand wrote:
> On Fri, Jul 23, 2021 at 2:29 PM Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> >
> > No longer used.
> >
> > Cc: Jason Ekstrand <jason@jlekstrand.net>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> 
> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
> 
> But, also, tvrtko is right that dumping all that stuff in i915_pci.c
> isn't great.  Mind typing a quick follow-on that moves i915_init/exit
> to i915_drv.c?

I think if we want it a new i915_module.c for the module stuff makes more
sense. And leaving the pci driver in i915_pci.c. At least imo i915_drv is
about the drm_driver instance ...

I'll see what it looks like for v2.
-Daniel

> 
> --Jason
> 
> > ---
> >  drivers/gpu/drm/i915/Makefile         |  1 -
> >  drivers/gpu/drm/i915/gt/intel_gt_pm.c |  1 -
> >  drivers/gpu/drm/i915/i915_globals.c   | 53 ---------------------------
> >  drivers/gpu/drm/i915/i915_globals.h   | 25 -------------
> >  drivers/gpu/drm/i915/i915_pci.c       |  2 -
> >  5 files changed, 82 deletions(-)
> >  delete mode 100644 drivers/gpu/drm/i915/i915_globals.c
> >  delete mode 100644 drivers/gpu/drm/i915/i915_globals.h
> >
> > diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> > index 10b3bb6207ba..9022dc638ed6 100644
> > --- a/drivers/gpu/drm/i915/Makefile
> > +++ b/drivers/gpu/drm/i915/Makefile
> > @@ -166,7 +166,6 @@ i915-y += \
> >           i915_gem_gtt.o \
> >           i915_gem_ww.o \
> >           i915_gem.o \
> > -         i915_globals.o \
> >           i915_query.o \
> >           i915_request.o \
> >           i915_scheduler.o \
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> > index d86825437516..943c1d416ec0 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> > @@ -6,7 +6,6 @@
> >  #include <linux/suspend.h>
> >
> >  #include "i915_drv.h"
> > -#include "i915_globals.h"
> >  #include "i915_params.h"
> >  #include "intel_context.h"
> >  #include "intel_engine_pm.h"
> > diff --git a/drivers/gpu/drm/i915/i915_globals.c b/drivers/gpu/drm/i915/i915_globals.c
> > deleted file mode 100644
> > index 04979789e7be..000000000000
> > --- a/drivers/gpu/drm/i915/i915_globals.c
> > +++ /dev/null
> > @@ -1,53 +0,0 @@
> > -/*
> > - * SPDX-License-Identifier: MIT
> > - *
> > - * Copyright © 2019 Intel Corporation
> > - */
> > -
> > -#include <linux/slab.h>
> > -#include <linux/workqueue.h>
> > -
> > -#include "i915_globals.h"
> > -#include "i915_drv.h"
> > -
> > -static LIST_HEAD(globals);
> > -
> > -void __init i915_global_register(struct i915_global *global)
> > -{
> > -       GEM_BUG_ON(!global->exit);
> > -
> > -       list_add_tail(&global->link, &globals);
> > -}
> > -
> > -static void __i915_globals_cleanup(void)
> > -{
> > -       struct i915_global *global, *next;
> > -
> > -       list_for_each_entry_safe_reverse(global, next, &globals, link)
> > -               global->exit();
> > -}
> > -
> > -static __initconst int (* const initfn[])(void) = {
> > -};
> > -
> > -int __init i915_globals_init(void)
> > -{
> > -       int i;
> > -
> > -       for (i = 0; i < ARRAY_SIZE(initfn); i++) {
> > -               int err;
> > -
> > -               err = initfn[i]();
> > -               if (err) {
> > -                       __i915_globals_cleanup();
> > -                       return err;
> > -               }
> > -       }
> > -
> > -       return 0;
> > -}
> > -
> > -void i915_globals_exit(void)
> > -{
> > -       __i915_globals_cleanup();
> > -}
> > diff --git a/drivers/gpu/drm/i915/i915_globals.h b/drivers/gpu/drm/i915/i915_globals.h
> > deleted file mode 100644
> > index 57d2998bba45..000000000000
> > --- a/drivers/gpu/drm/i915/i915_globals.h
> > +++ /dev/null
> > @@ -1,25 +0,0 @@
> > -/*
> > - * SPDX-License-Identifier: MIT
> > - *
> > - * Copyright © 2019 Intel Corporation
> > - */
> > -
> > -#ifndef _I915_GLOBALS_H_
> > -#define _I915_GLOBALS_H_
> > -
> > -#include <linux/types.h>
> > -
> > -typedef void (*i915_global_func_t)(void);
> > -
> > -struct i915_global {
> > -       struct list_head link;
> > -
> > -       i915_global_func_t exit;
> > -};
> > -
> > -void i915_global_register(struct i915_global *global);
> > -
> > -int i915_globals_init(void);
> > -void i915_globals_exit(void);
> > -
> > -#endif /* _I915_GLOBALS_H_ */
> > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > index 0affcf33a211..ed72bcb58331 100644
> > --- a/drivers/gpu/drm/i915/i915_pci.c
> > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > @@ -37,7 +37,6 @@
> >  #include "gem/i915_gem_object.h"
> >  #include "i915_request.h"
> >  #include "i915_perf.h"
> > -#include "i915_globals.h"
> >  #include "i915_selftest.h"
> >  #include "i915_scheduler.h"
> >  #include "i915_vma.h"
> > @@ -1308,7 +1307,6 @@ static const struct {
> >         { i915_request_module_init, i915_request_module_exit },
> >         { i915_scheduler_module_init, i915_scheduler_module_exit },
> >         { i915_vma_module_init, i915_vma_module_exit },
> > -       { i915_globals_init, i915_globals_exit },
> >         { i915_mock_selftests, NULL },
> >         { i915_pmu_init, i915_pmu_exit },
> >         { i915_register_pci_driver, i915_unregister_pci_driver },
> > --
> > 2.32.0
> >

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2021-07-27 11:34 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-23 19:29 [Intel-gfx] [PATCH 01/10] drm/i915: Check for nomodeset in i915_init() first Daniel Vetter
2021-07-23 19:29 ` [Intel-gfx] [PATCH 02/10] drm/i915: move i915_active slab to direct module init/exit Daniel Vetter
2021-07-26 15:24   ` Jason Ekstrand
2021-07-23 19:29 ` [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy " Daniel Vetter
2021-07-24  7:38   ` kernel test robot
2021-07-24  7:38   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_blocks can be static kernel test robot
2021-07-26 15:26   ` [Intel-gfx] [PATCH 03/10] drm/i915: move i915_buddy slab to direct module init/exit Jason Ekstrand
2021-07-23 19:29 ` [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context " Daniel Vetter
2021-07-24 11:45   ` kernel test robot
2021-07-24 11:45   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_ce can be static kernel test robot
2021-07-26  8:35   ` [Intel-gfx] [PATCH 04/10] drm/i915: move intel_context slab to direct module init/exit Tvrtko Ursulin
2021-07-26 15:30     ` Jason Ekstrand
2021-07-26 15:42       ` Jason Ekstrand
2021-07-26 16:08         ` Tvrtko Ursulin
2021-07-26 16:20           ` Jason Ekstrand
2021-07-26 16:31             ` Tvrtko Ursulin
2021-07-26 18:17               ` Jason Ekstrand
2021-07-27 10:14                 ` Tvrtko Ursulin
2021-07-23 19:29 ` [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context " Daniel Vetter
2021-07-24 14:50   ` kernel test robot
2021-07-24 14:50   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_luts can be static kernel test robot
2021-07-26 15:35   ` [Intel-gfx] [PATCH 05/10] drm/i915: move gem_context slab to direct module init/exit Jason Ekstrand
2021-07-23 19:29 ` [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects " Daniel Vetter
2021-07-24 18:23   ` kernel test robot
2021-07-24 18:23   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_objects can be static kernel test robot
2021-07-26 15:39   ` [Intel-gfx] [PATCH 06/10] drm/i915: move gem_objects slab to direct module init/exit Jason Ekstrand
2021-07-23 19:29 ` [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs " Daniel Vetter
2021-07-24 21:58   ` kernel test robot
2021-07-24 21:58   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_requests can be static kernel test robot
2021-07-26 15:46   ` [Intel-gfx] [PATCH 07/10] drm/i915: move request slabs to direct module init/exit Jason Ekstrand
2021-07-23 19:29 ` [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler " Daniel Vetter
2021-07-25  1:23   ` kernel test robot
2021-07-25  1:23   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_dependencies can be static kernel test robot
2021-07-26 15:47   ` [Intel-gfx] [PATCH 08/10] drm/i915: move scheduler slabs to direct module init/exit Jason Ekstrand
2021-07-23 19:29 ` [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab " Daniel Vetter
2021-07-25  4:04   ` kernel test robot
2021-07-25  4:04   ` [Intel-gfx] [RFC PATCH] drm/i915: slab_vmas can be static kernel test robot
2021-07-26 15:50   ` [Intel-gfx] [PATCH 09/10] drm/i915: move vma slab to direct module init/exit Jason Ekstrand
2021-07-23 19:29 ` [Intel-gfx] [PATCH 10/10] drm/i915: Remove i915_globals Daniel Vetter
2021-07-26 15:51   ` Jason Ekstrand
2021-07-27 11:34     ` Daniel Vetter
2021-07-23 21:55 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/10] drm/i915: Check for nomodeset in i915_init() first Patchwork
2021-07-23 21:56 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-07-23 22:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-07-24  9:00 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-07-26 15:23 ` [Intel-gfx] [PATCH 01/10] " Jason Ekstrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).