All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
To: Rob Herring <robh@kernel.org>
Cc: Rob Clark <robdclark@chromium.org>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	Steven Price <steven.price@arm.com>
Subject: Re: [PATCH 2/2] drm/panfrost: Add madvise and shrinker support
Date: Mon, 5 Aug 2019 08:52:09 -0700	[thread overview]
Message-ID: <20190805155209.GA5909@kevin> (raw)
In-Reply-To: <20190805143358.21245-2-robh@kernel.org>


[-- Attachment #1.1: Type: text/plain, Size: 1220 bytes --]

> +/* madvise provides a way to tell the kernel in case a buffers contents
> + * can be discarded under memory pressure, which is useful for userspace
> + * bo cache where we want to optimistically hold on to buffer allocate
> + * and potential mmap, but allow the pages to be discarded under memory
> + * pressure.
> + *
> + * Typical usage would involve madvise(DONTNEED) when buffer enters BO
> + * cache, and madvise(WILLNEED) if trying to recycle buffer from BO cache.
> + * In the WILLNEED case, 'retained' indicates to userspace whether the
> + * backing pages still exist.
> + */
> +#define PANFROST_MADV_WILLNEED 0	/* backing pages are needed, status returned in 'retained' */
> +#define PANFROST_MADV_DONTNEED 1	/* backing pages not needed */
> +
> +struct drm_panfrost_madvise {
> +	__u32 handle;         /* in, GEM handle */
> +	__u32 madv;           /* in, PANFROST_MADV_x */
> +	__u32 retained;       /* out, whether backing store still exists */
> +};

Just to clarify about the `retained` flag: if userspace does a
madvise(WILLNEED) and we find out that retained=0, what's supposed to
happen?

Should userspace evict the BO from its local cache and allocate one
fresh? Or just remmap? Or something else?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

  reply	other threads:[~2019-08-05 15:52 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 [this message]
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
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=20190805155209.GA5909@kevin \
    --to=alyssa.rosenzweig@collabora.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robdclark@chromium.org \
    --cc=robh@kernel.org \
    --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.