On Fri, 26 May 2000, Chaitanya Tumuluri wrote:
|>Hey Matt! What kind of problems and which kernel are you talking
|>about? D'ju have any particular testcase I could use?
I got it to work ... the deal is not to use map_kernel_kiobuf() for
the stuff I'm doing. It's better just to do something like:
#define buffer_size (16 * PAGE_SIZE)
void *ptr;
u_int page, i;
unsigned long addr;
struct kiobuf *data_kiobuf;
/* allocate page and align it */
if (ptr = kmalloc(buffer_size + (PAGE_SIZE * 3))) {
page = (u_int)ptr;
page = (page + (PAGE_SIZE - (page % PAGE_SIZE)));
ptr = (void *)page;
} else {
/* report error and bail */
}
/* fill the kiobuf with pages from our own buffer */
addr = (unsigned long)ptr;
for (i = 0; i < (buffer_size >> PAGE_SHIFT); i++, page += PAGE_SIZE) {
data_kiobuf->maplist[i] = (struct page *)(mem_map * MAP_NR(a));
}
data_kiobuf->nr_pages = (buffer_size >> PAGE_SHIFT);
data_kiobuf->locked = 0;
data_kiobuf->offset = 0;
data_kiobuf->length = buffer_size;
data_kiobuf->private = MAP_PRIVATE;
/* do brw_kiovec on the kiobuf here */
Using map_kernel_kiobuf() turned out to be entirely unnecessary, since
I keep re-using the same maplist[] array. Of course, now I'm dealing
with some corruption in the buffer, and I'm not sure where the offset
problem is coming from. Back to the grindstone ... :)
--Matt
|>-Chait.
|>
|>On Fri, 26 May 2000 17:42:37 PDT, "Matt D. Robinson" <yakker@xxxxxxxxxxxxxx>
wrote:
|>>Hey, Chait! Have you fully tested map_kernel_kiobuf() yet? I've
|>>had a few problems with it ...
|>>
|>>--Matt
|>>
|>>On Fri, 26 May 2000, Chaitanya Tumuluri wrote:
|>>|>Hi,
|>>|>
|>>|>This email is to announce the availability of kiobuf-based I/O
|>>|>functionality for 2.3.99.pre9-2 kernels.
|>>|>
|>>|>First, the I/O queuing and scsi midlayer code in the Linux
|>>|>2.3.99.pre9-2 kernel has been enhanced to handle kiobuf-based
|>>|>I/O requests. Second, Stephen Tweedie's rawio codepath has been
|>>|>extended to use this enhancement to directly issue kiobuf-based
|>>|>requests without having to restuff them into buffer-heads.
|>>|>
|>>|>This change does not change the device access semantics of Stephen
|>>|>Tweedie's code for raw devices. This enhancement only works for scsi
|>>|>disks currently.
|>>|>
|>>|>The complete patch (combining Stephen Tweedie's current patchset
|>>|>for Raw I/O and the new queueing/scsi-midlayer enhancements) is
|>>|>available from:
|>>|>
|>>|> http://oss.sgi.com/projects/rawio
|>>|>
|>>|>Thanks,
|>>|>-Chait.
|>
|