Re: [PATCH] Export shmem_file_setup and shmem_getpage for DRM-GEM

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: John Stoffel <john@...>
Cc: <keithp@...>, Christoph Hellwig <hch@...>, Eric Anholt <eric@...>, <linux-kernel@...>
Date: Sunday, August 3, 2008 - 1:52 pm

On Sun, 2008-08-03 at 08:49 -0400, John Stoffel wrote:


We're not having any trouble with upwards of 40000 shmem file objects at
this point. Most of these are around 4 pages in size, although they
range up to around 16MB. A typical 3D game will use around 100MB or so
of this kind of data at one time.


Not really; these are objects used in the rendering process, vertices,
command buffers, constant buffers, textures, programs, rendering
surfaces and various other state buffers.  Lots of these are write-once
(from the CPU) and read-many (from the GPU), like textures, programs and
vertices. Some of these are effectively streamed from the CPU to the
GPU.

Each sequence of rendering commands requires that a set of these objects
be pinned to physical memory and bound to the graphics translation table
within the GPU.

Oh, and I allocate enough that I need to make them pageable as well;
under memory pressure, I can pull objects back out of the GTT binding
table and unpin the pages, letting shmem write them to disk.


I could use fds if the kernel supported applications needing many
thousand of them, and also some way to keep these FDs from polluting the
fd space used by select(2) (yeah, I know, don't use select).


I'm not worried about BSD; I want to build the right API for Linux at
this point.

And, yes, thousands of objects per 3D application. Each X pixmap will
end up in one of these objects as well, and so something like Firefox
will likely allocate several hundred. To keep the rendering engine busy,
we'll have a couple hundred command buffers allocated as well, of 16KB
apiece.


That's what I'm doing at present; the card is opened with a single fd
and then these shmem objects are allocated within an ioctl from there.
What I don't want to do is use a single linear address space for these
objects; it's just useless overhead.


Suggestions welcome; I just need a few thousand multi-page allocations,
which the kernel deals with quite easily these days.

--=20
keith.packard@intel.com
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] PCI: Add pci_read_base() API, Eric Anholt, (Fri Aug 1, 2:58 am)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Christoph Hellwig, (Sun Aug 10, 9:30 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Stephane Marchesin, (Wed Aug 6, 12:20 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Christoph Hellwig, (Sun Aug 10, 9:34 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Stephane Marchesin, (Wed Aug 6, 10:16 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Stephane Marchesin, (Wed Aug 6, 1:32 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Stephane Marchesin, (Wed Aug 6, 2:09 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Christoph Hellwig, (Sun Aug 10, 9:23 pm)
Re: [PATCH] Export shmem_file_setup for DRM-GEM, Keith Packard, (Sun Aug 10, 11:03 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Keith Packard, (Sun Aug 3, 1:52 pm)