From: Keith Packard <keithp@keithp.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: keithp@keithp.com, Eric Anholt <eric@anholt.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Export shmem_file_setup for DRM-GEM
Date: Sun, 10 Aug 2008 23:03:17 -0400 [thread overview]
Message-ID: <1218423797.10772.48.camel@koto.keithp.com> (raw)
In-Reply-To: <20080811012347.GA27264@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 2438 bytes --]
On Sun, 2008-08-10 at 21:23 -0400, Christoph Hellwig wrote:
> shmfs is perfectly happy to have thousands of files, there are workloads
> that have a lot more than that. Note that in other subthreads there is
> the assumption that all of them are open and in the fd table at the same
> time. I haven't really seen a good explanation for that - objects on
> shmfs are persistant until deleted, and when you keep your parent
> directory fd open an openat to get at the actual object is cheap.
A typical GPU-intensive application will have a few thousand objects
full of GPU-bound data containing GPU commands, vertices, textures,
rendering buffers, constants and other misc GPU state.
When rendering a typical frame, all of these objects will be referenced
in turn -- each frame is much like the last, so the process of drawing
the frame ends up using almost exactly the same data each time. It's an
animation after all.
Any kind of resource constraint places severe pressure on an eviction
policy -- the obvious 'LRU' turns out to be almost exactly wrong as you
always eject the objects which are next in line for re-use. Obviously,
the right solution is to avoid artificial resource constraints, and
minimize the impact of real constraints.
Limiting the number of objects we can have in-use at a time (by limiting
the number of open FDs) is an artificial resource constraint, forcing
re-use of closed objects to pay an extra openat cost. That may be cheap,
but it's not free.
Plus, we don't want persistent objects here -- when the application
exits, we want the objects to disappear automatically; otherwise you'll
clutter shmem with thousands of spurious files when an application
crashes. So, if we create shmem files, we'll want to unlink them
immediately, leaving only the fd in place to refer to them.
Our alternative is to open the shmem file and pass the fd into our
driver to hold onto the file while the application closes the fd.
I see that as simply a kludge to work around the absence of anonymous
pageable file allocation -- it seems like an abuse of the current API.
Perhaps we should construct a different API to allocate a pageable
object? Having shmem expose these as 'files' doesn't make a lot of sense
in this context, it just happens to be an easy way to plug them into the
vm system, as is evidenced by ipc/shm using them as well.
--
keith.packard@intel.com
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-08-11 3:03 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-01 6:58 [PATCH] PCI: Add pci_read_base() API Eric Anholt
2008-08-01 6:58 ` [PATCH] Export shmem_file_setup and shmem_getpage for DRM-GEM Eric Anholt
2008-08-01 6:58 ` [PATCH] drm: Add GEM ("graphics execution manager") to i915 driver Eric Anholt
2008-08-01 15:44 ` Randy Dunlap
2008-08-01 18:11 ` Keith Packard
2008-08-06 1:11 ` Eric Anholt
2008-08-01 7:10 ` [PATCH] Export shmem_file_setup and shmem_getpage for DRM-GEM Eric Anholt
2008-08-01 10:57 ` Hugh Dickins
2008-08-01 18:06 ` Keith Packard
2008-08-01 20:50 ` Christoph Hellwig
2008-08-01 23:01 ` Keith Packard
2008-08-03 12:49 ` John Stoffel
2008-08-03 17:52 ` Keith Packard
2008-08-03 23:35 ` files/process scaling problem? (was: [PATCH] Export shmem_file_setup and shmem_getpage for DRM-GEM) Ingo Oeser
2008-08-04 0:19 ` Keith Packard
2008-08-04 8:19 ` Alan Cox
2008-08-04 13:51 ` Arjan van de Ven
2008-08-04 14:11 ` Alan Cox
2008-08-04 16:38 ` Arjan van de Ven
2008-08-04 16:58 ` Keith Packard
2008-08-04 21:46 ` Ingo Oeser
2008-08-04 22:20 ` Dave Airlie
2008-08-05 0:34 ` Keith Packard
2008-08-11 1:23 ` [PATCH] Export shmem_file_setup and shmem_getpage for DRM-GEM Christoph Hellwig
2008-08-11 3:03 ` Keith Packard [this message]
2008-08-04 1:54 ` Keith Packard
2008-08-04 9:02 ` Nick Piggin
2008-08-04 10:26 ` Keith Packard
2008-08-04 10:43 ` Nick Piggin
2008-08-04 11:45 ` Keith Packard
2008-08-04 17:09 ` Hugh Dickins
2008-08-04 17:25 ` Keith Packard
2008-08-04 18:39 ` Hugh Dickins
2008-08-04 19:20 ` Keith Packard
2008-08-04 19:55 ` Hugh Dickins
2008-08-04 21:37 ` Keith Packard
2008-08-05 2:25 ` John Stoffel
2008-08-05 4:28 ` Keith Packard
2008-08-06 16:20 ` Stephane Marchesin
2008-08-06 17:24 ` Arjan van de Ven
2008-08-06 17:32 ` Stephane Marchesin
2008-08-06 17:56 ` Keith Packard
2008-08-06 18:09 ` Stephane Marchesin
2008-08-06 21:22 ` Keith Packard
2008-08-07 2:16 ` Stephane Marchesin
2008-08-07 2:57 ` Keith Packard
2008-08-11 1:34 ` Christoph Hellwig
2008-08-05 4:28 ` Nick Piggin
2008-08-11 1:30 ` Christoph Hellwig
2008-08-04 21:58 ` Keith Packard
2008-08-04 22:22 ` Dave Airlie
2008-08-05 4:43 ` Nick Piggin
2008-08-05 5:19 ` Keith Packard
2008-08-07 0:45 ` Jesse Barnes
2008-08-19 1:17 ` Dave Airlie
2008-08-19 10:00 ` Nick Piggin
2008-08-19 16:46 ` Keith Packard
2008-08-19 18:50 ` Jesse Barnes
2008-08-21 13:42 ` Jerome Glisse
2008-08-21 16:15 ` Jesse Barnes
-- strict thread matches above, loose matches on Subject: below --
2008-08-26 19:43 [resubmit] Add GEM to i915 DRM driver Eric Anholt
2008-08-26 19:43 ` [PATCH] Export shmem_file_setup for DRM-GEM Eric Anholt
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=1218423797.10772.48.camel@koto.keithp.com \
--to=keithp@keithp.com \
--cc=eric@anholt.net \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox