From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Eric Anholt <eric@anholt.net>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Eben Upton <eben@raspberrypi.org>
Subject: Re: [PATCH v5 3/4] drm/vc4: Check for the binner bo before handling OOM interrupt
Date: Tue, 23 Apr 2019 10:30:09 +0200 [thread overview]
Message-ID: <d9ccaaf4db46abf0098fbeb178a42c71a7860b9d.camel@bootlin.com> (raw)
In-Reply-To: <87v9zf806m.fsf@anholt.net>
Hi,
On Mon, 2019-04-15 at 13:48 -0700, Eric Anholt wrote:
> Paul Kocialkowski <paul.kocialkowski@bootlin.com> writes:
>
> > Since the OOM interrupt directly deals with the binner bo, it doesn't
> > make sense to try and handle it without a binner buffer registered.
> >
> > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> > ---
> > drivers/gpu/drm/vc4/vc4_irq.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c
> > index ffd0a4388752..723dc86b4511 100644
> > --- a/drivers/gpu/drm/vc4/vc4_irq.c
> > +++ b/drivers/gpu/drm/vc4/vc4_irq.c
> > @@ -64,6 +64,9 @@ vc4_overflow_mem_work(struct work_struct *work)
> > struct vc4_exec_info *exec;
> > unsigned long irqflags;
> >
> > + if (!bo)
> > + return;
> > +
> > bin_bo_slot = vc4_v3d_get_bin_slot(vc4);
> > if (bin_bo_slot < 0) {
> > DRM_ERROR("Couldn't allocate binner overflow mem\n");
> > --
> > 2.21.0
>
> I don't think this is going to be race-free. You're checking outside of
> a lock, then proceeding to use it even if (in patch 4) the bin BO was in
> the process of being freed during the file close path. Can we put all
> of the overflow process here under the same lock as freeing?
Definitely, sorry I missed that.
Cheers,
Paul
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2019-04-23 8:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-15 12:39 [PATCH v5 0/4] drm/vc4: Binner BO management improvements Paul Kocialkowski
2019-04-15 12:39 ` [PATCH v5 1/4] drm/vc4: Reformat and export binner bo allocation helper Paul Kocialkowski
2019-04-15 12:39 ` [PATCH v5 2/4] drm/vc4: Check for V3D before binner bo alloc Paul Kocialkowski
2019-04-15 12:39 ` [PATCH v5 3/4] drm/vc4: Check for the binner bo before handling OOM interrupt Paul Kocialkowski
2019-04-15 20:48 ` Eric Anholt
2019-04-23 8:30 ` Paul Kocialkowski [this message]
2019-04-23 8:50 ` Paul Kocialkowski
2019-04-15 12:39 ` [PATCH v5 4/4] drm/vc4: Allocate binner bo when starting to use the V3D Paul Kocialkowski
2019-04-15 20:50 ` Eric Anholt
2019-04-23 12:55 ` Paul Kocialkowski
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=d9ccaaf4db46abf0098fbeb178a42c71a7860b9d.camel@bootlin.com \
--to=paul.kocialkowski@bootlin.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=eben@raspberrypi.org \
--cc=eric@anholt.net \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=thomas.petazzoni@bootlin.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
all inboxes | Powered by JetHome®