linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jerome Glisse <glisse@freedesktop.org>
To: "Thomas Hellström" <thomas@tungstengraphics.com>
Cc: Nick Piggin <npiggin@suse.de>,
	keith.packard@intel.com, eric@anholt.net, hugh@veritas.com,
	hch@infradead.org, airlied@linux.ie, jbarnes@virtuousgeek.org,
	dri-devel@lists.sourceforge.net,
	Linux Memory Management List <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch] mm: pageable memory allocator (for DRM-GEM?)
Date: Tue, 23 Sep 2008 13:31:37 +0200	[thread overview]
Message-ID: <20080923133137.c9e1f171.glisse@freedesktop.org> (raw)
In-Reply-To: <48D8C326.80909@tungstengraphics.com>

On Tue, 23 Sep 2008 12:21:26 +0200
Thomas Hellstrom <thomas@tungstengraphics.com> wrote:

> Nick Piggin wrote:
> > Hi,
> >
> > So I promised I would look at this again, because I (and others) have some
> > issues with exporting shmem_file_setup for DRM-GEM to go off and do things
> > with.
> >
> > The rationale for using shmem seems to be that pageable "objects" are needed,
> > and they can't be created by userspace because that would be ugly for some
> > reason, and/or they are required before userland is running.
> >
> > I particularly don't like the idea of exposing these vfs objects to random
> > drivers because they're likely to get things wrong or become out of synch
> > or unreviewed if things change. I suggested a simple pageable object allocator
> > that could live in mm and hide the exact details of how shmem / pagecache
> > works. So I've coded that up quickly.
> >
> > Upon actually looking at how "GEM" makes use of its shmem_file_setup filp, I
> > see something strange... it seems that userspace actually gets some kind of
> > descriptor, a descriptor to an object backed by this shmem file (let's call it
> > a "file descriptor"). Anyway, it turns out that userspace sometimes needs to
> > pread, pwrite, and mmap these objects, but unfortunately it has no direct way
> > to do that, due to not having open(2)ed the files directly. So what GEM does
> > is to add some ioctls which take the "file descriptor" things, and derives
> > the shmem file from them, and then calls into the vfs to perform the operation.
> >
> > If my cursory reading is correct, then my allocator won't work so well as a
> > drop in replacement because one isn't allowed to know about the filp behind
> > the pageable object. It would also indicate some serious crack smoking by
> > anyone who thinks open(2), pread(2), mmap(2), etc is ugly in comparison...
> >
> > So please, nobody who worked on that code is allowed to use ugly as an
> > argument. Technical arguments are fine, so let's try to cover them.
> >
> >   
> Nick,
>  From my point of view, this is exactly what's needed, although there 
> might be some different opinions among the
> DRM developers. A question:
> 
> Sometimes it's desirable to indicate that a page / object is "cleaned", 
> which would mean data has moved and is backed by device memory. In that 
> case one could either free the object or indicate to it that it can 
> release it's pages. Is freeing / recreating such an object an expensive 
> operation? Would it, in that case, be possible to add an object / page 
> "cleaned" function?
> 
> /Thomas

Also what about a uncached page allocator ? As some drivers might need
them, there is no number but i think their was some concern that changing
PAT too often might be costly and that we would better have a poll of
such pages.

Cheers,
Jerome Glisse <glisse@freedesktop.org>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-09-23 11:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-23  9:10 Nick Piggin
2008-09-23 10:21 ` Thomas Hellström
2008-09-23 11:31   ` Jerome Glisse [this message]
2008-09-23 13:18     ` Christoph Lameter
2008-09-25  0:18   ` Nick Piggin
2008-09-25  7:19     ` Thomas Hellström
2008-09-25 14:38       ` Keith Packard
2008-09-25 15:39         ` Thomas Hellström
2008-09-25 22:41           ` Dave Airlie
2008-09-23 15:50 ` Keith Packard
2008-09-23 18:29   ` Jerome Glisse
2008-09-25  0:30   ` Nick Piggin
2008-09-25  1:20     ` Keith Packard
2008-09-25  2:30       ` Nick Piggin
2008-09-25  2:43         ` Keith Packard
2008-09-25  3:07           ` Nick Piggin
2008-09-25  6:16             ` Keith Packard
2008-09-25  8:45 ` KAMEZAWA Hiroyuki
2008-09-30  1:10 ` Eric Anholt
2008-10-02 17:15   ` Jesse Barnes
2008-10-03  5:17     ` Keith Packard
2008-10-03  6:40       ` Nick Piggin
2008-09-23  9:10 Nick Piggin

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=20080923133137.c9e1f171.glisse@freedesktop.org \
    --to=glisse@freedesktop.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=eric@anholt.net \
    --cc=hch@infradead.org \
    --cc=hugh@veritas.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=keith.packard@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    --cc=thomas@tungstengraphics.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