All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Rob Clark <robdclark@chromium.org>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Steven Price <steven.price@arm.com>,
	David Airlie <airlied@linux.ie>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	Sean Paul <sean@poorly.run>
Subject: Re: [PATCH 1/2] drm/shmem: Add madvise state and purge helpers
Date: Mon, 5 Aug 2019 10:47:14 -0700	[thread overview]
Message-ID: <CAF6AEGtKS4V_CHiYwdUB+USw772n7GVb_sHOoVQ2dDHRxyaU+Q@mail.gmail.com> (raw)
In-Reply-To: <20190805163526.GV7444@phenom.ffwll.local>

On Mon, Aug 5, 2019 at 9:35 AM Daniel Vetter <daniel@ffwll.ch> wrote:
>
> On Mon, Aug 05, 2019 at 08:33:57AM -0600, Rob Herring wrote:
> > Add support to the shmem GEM helpers for tracking madvise state and
> > purging pages. This is based on the msm implementation.
> >
> > The BO provides a list_head, but the list management is handled outside
> > of the shmem helpers as there are different locking requirements.
> >
> > Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> > Cc: Sean Paul <sean@poorly.run>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Eric Anholt <eric@anholt.net>
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  drivers/gpu/drm/drm_gem_shmem_helper.c | 57 ++++++++++++++++++++++++++
> >  include/drm/drm_gem_shmem_helper.h     | 15 +++++++
> >  2 files changed, 72 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
> > index 2f64667ac805..4b442576de1c 100644
> > --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
> > +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
> > @@ -75,6 +75,7 @@ struct drm_gem_shmem_object *drm_gem_shmem_create(struct drm_device *dev, size_t
> >       shmem = to_drm_gem_shmem_obj(obj);
> >       mutex_init(&shmem->pages_lock);
> >       mutex_init(&shmem->vmap_lock);
>
> Maybe a bit late, but for reasons (interop with ttm, which will be more
> important once we have dynamic dma-buf) it would be real nice to use the
> reservation_obj lock for all this stuff. msm, being struct_mutex based,
> isn't a great example here. The downside is that it will be a lot harder
> to get  msm to use these then, but much better to not spread struct_mutex
> inspired locking too far.
>

but somewhere you need to protect access to list of bo's that are
available to shrink.. iirc that is the only thing we should need
struct_mutex for now in shrinker path in drm/msm.  The per-bo state is
protected by a per-bo lock.

BR,
-R
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-08-05 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05 14:33 [PATCH 1/2] drm/shmem: Add madvise state and purge helpers Rob Herring
2019-08-05 14:33 ` [PATCH 2/2] drm/panfrost: Add madvise and shrinker support Rob Herring
2019-08-05 15:52   ` Alyssa Rosenzweig
2019-08-05 20:55     ` Rob Herring
2019-08-05 21:08       ` Alyssa Rosenzweig
2019-08-05 16:35 ` [PATCH 1/2] drm/shmem: Add madvise state and purge helpers Daniel Vetter
2019-08-05 17:47   ` Rob Clark [this message]
2019-08-05 21:17     ` Rob Herring
2019-10-16 19:20 ` Sean Paul

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=CAF6AEGtKS4V_CHiYwdUB+USw772n7GVb_sHOoVQ2dDHRxyaU+Q@mail.gmail.com \
    --to=robdclark@gmail.com \
    --cc=airlied@linux.ie \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=robdclark@chromium.org \
    --cc=sean@poorly.run \
    --cc=steven.price@arm.com \
    --cc=tomeu.vizoso@collabora.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 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.