All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Maathuis <madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Some ideas on how to mix userspace fifo's with a kernel memory manager
Date: Sat, 20 Dec 2008 13:58:41 +0100	[thread overview]
Message-ID: <494CEC01.9020801@gmail.com> (raw)

I was thinking of the following system:

Allocate a fifo for userspace, map the fifo, map the fifo registers into 
userspace.
These allocations are therefore pinned, so something to avoid memory 
fragmentation has to be done.

Userspace library fills up an entire fifo, minus a few essential things 
i will mention later. Userspace does ioctl with all the bo's it'll need 
for the fifo. Kernel pins all these bo's, creates several dma objects 
that covers only a single bo (as a form of memory protection). Kernel 
sends back a list of these object handles + a list of ref_cnt values 
that have to inserted after the bo usage is done. Userspace fills in the 
remaining values and fires the fifo.

Later, under memory pressure for example, the memory manager checks 
which bo's can be unpinned.

So you'll still need an ioctl, but you do avoid a copy into kernel 
space, which might hurt for stuff like hostdata transfers.

As usual, comment is appreciated.

Maarten.

             reply	other threads:[~2008-12-20 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-20 12:58 Maarten Maathuis [this message]
     [not found] ` <fc5b84ad0812201308r5fab4534j93ebe66b7b486319@mail.gmail.com>
     [not found]   ` <fc5b84ad0812201308r5fab4534j93ebe66b7b486319-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-12-20 22:48     ` Some ideas on how to mix userspace fifo's with a kernel memory manager Maarten Maathuis
     [not found]       ` <494D7651.9050005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-12-21  0:51         ` Maarten Maathuis

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=494CEC01.9020801@gmail.com \
    --to=madman2003-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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 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.