Vmalloc does not allocate physically contiguous memory. This should not be a problem -
unless
you are using it with a device that needs contiguous memory. However, in Linux 2.4.? ,
Linus
changed vmalloc to do a lazy allocation in order to fix a x86/SMP bug that had never
been seen. As
a result, modules can page fault on vmalloced memory. The solution is to break Linus'
fix
and fix in a different way. This is done in the Michael's vmalloc patch which we
posted to the
list.
Linus was worried about a smp x86 system where a fork and a vmalloc are concurrent and
the forked
process builds a page directory using data that is incorrect - since the vmalloc is
changing the
page directory entries describing shared kernel address space.
On Tue, Apr 10, 2001 at 02:41:06PM -0700, Basham, Richard R wrote:
> Ken,
>
> I believe that your assumption about the buffer not being contiguous is correct.
>Therefore, you should let the task run past the end of the buffer. If you want to
>keep this functionality without too much effort you could revert the old method of
>allocating shared memory by reserving it at boot up through lilo. This memory is
>contiguous.
>
> I hope this helps,
>
> Rich
>
> > ----------
> > From: Ken Teh[SMTP:[EMAIL PROTECTED]]
> > Reply To: [EMAIL PROTECTED]
> > Sent: Tuesday, April 10, 2001 1:59 PM
> > To: Real Time Linux
> > Subject: [rtl] paging problem with RTL-3.0
> >
> > It appears that I cannot page when running my rt code. RTLinux is version
> > 3.0
> >
> > I have a statically defined buffer that is partitioned into n+2 buffers, each
> > 2048 bytes long and a function that fills these buffers with multiple
> > blocks of "event" data. The function writes arbitrary length event data and
> > I allow the function to overrun a buffer boundary. The calling function
> > actually catches the overrun and translates (shifts) the "last" event into
> > the next buffer so that the completed buffer does not contain partial event
> > data.
> >
> > The system does an oops when the function overflows from buffer 1 (first
> > buffer is buffer 0) into buffer 2. At times it's worse -- it resets the
> > computer and goes into the reboot cycle. If I fix the function so it never
> > overruns a buffer boundary, then the code runs without any problems.
> >
> > The n buffers are actually made into a circular buffer queue. The n+1
> > buffer is used for the overflow of buffer n, and the n+2 buffer is the
> > temporary buffer which I use to translate an event data block that has
> > overrun a buffer boundary. I've checked that with my modified function
> > (that does not overrun a buffer boundary), that the buffers "circulate"
> > without any problems.
> >
> > My inference is that my logically contiguous buffer that is partitioned into
> > n+2 buffers is not really physically contiguous and that when my function
> > overflows buffer 1, ie, crosses a page boundary, the system does a hard
> > crash. I have the same behaviour with the mbuff device. The function is
> > called by a thread that is dispatched by an interrupt handler.
> >
> > Can anyone shed light on this?
> >
> > The oops message repeats, but I don't know how to read an oops and I've seen
> > 2 varieties of oops messages - one says kernel cannot deference NULL virtual
> > pointer, process is init, the second variety says something about trying to
> > kill an interrupt handler, aiee killing idle task. I'm not sure I believe
> > either one.
> >
> > Ken
> >
> > -- [rtl] ---
> > To unsubscribe:
> > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> > echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> > --
> > For more information on Real-Time Linux see:
> > http://www.rtlinux.org/rtlinux/
> >
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
--
---------------------------------------------------------
Victor Yodaiken
Finite State Machine Labs: The RTLinux Company.
www.fsmlabs.com www.rtlinux.com
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/