From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Use rcu to defer freeing of irq_work
Date: Wed, 13 Dec 2017 14:34:10 +0200 [thread overview]
Message-ID: <1513168450.5228.40.camel@linux.intel.com> (raw)
In-Reply-To: <20171213094802.28243-1-chris@chris-wilson.co.uk>
On Wed, 2017-12-13 at 09:48 +0000, Chris Wilson wrote:
> It is illegal to perform an immediate free of the struct irq_work from
> inside the irq_work callback (as irq_work_run_list modifies work->flags
> after execution of the work->func()). As we use the irq_work to
> coordinate the freeing of the callback from two different softirq paths,
> we need to defer the kfree from inside our irq_work callback, for which
> we can use kfree_rcu.
>
> Fixes: 81c0ed21aa91 ("drm/i915/fence: Avoid del_timer_sync() from inside a timer")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
<SNIP>
> @@ -367,6 +367,7 @@ struct i915_sw_dma_fence_cb {
> struct dma_fence *dma;
> struct timer_list timer;
> struct irq_work work;
> + struct rcu_head rcu;
To reduce the chances of hitting the 4095 limit, maybe throw this right
after the base? OTOH, it'll yell if it breaks...
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-12-13 12:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-13 9:48 [PATCH] drm/i915: Use rcu to defer freeing of irq_work Chris Wilson
2017-12-13 10:19 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-12-13 10:54 ` [PATCH] " Tvrtko Ursulin
2017-12-13 12:02 ` Chris Wilson
2017-12-13 11:50 ` ✓ Fi.CI.IGT: success for " Patchwork
2017-12-13 11:58 ` Chris Wilson
2017-12-13 12:34 ` Joonas Lahtinen [this message]
2017-12-13 12:43 ` [PATCH] " Chris Wilson
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=1513168450.5228.40.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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 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.