Messages in this thread | | | From | "Chris Smith" <> | Subject | block devices and I/O requests | Date | Mon, 31 May 1999 20:30:47 -0600 |
| |
I have a few questions here about I/O requests -- any answers or pointers to resources would be great!
1. Why does ll_rw_block() have special cases for /dev/md* devices? Is there a reason to do it that way instead of creating the underlying I/O requests in do_md_request? Perhaps there's some locking issue or interrupt problem or something with calling make_request from a request_fn? I'm thinking of doing exactly that (calling make_request for a different device from do_mydriver_request), and the md special case made me think twice about whether it would be allowed.
2. If it is possible, md_make_request does something with the lock bit of the buffer_head. Can someone explain what's going on and whether the same would be required for creating the request from do_xxx_request? I don't really see the buffer_head getting unlocked from make_request (which would have already been called on it) so perhaps it would already be locked in my case? And what's the difference between the lock_buffer() or whatever it's called in make_request and the set_bit(BH_Lock, ...) in md_make_request? Do they do similar things? Does md_make_request not bother to check for contention? (And if not, then why not?)
2. If my request function calls kmalloc, does that make it unsuitable for swapping? I thought I'd heard something about that recently on the list wrt swapping on md devices, but can someone confirm this particular quirk? I can always use a private pool if necessary, but I don't want to do so unless it's really needed.
3. Is there something special about the struct buffer_head that gets passed to make_request? Can I just create one and set it up with the device I want to read from and copy the rest from CURRENT->bh (assuming identical disk geometry)? Or do I have to perform mystical buffering rituals to get a buffer_head? This is not to do actual buffering of I/O -- I specifically want to avoid any of the I/O done internally by my driver being buffered, but I need a struct buffer_head to give to make_request to do the I/O at all.
Sorry for what I'm sure are dumb questions -- I really couldn't find any answers anywhere -- if there is a good resource on these things, I'd be very interested in it.
Chris Smith
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |