From: Mark yao <mark.yao@rock-chips.com>
To: Rob Clark <robdclark@gmail.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] drm_mm crash with multi threads
Date: Fri, 23 Dec 2016 14:31:59 +0800 [thread overview]
Message-ID: <585CC4DF.4090109@rock-chips.com> (raw)
In-Reply-To: <CAF6AEGu0m37QdHwn58r647K3n2aNxBsuk6DoAj6eeCLRV+z-LA@mail.gmail.com>
On 2016年12月23日 13:57, Rob Clark wrote:
> On Thu, Dec 22, 2016 at 11:07 PM, Mark yao <mark.yao@rock-chips.com> wrote:
>> Hi Chris Wilson
>>
>> We port drm_mm to my internal kernel, with high load test, found following
>> crash:
>>
>> [49451.856244]
>> ==================================================================
>> [49451.856350] BUG: KASAN: wild-memory-access on address dead000000000108
>> [49451.856379] Write of size 8 by task Binder:218_4/683 [49451.856417] CPU:
>> 2 PID: 683 Comm: Binder:218_4 Not tainted 4.4.36 #62 [49451.856443] Hardware
>> name: Rockchip RK3399 Excavator Board edp (Android) (DT) [49451.856469] Call
>> trace: [49451.856519] [<ffffff900808a9d0>] dump_backtrace+0x0/0x230
>> [49451.856556] [<ffffff900808ac14>] show_stack+0x14/0x1c [49451.856592]
>> [<ffffff90084a4de0>] dump_stack+0xa0/0xc8 [49451.856633]
>> [<ffffff900821b700>] kasan_report+0x110/0x4dc [49451.856670]
>> [<ffffff900821aa84>] __asan_store8+0x24/0x7c [49451.856715]
>> [<ffffff90086158c4>] drm_mm_insert_node_generic+0x2dc/0x464 [49451.856760]
>> [<ffffff90086406a8>] rockchip_gem_iommu_map+0x60/0x158 [49451.856794]
>> [<ffffff9008640bb4>] rockchip_gem_create_object+0x278/0x488 [49451.856827]
>> [<ffffff9008641020>] rockchip_gem_create_with_handle+0x24/0x10c
>> [49451.856862] [<ffffff9008641364>] rockchip_gem_create_ioctl+0x3c/0x50
>> [49451.856896] [<ffffff900860aee4>] drm_ioctl+0x354/0x52c [49451.856939]
>> [<ffffff900823d948>] do_vfs_ioctl+0x670/0x78c [49451.856976]
>> [<ffffff900823dac4>] SyS_ioctl+0x60/0x88 [49451.857009] [<ffffff9008082ef0>]
>> el0_svc_naked+0x24/0x28
>> We only use drm_mm_insert_node_generic to alloc memory, and use
>> drm_mm_remove_node to release memory
>>
>> alloc/release maybe on difference threads.
>>
>> Seem the problem is threads problem, drm_mm seems is not threads safe, we
>> found drm_mm_insert_node_generic and drm_mm_remove_node
>> may access same resource with list ops, such as some mm->hole_stack.
>>
>> After use mutex lock protect drm_mm_remove_node and
>> drm_mm_insert_node_generic, the crash disappear.
>>
>> I'm not familiar with drm mm, Do you know how to fix it?
> I don't think drm_mm is intended to be thread safe, but instead the
> driver should provide whatever locking is needed before calling in to
> drm_mm. (And presumably you already need some lock to protect driver
> level data structures when creating/destroying gem objects.)
>
> BR,
> -R
Got it,
I also see other's driver, all of them have a lock to protect memory
creating/destorying.
Thanks.
>
>> Thanks.
>>
>> On 2016年12月17日 03:25, Chris Wilson wrote:
>>
>> With a lot of polish applied, Joonas has reviewed the series - all but
>> for [04/38] "lib: Add a simple prime number generator"
>> [lib/prime_numbers.c]. Anyone feel like poking around at a bit of number
>> theory?
>>
>> Other than it would appear to be ready for Daniel to sort out the merge
>> between drm-misc/i915... Please do take a look and see if you can spot
>> anything else that needs fixing/improving.
>> -Chris
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>>
>>
>> --
>> Mark Yao
>>
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>>
>
>
--
Mark Yao
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2016-12-23 6:31 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-16 19:25 drm_mm fixes, take 3, final? Chris Wilson
2016-12-16 19:25 ` [PATCH v3 01/38] drm/i915: Use the MRU stack search after evicting Chris Wilson
2016-12-19 12:55 ` Chris Wilson
2016-12-16 19:25 ` [PATCH v3 02/38] drm: Use drm_mm_nodes() as shorthand for the list of nodes under struct drm_mm Chris Wilson
2016-12-16 19:25 ` [PATCH v3 03/38] drm: Compile time enabling for asserts in drm_mm Chris Wilson
2016-12-16 19:25 ` [PATCH v3 04/38] lib: Add a simple prime number generator Chris Wilson
2016-12-16 19:38 ` Chris Wilson
2016-12-17 12:41 ` [PATCH] " Chris Wilson
2016-12-19 10:05 ` [PATCH v6] " Chris Wilson
2016-12-16 19:25 ` [PATCH v3 05/38] drm: Add a simple generator of random permutations Chris Wilson
2016-12-16 19:25 ` [PATCH v3 06/38] drm: Add some kselftests for the DRM range manager (struct drm_mm) Chris Wilson
2016-12-16 19:25 ` [PATCH v3 07/38] drm: kselftest for drm_mm_init() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 08/38] drm: kselftest for drm_mm_debug() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 09/38] drm: kselftest for drm_mm_reserve_node() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 10/38] drm: kselftest for drm_mm_insert_node() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 11/38] drm: kselftest for drm_mm_replace_node() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 12/38] drm: kselftest for drm_mm_insert_node_in_range() Chris Wilson
2016-12-17 10:16 ` [PATCH] " Chris Wilson
2016-12-16 19:25 ` [PATCH v3 13/38] drm: kselftest for drm_mm and alignment Chris Wilson
2016-12-16 19:25 ` [PATCH v3 14/38] drm: kselftest for drm_mm and eviction Chris Wilson
2016-12-16 19:25 ` [PATCH v3 15/38] drm: kselftest for drm_mm and range restricted eviction Chris Wilson
2016-12-16 19:25 ` [PATCH v3 16/38] drm: kselftest for drm_mm and top-down allocation Chris Wilson
2016-12-17 10:17 ` [PATCH] " Chris Wilson
2016-12-16 19:25 ` [PATCH v3 17/38] drm: kselftest for drm_mm and color adjustment Chris Wilson
2016-12-16 19:25 ` [PATCH v3 18/38] drm: kselftest for drm_mm and color eviction Chris Wilson
2016-12-16 19:25 ` [PATCH v3 19/38] drm: kselftest for drm_mm and restricted " Chris Wilson
2016-12-16 19:25 ` [PATCH v3 20/38] drm/i915: Build DRM range manager selftests for CI Chris Wilson
2016-12-16 19:25 ` [PATCH v3 21/38] drm: Promote drm_mm alignment to u64 Chris Wilson
2016-12-16 19:25 ` [PATCH v3 22/38] drm: Fix kerneldoc for drm_mm_scan_remove_block() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 23/38] drm: Detect overflow in drm_mm_reserve_node() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 24/38] drm: Simplify drm_mm_clean() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 25/38] drm: Add asserts to catch overflow in drm_mm_init() and drm_mm_init_scan() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 26/38] drm: Extract struct drm_mm_scan from struct drm_mm Chris Wilson
2016-12-16 19:25 ` [PATCH v3 27/38] drm: Rename prev_node to hole in drm_mm_scan_add_block() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 28/38] drm: Unconditionally do the range check " Chris Wilson
2016-12-16 19:25 ` [PATCH v3 29/38] drm: Fix application of color vs range restriction when scanning drm_mm Chris Wilson
2016-12-16 19:25 ` [PATCH v3 30/38] drm: Compute tight evictions for drm_mm_scan Chris Wilson
2016-12-16 19:25 ` [PATCH v3 31/38] drm: Optimise power-of-two alignments in drm_mm_scan_add_block() Chris Wilson
2016-12-16 19:25 ` [PATCH v3 32/38] drm: Simplify drm_mm scan-list manipulation Chris Wilson
2016-12-16 19:25 ` [PATCH v3 33/38] drm: Apply tight eviction scanning to color_adjust Chris Wilson
2016-12-16 19:25 ` [PATCH v3 34/38] drm: Wrap drm_mm_node.hole_follows Chris Wilson
2016-12-16 19:25 ` [PATCH v3 35/38] drm: Apply range restriction after color adjustment when allocation Chris Wilson
2016-12-16 19:25 ` [PATCH v3 36/38] drm: Use drm_mm_insert_node_in_range_generic() for everyone Chris Wilson
2016-12-16 19:25 ` [PATCH v3 37/38] drm: Improve drm_mm search (and fix topdown allocation) with rbtrees Chris Wilson
2016-12-20 14:20 ` [PATCH v3] " Chris Wilson
2016-12-16 19:25 ` [PATCH v3 38/38] drm: kselftest for drm_mm and bottom-up allocation Chris Wilson
2016-12-16 20:23 ` ✗ Fi.CI.BAT: warning for series starting with [v3,01/38] drm/i915: Use the MRU stack search after evicting Patchwork
2016-12-17 10:45 ` ✓ Fi.CI.BAT: success for series starting with [v3,01/38] drm/i915: Use the MRU stack search after evicting (rev3) Patchwork
2016-12-17 13:15 ` ✗ Fi.CI.BAT: warning for series starting with [v3,01/38] drm/i915: Use the MRU stack search after evicting (rev4) Patchwork
2016-12-19 10:45 ` ✗ Fi.CI.BAT: failure for series starting with [v3,01/38] drm/i915: Use the MRU stack search after evicting (rev5) Patchwork
2016-12-20 16:45 ` ✓ Fi.CI.BAT: success for series starting with [v3,01/38] drm/i915: Use the MRU stack search after evicting (rev6) Patchwork
2016-12-23 4:07 ` drm_mm crash with multi threads Mark yao
2016-12-23 5:57 ` [Intel-gfx] " Rob Clark
2016-12-23 6:31 ` Mark yao [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=585CC4DF.4090109@rock-chips.com \
--to=mark.yao@rock-chips.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=robdclark@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox