raw I/O with device memory

Mateu Batle i Sastre (mbatle@iname.com)
Tue, 4 May 1999 17:35:06 +0200


Hi,

I've tried the raw I/O patch for Linux 2.2.4 (located in
ftp://ftp.uk.linux.org/pub/linux/sct/fs/raw-io/). It works
fine but there are a few problems.

1st) It does not work with memory located in a PCI device.
Of course, already mapped to a user space process. I could
workaround this in an *ugly* way by patching my SCSI controller
driver (Adaptec 2940UW). The patch was simply to change

#define VIRT_TO_BUS(x) (virt_to_bus(x))

by

#define VIRT_TO_BUS(x) (__pa(x))

Apparently, there is some problem with the translation from kernel
virtual address to bus address. I've seen in one place is done
using arithmetic and in the other using bit operations, and they
are not always interchangeable.

2nd) The patch I did makes the system working as it should, but
after some time running it crashes. I got the error:
"kmem_alloc: Bad slab magic (corrupt) (name=size-128)".

I think the problem in this case is that some memory is not deallocated in
the kernel.
I can track it with cat /proc/slabinfo which shows the area size-128 is
incrementing
when I'm transferring data without the memory being released.

I suspect it is related with the buffer_header which are not released
(funtion
get_unused_buffer_header). But this does not seem to happen with the raw I/O
patch
and normal system memory. Any idea ?

Thanks in advance,
Mateu

-
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/