From: "Dave Airlie" <airlied@gmail.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
libc-alpha@sources.redhat.com
Subject: IO space memcpy support for userspace.
Date: Fri, 5 Dec 2008 13:40:43 +1000 [thread overview]
Message-ID: <21d7e9970812041940h29994c60w3e7bcf20b96efe04@mail.gmail.com> (raw)
Hi all (glibc + kernel folks).
So this isn't totally a kernel issue however I'm sure everyone who can
help is around here somewhere.
So in the kernel we have special memcpy_(from,to)io functions that are
used to copy data in out of PCI space,
however when we expose PCI device memory to userspace it has no way to
know the mapping it has been provided
is suitable for optimised userspace copy operations or not.
so eg. on certain IA64 platforms, doing a memcpy on a mmaped PCI
memory area can cause a hard lock.
Now I started to try and fix this in X but I'm wondering if this is
something glibc/kernel can solve between them.
I was firstly thinking about adding memcpy_io/memset_io/str*_io
options to glibc and just have userspace use them.
however this means code that operates on non-IO space objects gets
penalised in those cases. e.g. a sw renderer rendering
to a SW surface vs the same sw renderer rendering to a surface in
video memory. the renderer really doesn't know where the
surface is actually underneath the hood.
So further thinking about this it would be nice if the standard
memcpy/memset/str* realised, hey I'm working on a memory address or
VMA
that is a IO mapping, I really shouldn't do shiny prefetch stuff on
this. I'm not 100% sure how this could be implemented, some sort of
private
mmap return value or flag like MAP_NO_OPTIMISE (I realise this is
going the wrong way as the kernel should tell glibc it, do we even
have a channel for this info?).
Then when memory op is done it checks the memory dest/src to see if
the segment is allowed to optimise or not.
I'm sure this has come up before and I'm sure I'll either wish I never
posted this or someone will show me the crisp corpse of the last guy
who suggested it.
Dave.
next reply other threads:[~2008-12-05 3:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-05 3:40 Dave Airlie [this message]
2008-12-05 17:32 ` Carlos O'Donell
2008-12-05 20:22 ` David Miller
2008-12-06 6:34 ` Dave Airlie
2008-12-06 16:07 ` Carlos O'Donell
2008-12-08 5:24 ` Robert Hancock
2008-12-05 20:27 ` Roland McGrath
2008-12-06 6:30 ` Dave Airlie
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=21d7e9970812041940h29994c60w3e7bcf20b96efe04@mail.gmail.com \
--to=airlied@gmail.com \
--cc=libc-alpha@sources.redhat.com \
--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
all inboxes | Powered by JetHome®