[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] malloc, timers, and crashes.



On Thu, Dec 06, 2001 at 03:54:27PM -0500, Ken Emmons, Jr. wrote:
> Hello,
> 
> I am trying to create a doubly linked list in order to keep track of timers on my system. It is similar to the way they do it in the Linux kernel, but obviously much faster polling for RT purposes. Certain function calls in my API will allocate memory for a structure and then call a function to isert this structure intot he list.  I tried using:
> 
> my_struct_t my_struct;
> my_struct = kmalloc( sizeof(my_struct_t), GFP_ATOMIC); 
> 
> within a periodic RT task and it appears to crash my machine. 
> 
> Is this supposed to work in RTLinux?? If not how do I get free memory?? Do I have to set aside a free block of ram and create my own memory allocation algorithms?? Does RTLinux have a preferred mechanism?

The mbuff driver is pretty gooD. Works like a hash table; you can set
aside a named bit of space...

The thing is, for that app, you should probably just use a normal
variable to stash your values; that way, you'll never have to run into
these problems.

If you're using linked lists and the like inside your RT stuff,
perhpas you should re-think your implementation?

Gary (-;