All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [CI] drm/i915/gt: Fix termination condition for freeing all buffer objects
@ 2020-07-29 11:07 Chris Wilson
  2020-07-29 11:26 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/gt: Fix termination condition for freeing all buffer objects (rev2) Patchwork
  2020-07-29 11:44 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2020-07-29 11:07 UTC (permalink / raw)
  To: intel-gfx

A last minute change, that unfortunately broke CI so badly it declared
SUCCESS, was to refactor the debug free all buffer pool code to reuse
the normal worker, inverted the termination condition so that it instead
of discarding the nodes, they were all declared young enough and
eligible for reuse.

Fixes: 03cc6e2cb6da ("drm/i915/gt: Delay taking the spinlock for grabbing from the buffer pool")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c b/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
index 16dbf5436179..9e938d4f6bfe 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
@@ -38,8 +38,7 @@ static void node_free(struct intel_gt_buffer_pool_node *node)
 	kfree_rcu(node, rcu);
 }
 
-static bool
-pool_free_older_than(struct intel_gt_buffer_pool *pool, unsigned long old)
+static bool pool_free_older_than(struct intel_gt_buffer_pool *pool, long keep)
 {
 	struct intel_gt_buffer_pool_node *node, *stale = NULL;
 	bool active = false;
@@ -57,8 +56,12 @@ pool_free_older_than(struct intel_gt_buffer_pool *pool, unsigned long old)
 
 			/* Most recent at head; oldest at tail */
 			list_for_each_prev(pos, list) {
+				unsigned long age;
+
 				node = list_entry(pos, typeof(*node), link);
-				if (time_before(node->age, old))
+
+				age = READ_ONCE(node->age);
+				if (!age || jiffies - age < keep)
 					break;
 
 				/* Check we are the first to claim this node */
@@ -90,7 +93,7 @@ static void pool_free_work(struct work_struct *wrk)
 	struct intel_gt_buffer_pool *pool =
 		container_of(wrk, typeof(*pool), work.work);
 
-	if (pool_free_older_than(pool, jiffies - HZ))
+	if (pool_free_older_than(pool, HZ))
 		schedule_delayed_work(&pool->work,
 				      round_jiffies_up_relative(HZ));
 }
@@ -230,7 +233,7 @@ void intel_gt_flush_buffer_pool(struct intel_gt *gt)
 	struct intel_gt_buffer_pool *pool = &gt->buffer_pool;
 
 	do {
-		while (pool_free_older_than(pool, jiffies + 1))
+		while (pool_free_older_than(pool, 0))
 			;
 	} while (cancel_delayed_work_sync(&pool->work));
 }
-- 
2.20.1

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

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

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/gt: Fix termination condition for freeing all buffer objects (rev2)
  2020-07-29 11:07 [Intel-gfx] [CI] drm/i915/gt: Fix termination condition for freeing all buffer objects Chris Wilson
@ 2020-07-29 11:26 ` Patchwork
  2020-07-29 11:44 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2020-07-29 11:26 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/gt: Fix termination condition for freeing all buffer objects (rev2)
URL   : https://patchwork.freedesktop.org/series/80031/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.0
Fast mode used, each commit won't be checked separately.


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

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

* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gt: Fix termination condition for freeing all buffer objects (rev2)
  2020-07-29 11:07 [Intel-gfx] [CI] drm/i915/gt: Fix termination condition for freeing all buffer objects Chris Wilson
  2020-07-29 11:26 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/gt: Fix termination condition for freeing all buffer objects (rev2) Patchwork
@ 2020-07-29 11:44 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2020-07-29 11:44 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx


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

== Series Details ==

Series: drm/i915/gt: Fix termination condition for freeing all buffer objects (rev2)
URL   : https://patchwork.freedesktop.org/series/80031/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8813 -> Patchwork_18265
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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


Changes
-------

  No changes found


Participating hosts (42 -> 36)
------------------------------

  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus 


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

  * Linux: CI_DRM_8813 -> Patchwork_18265

  CI-20190529: 20190529
  CI_DRM_8813: fd31b1aef933dbd497f1ebf07d5cef1052edf8ea @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5750: 95d906bf458634850626f7e5d6a707191022279f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_18265: e99072fa3abad40895c8ed394a160778313a56cd @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

e99072fa3aba drm/i915/gt: Fix termination condition for freeing all buffer objects

== Logs ==

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

[-- Attachment #1.2: Type: text/html, Size: 1843 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] 3+ messages in thread

end of thread, other threads:[~2020-07-29 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 11:07 [Intel-gfx] [CI] drm/i915/gt: Fix termination condition for freeing all buffer objects Chris Wilson
2020-07-29 11:26 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/gt: Fix termination condition for freeing all buffer objects (rev2) Patchwork
2020-07-29 11:44 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.