|
From: <cw...@so...> - 2001-11-27 21:22:40
|
> I have wrestled with this as well. I haven't thought of a better solution > myself yet. does there have to be a solution other than the one that exists now? as far as i know, mmap can fail, thus indicating more than enough information to the program. (much like a failing malloc foretells of bad things to happen). i don't know posix in and out, but i am sure mmap is part of poxis (quick man page tells me so). it seems to not have a ENETDEV return code though :^). perhaps add something like that (and break posix), or use EACCESS perhaps. I'd like to hear Linus's proposition to this, simply because I do feel that removing mmap will cause nothing but problems in the long run. another possible thing to do would be to break /dev into 2 sub dirs, /dev/local and /dev/network, though that seems really crappy from the start and devfs probably doesnt allow that to work (i use kernel 2.2.16 at the moment, so i havn't dealt with devfs yet, nor usbdevfs). or, extend file flags (nrwxrwxrwx for net devices or something), but i don't know how fileflags really work (or even what their correct name is :^( none really work well, but im sure someone can think of something. chris --- moc.lexiptfos@thgirwc --- |
|
From: James S. <jsi...@tr...> - 2001-11-27 22:52:26
|
> does there have to be a solution other than the one that exists now? Yes I like mmap to a large degree. In fact one of the things that has always excited me was the idea of using kio buffers to manage graphics hardware like the disk layer does. Think about the speed improvements since we wouldn't be going threw the VM layer. Basically we have raw IO instead of for disk for graphcis hardware. Plus we get the bounus of not worrying about inheritance issues. IRIX doesn't allow the graphics engine resources to be inherted. You could be but would be quite complex to handle. This includes file handles as well as mmapped resources. Some much more as well. Since the networking layer some day is going to go over to kio buffers in theory we could just feed data directly from the network hardware into the graphics hardware. Locally we could use enhanced version of mmap, read and write. Okay enough about my pipe dreams :-) |
|
From: Chris W. <cw...@so...> - 2001-11-28 19:52:55
|
> Yes I like mmap to a large degree. In fact one of the things that has
> always excited me was the idea of using kio buffers to manage graphics
> hardware like the disk layer does. Think about the speed improvements
> since we wouldn't be going threw the VM layer. Basically we have raw
> IO instead of for disk for graphcis hardware. Plus we get the bounus of
> not worrying about inheritance issues. IRIX doesn't allow the graphics
so true! when vesa2 came out, with linear framebuffers and everything, i
was estatic. no more bank switching etc. I would assume similar things
for disk access, as well as perhaps sound buffers and nic buffers, but i
have yet to deal directly with them at the hardware level (discovered
linux first).
> the graphics hardware. Locally we could use enhanced version of mmap, read
> and write.
"enhanced version of mmap, read and write." :^)
unless read and write become special compiler macro type things, i still
fail to see how any amount of enhancing done to read/write will approach
buffer[offset]. best case, you could write in blocks or 65536b or more,
and simply flag it's length and have read/write internally to the
buffer[offset] (similar to memmov), but when you only modify a single
pixel/byte, read/write would at least double the execution time.
despite this, much of the graphics world at least seems to be moving to
hardware accleration, so instead of reading/writing a lot of data, you
only read/write 'instructions' to the card. this is still useless when
you _want_ to use fb as is (for some efect that can't be/isn't implimented
in hardware). even this is combated by the new programmable gfx cards,
which makes fb effects done by the cpu seem even more obsolete. but this
would severely limit the older machines that have either no hardware
acceleration or no drivers to run the hardware. (or, the user is aganst
using hardware that uses only closed source drivers)
compared to the above, it would be fairly trivial to add an
if(mmap_failed)
{
read/write to buffer
}
else
{
use mmap'd buffer
}
to any kind of program that would need it, which makes the elimination of
mmap seem counterproductive when network transparency is not needed.
chris
--- moc.lexiptfos@thgirwc ---
|
|
From: James S. <jsi...@tr...> - 2001-11-28 21:27:40
|
> > the graphics hardware. Locally we could use enhanced version of mmap, read > > and write. > > "enhanced version of mmap, read and write." :^) Yes. The only problem with kio buffers are they are hard drive specific so they carry alot of extra weight. This is one of the main reasons kio buffers haven't been used in the network layer yet. > unless read and write become special compiler macro type things, i still > fail to see how any amount of enhancing done to read/write will approach > buffer[offset]. The whole point of kio buffers is to avoid a copy_[from/to]_user. You have direct access to kernel memory space. This makes read/write as good if not better than mmap. The only draw back is the offset issue with read/write. Of course we have pread and pwrite to overcome this limitation. |