Re: [Intel-gfx] [PATCH] drn/i915: Break up long i915_buddy_free_list() with a cond_resched()

2019-12-30 Thread Matthew Auld
On Sat, 21 Dec 2019 at 14:49, Chris Wilson  wrote:
>
> In the selftests, we may feed very long lists of blocks to be freed on
> culmination of the tests. This coupled with kasan and other
> malloc-tracing can make the kmem_cache_free() operation time consuming,
> and doing many of time trigger soft lockup warnings. Break the list up
> with a cond_resched().
>
> Signed-off-by: Chris Wilson 
> Cc: Matthew Auld 
Reviewed-by: Matthew Auld 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drn/i915: Break up long i915_buddy_free_list() with a cond_resched()

2019-12-21 Thread Chris Wilson
In the selftests, we may feed very long lists of blocks to be freed on
culmination of the tests. This coupled with kasan and other
malloc-tracing can make the kmem_cache_free() operation time consuming,
and doing many of time trigger soft lockup warnings. Break the list up
with a cond_resched().

Signed-off-by: Chris Wilson 
Cc: Matthew Auld 
---
 drivers/gpu/drm/i915/i915_buddy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_buddy.c 
b/drivers/gpu/drm/i915/i915_buddy.c
index e9d4200ce3bc..66883af64ca1 100644
--- a/drivers/gpu/drm/i915/i915_buddy.c
+++ b/drivers/gpu/drm/i915/i915_buddy.c
@@ -262,8 +262,10 @@ void i915_buddy_free_list(struct i915_buddy_mm *mm, struct 
list_head *objects)
 {
struct i915_buddy_block *block, *on;
 
-   list_for_each_entry_safe(block, on, objects, link)
+   list_for_each_entry_safe(block, on, objects, link) {
i915_buddy_free(mm, block);
+   cond_resched();
+   }
INIT_LIST_HEAD(objects);
 }
 
-- 
2.24.1

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