-   Programming (
-   -   kiobuf vs. mmap (

j4r0d 01-06-2005 08:59 PM

kiobuf vs. mmap
hi everyone! i'm trying to research which of the two, kiobuf and mmap, is better to use in DMA. i need info in their advantages and disadvantages.

i was thinking of making a direct access from kernel memory to user memory or vice versa for faster and more efficient data transfer. now, i have kiobuf and mmap to choose from. is there someone who have any experience in using any of these? thank you so in advance for all your help! :D

shishir 01-07-2005 12:16 AM

from what i know...mmap is definitely faster but if speed is not an issue..i think kiobuf is also good enough...

good details are there in linux device drivers: chapter 13 mmap & dma
this thread may be of some interest to you:

j4r0d 01-07-2005 02:05 AM

thanks shishir! i already read the mailing list and chapter 13 of the "linux device drivers" book. It was helpful but I need more specific details like:

1. comparing "kiobuf vs "mmap" in terms of efficiency (no. of copies, overhead, etc)
2. their advantages/disadvantages

hope i could find some details on these. thank you in advance and thanks again to your suggestions! ;)

shishir 01-07-2005 05:40 AM

i cant tell you readily cos this is what i knew from when i read the book ....but i can dig in and try to get some info by tomorrow..there is no ready material that compares the two approaches...

shishir 01-07-2005 07:42 AM

these two links should be a good place to help you decide for mmap.. not very huge pools of info but good enough
this is mainly for scsi-generic but does make for interesting reading with regards to copying data between user land and kernel land

am still looking for more answers :)

shishir 01-10-2005 01:49 AM

i dunno if you have been able to find any conclusive answers ..but after some digging i have found that kiobuf is not really that great an interface as it splits large IO operations into small operations thus taking too much time...btw an addendum: kiobufs have been removed totally from the 2.6 series and been replaced by bio_map_user (), a zero-copy block IO method.

in case you have been able to come up with a better technique..please do enlighten :), thanks

j4r0d 01-10-2005 02:19 AM

Ur right...
ei thanks for the two links you gave me about the SCSIs. It's a good material for additional info. And ur right about the removal of kiobuf on the current lk version :( actually i read somewhere that it was added on the lk ver 2.3 and removed from ver 2.5 onwards. btw, may i know where did you get the info that

...kiobuf is not really that great an interface as it splits large IO operations into small operations thus taking too much time...
thank you again so much for all your time and effort! soon i'll be able to conclude which would be better to use then :cool:

shishir 01-10-2005 02:38 AM

this is the link that talks about porting drivers from earlier versions to 2.6

j4r0d 01-10-2005 04:18 AM

thanks! thanks! thanks!
thank you so much again for the link. you have been so meaningful to my research. i wanna thank you since i am really new to linux so i'm having a hard time reserching for these stuff which seem alien to me :D as of now (i hope :rolleyes: ). Thanks shishir!

All times are GMT -5. The time now is 01:43 PM.